diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/AbstractReactiveHealthIndicator.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/AbstractReactiveHealthIndicator.java index 4e9269af24a6..0b6e2c792693 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/AbstractReactiveHealthIndicator.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/AbstractReactiveHealthIndicator.java @@ -99,7 +99,7 @@ private Mono handleFailure(Throwable ex) { } /** - * Actual health check logic. If an error occurs in the pipeline it will be handled + * Actual health check logic. If an error occurs in the pipeline, it will be handled * automatically. * @param builder the {@link Health.Builder} to report health status and details * @return a {@link Mono} that provides the {@link Health} diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/filter/AnnotationCustomizableTypeExcludeFilter.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/filter/AnnotationCustomizableTypeExcludeFilter.java index 94640ff18f62..8fbec0f56f41 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/filter/AnnotationCustomizableTypeExcludeFilter.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/filter/AnnotationCustomizableTypeExcludeFilter.java @@ -119,8 +119,7 @@ public boolean equals(Object obj) { return false; } AnnotationCustomizableTypeExcludeFilter other = (AnnotationCustomizableTypeExcludeFilter) obj; - boolean result = true; - result = result && hasAnnotation() == other.hasAnnotation(); + boolean result = hasAnnotation() == other.hasAnnotation(); for (FilterType filterType : FilterType.values()) { result &= ObjectUtils.nullSafeEquals(getFilters(filterType), other.getFilters(filterType)); } diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/jdbc/AutoConfigureTestDatabase.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/jdbc/AutoConfigureTestDatabase.java index e79b78ec0f43..2028bb60f312 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/jdbc/AutoConfigureTestDatabase.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/jdbc/AutoConfigureTestDatabase.java @@ -58,7 +58,7 @@ /** * The type of connection to be established when {@link #replace() replacing} the - * DataSource. By default will attempt to detect the connection based on the + * DataSource. By default, will attempt to detect the connection based on the * classpath. * @return the type of connection to use */ diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/jdbc/TestDatabaseAutoConfiguration.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/jdbc/TestDatabaseAutoConfiguration.java index b2b63c886a32..c0c28e124cc3 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/jdbc/TestDatabaseAutoConfiguration.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/jdbc/TestDatabaseAutoConfiguration.java @@ -163,11 +163,6 @@ public Class getObjectType() { return EmbeddedDatabase.class; } - @Override - public boolean isSingleton() { - return true; - } - } static class EmbeddedDataSourceFactory { diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/properties/AnnotationsPropertySource.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/properties/AnnotationsPropertySource.java index 5987729cd8bd..a108e65b8c23 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/properties/AnnotationsPropertySource.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/properties/AnnotationsPropertySource.java @@ -91,7 +91,7 @@ private void collectProperties(String prefix, SkipPropertyMapping skip, MergedAn return; } Optional value = annotation.getValue(attribute.getName()); - if (!value.isPresent()) { + if (value.isEmpty()) { return; } if (skip == SkipPropertyMapping.ON_DEFAULT_VALUE) { diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/properties/PropertyMappingContextCustomizer.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/properties/PropertyMappingContextCustomizer.java index 2dde81b33d70..7598ae4b459f 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/properties/PropertyMappingContextCustomizer.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/properties/PropertyMappingContextCustomizer.java @@ -98,7 +98,7 @@ private Class getRoot(MergedAnnotation annotation) { private String getAnnotationsDescription(Set> annotations) { StringBuilder result = new StringBuilder(); for (Class annotation : annotations) { - if (result.length() != 0) { + if (!result.isEmpty()) { result.append(", "); } result.append('@').append(ClassUtils.getShortName(annotation)); diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebDriverScope.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebDriverScope.java index 4f9f1ae548fc..ec04e6a986fd 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebDriverScope.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebDriverScope.java @@ -107,7 +107,7 @@ boolean reset() { /** * Register this scope with the specified context and reassign appropriate bean - * definitions to used it. + * definitions to use it. * @param context the application context */ static void registerWith(ConfigurableApplicationContext context) { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java index fe2d6ac64d8f..383f79d4a762 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java @@ -570,7 +570,7 @@ protected ConfigurableApplicationContext createApplicationContext() { } /** - * Apply any relevant post processing the {@link ApplicationContext}. Subclasses can + * Apply any relevant post-processing the {@link ApplicationContext}. Subclasses can * apply additional processing as required. * @param context the application context */