Remove redundant explicit types

See gh-18754
This commit is contained in:
dreis2211
2019-10-26 23:34:08 +02:00
committed by Stephane Nicoll
parent ee0a66a2af
commit 9ece2e277f
11 changed files with 11 additions and 12 deletions

View File

@@ -80,7 +80,7 @@ abstract class HealthEndpointSupport<C, T> {
Object contributor = getContributor(path, pathOffset);
T health = getContribution(apiVersion, group, contributor, showComponents, showDetails,
isSystemHealth ? this.groups.getNames() : null);
return (health != null) ? new HealthResult<T>(health, group) : null;
return (health != null) ? new HealthResult<>(health, group) : null;
}
@SuppressWarnings("unchecked")

View File

@@ -66,7 +66,7 @@ public class SimpleHttpCodeStatusMapper implements HttpCodeStatusMapper {
}
private static Map<String, Integer> getUniformMappings(Map<String, Integer> mappings) {
Map<String, Integer> result = new LinkedHashMap<String, Integer>();
Map<String, Integer> result = new LinkedHashMap<>();
for (Map.Entry<String, Integer> entry : mappings.entrySet()) {
String code = getUniformCode(entry.getKey());
if (code != null) {

View File

@@ -38,7 +38,7 @@ public class SimpleStatusAggregator implements StatusAggregator {
private static final List<String> DEFAULT_ORDER;
static {
List<String> defaultOrder = new ArrayList<String>();
List<String> defaultOrder = new ArrayList<>();
defaultOrder.add(Status.DOWN.getCode());
defaultOrder.add(Status.OUT_OF_SERVICE.getCode());
defaultOrder.add(Status.UP.getCode());

View File

@@ -177,8 +177,7 @@ class HealthEndpointWebIntegrationTests {
ReactiveHealthContributorRegistry reactiveHealthContributorRegistry(
Map<String, HealthContributor> healthContributorBeans,
Map<String, ReactiveHealthContributor> reactiveHealthContributorBeans) {
Map<String, ReactiveHealthContributor> allIndicators = new LinkedHashMap<String, ReactiveHealthContributor>(
reactiveHealthContributorBeans);
Map<String, ReactiveHealthContributor> allIndicators = new LinkedHashMap<>(reactiveHealthContributorBeans);
healthContributorBeans.forEach((name, contributor) -> allIndicators.computeIfAbsent(name,
(key) -> ReactiveHealthContributor.adapt(contributor)));
return new DefaultReactiveHealthContributorRegistry(allIndicators);

View File

@@ -91,7 +91,7 @@ class NamedContributorsMapAdapterTests {
}
private TestNamedContributorsMapAdapter<String> createAdapter() {
Map<String, String> map = new LinkedHashMap<String, String>();
Map<String, String> map = new LinkedHashMap<>();
map.put("one", "one");
map.put("two", "two");
TestNamedContributorsMapAdapter<String> adapter = new TestNamedContributorsMapAdapter<>(map, this::reverse);