diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/health/AutoConfiguredHealthEndpointGroups.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/health/AutoConfiguredHealthEndpointGroups.java index 71dc2d575b..b0001dafaa 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/health/AutoConfiguredHealthEndpointGroups.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/health/AutoConfiguredHealthEndpointGroups.java @@ -85,7 +85,7 @@ class AutoConfiguredHealthEndpointGroups implements HealthEndpointGroups { private Map createGroups(Map groupProperties, BeanFactory beanFactory, StatusAggregator defaultStatusAggregator, HttpCodeStatusMapper defaultHttpCodeStatusMapper, Show defaultShowComponents, Show defaultShowDetails, Set defaultRoles) { - Map groups = new LinkedHashMap(); + Map groups = new LinkedHashMap<>(); groupProperties.forEach((groupName, group) -> { Status status = group.getStatus(); Show showComponents = (group.getShowComponents() != null) ? group.getShowComponents() diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/health/HealthAggregatorStatusAggregatorAdapter.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/health/HealthAggregatorStatusAggregatorAdapter.java index ac52d400f4..19c002de4a 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/health/HealthAggregatorStatusAggregatorAdapter.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/health/HealthAggregatorStatusAggregatorAdapter.java @@ -43,7 +43,7 @@ class HealthAggregatorStatusAggregatorAdapter implements StatusAggregator { @Override public Status getAggregateStatus(Set statuses) { int index = 0; - Map healths = new LinkedHashMap(); + Map healths = new LinkedHashMap<>(); for (Status status : statuses) { index++; healths.put("health" + index, asHealth(status)); diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/health/HealthContributorRegistryHealthIndicatorRegistryAdapter.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/health/HealthContributorRegistryHealthIndicatorRegistryAdapter.java index 41c38f3ccb..e99f170b6f 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/health/HealthContributorRegistryHealthIndicatorRegistryAdapter.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/health/HealthContributorRegistryHealthIndicatorRegistryAdapter.java @@ -67,7 +67,7 @@ class HealthContributorRegistryHealthIndicatorRegistryAdapter implements HealthI @Override public Map getAll() { - Map all = new LinkedHashMap(); + Map all = new LinkedHashMap<>(); for (NamedContributor namedContributor : this.contributorRegistry) { if (namedContributor.getContributor() instanceof HealthIndicator) { all.put(namedContributor.getName(), (HealthIndicator) namedContributor.getContributor()); diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/health/HealthIndicatorProperties.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/health/HealthIndicatorProperties.java index b72d49f036..930707a7a4 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/health/HealthIndicatorProperties.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/health/HealthIndicatorProperties.java @@ -37,7 +37,7 @@ public class HealthIndicatorProperties { private List order = new ArrayList<>(); - private final Map httpMapping = new LinkedHashMap(); + private final Map httpMapping = new LinkedHashMap<>(); @DeprecatedConfigurationProperty(replacement = "management.endpoint.health.status.order") public List getOrder() { diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/HealthEndpointSupport.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/HealthEndpointSupport.java index 932bfdbe45..b64a4e7f64 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/HealthEndpointSupport.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/HealthEndpointSupport.java @@ -80,7 +80,7 @@ abstract class HealthEndpointSupport { Object contributor = getContributor(path, pathOffset); T health = getContribution(apiVersion, group, contributor, showComponents, showDetails, isSystemHealth ? this.groups.getNames() : null); - return (health != null) ? new HealthResult(health, group) : null; + return (health != null) ? new HealthResult<>(health, group) : null; } @SuppressWarnings("unchecked") diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/SimpleHttpCodeStatusMapper.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/SimpleHttpCodeStatusMapper.java index 0c6616b8ab..934c36b6f6 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/SimpleHttpCodeStatusMapper.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/SimpleHttpCodeStatusMapper.java @@ -66,7 +66,7 @@ public class SimpleHttpCodeStatusMapper implements HttpCodeStatusMapper { } private static Map getUniformMappings(Map mappings) { - Map result = new LinkedHashMap(); + Map result = new LinkedHashMap<>(); for (Map.Entry entry : mappings.entrySet()) { String code = getUniformCode(entry.getKey()); if (code != null) { diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/SimpleStatusAggregator.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/SimpleStatusAggregator.java index 6fc5d82b6b..37f75fbee5 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/SimpleStatusAggregator.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/SimpleStatusAggregator.java @@ -38,7 +38,7 @@ public class SimpleStatusAggregator implements StatusAggregator { private static final List DEFAULT_ORDER; static { - List defaultOrder = new ArrayList(); + List defaultOrder = new ArrayList<>(); defaultOrder.add(Status.DOWN.getCode()); defaultOrder.add(Status.OUT_OF_SERVICE.getCode()); defaultOrder.add(Status.UP.getCode()); diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/HealthEndpointWebIntegrationTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/HealthEndpointWebIntegrationTests.java index ca11aec206..9d95c6cf52 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/HealthEndpointWebIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/HealthEndpointWebIntegrationTests.java @@ -177,8 +177,7 @@ class HealthEndpointWebIntegrationTests { ReactiveHealthContributorRegistry reactiveHealthContributorRegistry( Map healthContributorBeans, Map reactiveHealthContributorBeans) { - Map allIndicators = new LinkedHashMap( - reactiveHealthContributorBeans); + Map allIndicators = new LinkedHashMap<>(reactiveHealthContributorBeans); healthContributorBeans.forEach((name, contributor) -> allIndicators.computeIfAbsent(name, (key) -> ReactiveHealthContributor.adapt(contributor))); return new DefaultReactiveHealthContributorRegistry(allIndicators); diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/NamedContributorsMapAdapterTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/NamedContributorsMapAdapterTests.java index 9160356992..8643d3bdff 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/NamedContributorsMapAdapterTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/NamedContributorsMapAdapterTests.java @@ -91,7 +91,7 @@ class NamedContributorsMapAdapterTests { } private TestNamedContributorsMapAdapter createAdapter() { - Map map = new LinkedHashMap(); + Map map = new LinkedHashMap<>(); map.put("one", "one"); map.put("two", "two"); TestNamedContributorsMapAdapter adapter = new TestNamedContributorsMapAdapter<>(map, this::reverse); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/BasicErrorController.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/BasicErrorController.java index 97ea9c56b4..020db1c578 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/BasicErrorController.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/BasicErrorController.java @@ -96,7 +96,7 @@ public class BasicErrorController extends AbstractErrorController { public ResponseEntity> error(HttpServletRequest request) { HttpStatus status = getStatus(request); if (status == HttpStatus.NO_CONTENT) { - return new ResponseEntity>(status); + return new ResponseEntity<>(status); } Map body = getErrorAttributes(request, isIncludeStackTrace(request, MediaType.ALL)); return new ResponseEntity<>(body, status); diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/LenientObjectToEnumConverterFactory.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/LenientObjectToEnumConverterFactory.java index fed1ebf75e..4a1d3e21ea 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/LenientObjectToEnumConverterFactory.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/LenientObjectToEnumConverterFactory.java @@ -55,7 +55,7 @@ abstract class LenientObjectToEnumConverterFactory implements ConverterFactor enumType = enumType.getSuperclass(); } Assert.notNull(enumType, () -> "The target type " + targetType.getName() + " does not refer to an enum"); - return new LenientToEnumConverter((Class) enumType); + return new LenientToEnumConverter<>((Class) enumType); } @SuppressWarnings("unchecked")