From 6d9ce8a3b5291d4b35f77b2446745b9806945dbf Mon Sep 17 00:00:00 2001 From: hakan-krgn Date: Mon, 28 Aug 2023 10:32:36 +0300 Subject: [PATCH 1/2] Polish code and javadoc See gh-37112 --- .../boot/actuate/health/AbstractReactiveHealthIndicator.java | 2 +- .../filter/AnnotationCustomizableTypeExcludeFilter.java | 3 +-- .../test/autoconfigure/jdbc/AutoConfigureTestDatabase.java | 2 +- .../autoconfigure/jdbc/TestDatabaseAutoConfiguration.java | 5 ----- .../boot/test/autoconfigure/web/servlet/WebDriverScope.java | 2 +- .../java/org/springframework/boot/SpringApplication.java | 2 +- 6 files changed, 5 insertions(+), 11 deletions(-) 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 4e9269af24..0b6e2c7926 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 @@ public abstract class AbstractReactiveHealthIndicator implements ReactiveHealthI } /** - * 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 94640ff18f..8fbec0f56f 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 abstract class AnnotationCustomizableTypeExcludeFilter extends TypeExclud 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 e79b78ec0f..2028bb60f3 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 @@ public @interface AutoConfigureTestDatabase { /** * 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 aea1e4228a..5076448dbd 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 @@ -159,11 +159,6 @@ public class TestDatabaseAutoConfiguration { 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/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 40c3d36aaa..ed29ee02fb 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 @@ -103,7 +103,7 @@ class WebDriverScope implements Scope { /** * 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 29760b79d8..c641d2128b 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 @@ -567,7 +567,7 @@ public class SpringApplication { } /** - * 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 */ From 2de98a84bcebf13dea88b976ee1cf3b4206d756c Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Wed, 30 Aug 2023 11:39:10 +0100 Subject: [PATCH 2/2] Polish "Polish code and javadoc" See gh-37112 --- .../filter/AnnotationCustomizableTypeExcludeFilter.java | 2 +- .../test/autoconfigure/jdbc/AutoConfigureTestDatabase.java | 2 +- .../boot/test/autoconfigure/web/servlet/WebDriverScope.java | 2 +- .../main/java/org/springframework/boot/SpringApplication.java | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) 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 8fbec0f56f..af92b8a154 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 @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. 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 2028bb60f3..9bed2317ed 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 @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. 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 ed29ee02fb..34a94eefad 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 @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. 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 c641d2128b..7acd007a02 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 @@ -567,8 +567,8 @@ public class SpringApplication { } /** - * Apply any relevant post-processing the {@link ApplicationContext}. Subclasses can - * apply additional processing as required. + * Apply any relevant post-processing to the {@link ApplicationContext}. Subclasses + * can apply additional processing as required. * @param context the application context */ protected void postProcessApplicationContext(ConfigurableApplicationContext context) {