diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/MetricsProperties.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/MetricsProperties.java index 6409d6f486..2df3378dfd 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/MetricsProperties.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/MetricsProperties.java @@ -27,7 +27,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties; @ConfigurationProperties("management.metrics") public class MetricsProperties { - private Web web = new Web(); + private final Web web = new Web(); /** * Whether auto-configured MeterRegistry implementations should be bound to the global @@ -50,26 +50,18 @@ public class MetricsProperties { public static class Web { - private Client client = new Client(); + private final Client client = new Client(); - private Server server = new Server(); + private final Server server = new Server(); public Client getClient() { return this.client; } - public void setClient(Client client) { - this.client = client; - } - public Server getServer() { return this.server; } - public void setServer(Server server) { - this.server = server; - } - public static class Client { /** diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerProperties.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerProperties.java index d487c06f79..b73d581fed 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerProperties.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerProperties.java @@ -109,13 +109,13 @@ public class ManagementServerProperties implements SecurityPrerequisite { /** * Servlet properties. */ - public class Servlet { + public static class Servlet { /** * Management endpoint context-path. For instance, '/management'. Requires a * custom management.server.port. */ - private String contextPath = ""; + private String contextPath = ""; /** * Return the context path with no trailing slash (i.e. the '/' root context is diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.java index ed4466a228..239b2f63e4 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.java @@ -77,7 +77,7 @@ class HibernateJpaConfiguration extends JpaBaseConfiguration { */ private static final String[] WEBSPHERE_JTA_PLATFORM_CLASSES = { "org.hibernate.engine.transaction.jta.platform.internal.WebSphereExtendedJtaPlatform", - "org.hibernate.service.jta.platform.internal.WebSphereExtendedJtaPlatform", }; + "org.hibernate.service.jta.platform.internal.WebSphereExtendedJtaPlatform" }; private final HibernateDefaultDdlAutoProvider defaultDdlAutoProvider; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java index d50b80e992..9bb47f4998 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java @@ -224,7 +224,7 @@ public class ServerProperties { /** * Servlet properties. */ - public class Servlet { + public static class Servlet { /** * Servlet context init parameters. diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/ImportAutoConfigurationImportSelectorTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/ImportAutoConfigurationImportSelectorTests.java index 3c1d17980c..46cb6e09b3 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/ImportAutoConfigurationImportSelectorTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/ImportAutoConfigurationImportSelectorTests.java @@ -303,7 +303,7 @@ public class ImportAutoConfigurationImportSelectorTests { @Retention(RetentionPolicy.RUNTIME) @interface MetaImportAutoConfiguration { - @AliasFor(annotation = ImportAutoConfiguration.class, attribute = "exclude") + @AliasFor(annotation = ImportAutoConfiguration.class) Class[] exclude() default {}; } diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc index 108efcd43d..d75d1d7b34 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc @@ -139,10 +139,10 @@ content into your application. Rather, pick only the properties that you need. spring.profiles.include= # Unconditionally activate the specified comma-separated list of profiles (or list of profiles if using YAML). # QUARTZ SCHEDULER ({sc-spring-boot-autoconfigure}/quartz/QuartzProperties.{sc-ext}[QuartzProperties]) - spring.quartz.job-store-type=memory # Quartz job store type. - spring.quartz.properties.*= # Additional Quartz Scheduler properties. spring.quartz.jdbc.initialize-schema=embedded # Database schema initialization mode. spring.quartz.jdbc.schema=classpath:org/quartz/impl/jdbcjobstore/tables_@@platform@@.sql # Path to the SQL file to use to initialize the database schema. + spring.quartz.job-store-type=memory # Quartz job store type. + spring.quartz.properties.*= # Additional Quartz Scheduler properties. # REACTOR ({sc-spring-boot-autoconfigure}/reactor/core/ReactorCoreProperties.{sc-ext}[ReactorCoreProperties]) spring.reactor.stacktrace-mode.enabled=false # Whether Reactor should collect stacktrace information at runtime. @@ -1085,7 +1085,7 @@ content into your application. Rather, pick only the properties that you need. management.server.add-application-context-header=false # Add the "X-Application-Context" HTTP header in each response. Requires a custom management.server.port. management.server.address= # Network address that to which the management endpoints should bind. Requires a custom management.server.port. management.server.port= # Management endpoint HTTP port. Uses the same port as the application by default. Configure a different port to use management-specific SSL. - management.server.servlet.context-path= # Management endpoint context-path. For instance, `/management`. Requires a custom management.server.port + management.server.servlet.context-path= # Management endpoint context-path. For instance, `/management`. Requires a custom management.server.port. management.server.ssl.ciphers= # Supported SSL ciphers. Requires a custom management.port. management.server.ssl.client-auth= # Whether client authentication is wanted ("want") or needed ("need"). Requires a trust store. Requires a custom management.server.port. management.server.ssl.enabled= # Whether to enable SSL support. Requires a custom management.server.port. diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc index b45d1e8fa7..76ecdab49a 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc @@ -957,7 +957,7 @@ for all requests. Alternatively, when set to `false`, you can enable instrumenta adding `@Timed` to a request-handling method. By default, metrics are generated with the name, `http.server.requests`. The name can be -customized by setting the `management.metrics.web.server.requests-metrics-name` property. +customized by setting the `management.metrics.web.server.requests-metric-name` property. @@ -980,7 +980,7 @@ controllers. You can also use a helper class, `RouterFunctionMetrics`, to instru applications that use WebFlux's functional programming model. By default, metrics are generated with the name `http.server.requests`. You can customize -the name by setting the `management.metrics.web.server.requests-metrics-name` property. +the name by setting the `management.metrics.web.server.requests-metric-name` property. @@ -1015,7 +1015,7 @@ instrumentation of its requests. `MetricsRestTemplateCustomizer` can be used to your own `RestTemplate` instances. By default, metrics are generated with the name, `http.client.requests`. The name can be -customized by setting the `management.metrics.web.client.requests-metrics-name` property. +customized by setting the `management.metrics.web.client.requests-metric-name` property. diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc index 72e4eb12b0..d34bb53b1b 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc @@ -4391,7 +4391,7 @@ materialized by the `org.springframework.cache.Cache` and If you have not defined a bean of type `CacheManager` or a `CacheResolver` named `cacheResolver` (see -{spring-javadoc}cache/annotation/CachingConfigurer.html[`CachingConfigurer`]), +{spring-javadoc}/cache/annotation/CachingConfigurer.html[`CachingConfigurer`]), Spring Boot tries to detect the following providers (in the indicated order): . <> @@ -5406,7 +5406,7 @@ property with a different value for each instance of your application. [[boot-features-jta-bitronix]] === Using a Bitronix Transaction Manager -https://github.com/bitronix/btm[Bitronix] is a spopular open-source JTA transaction +https://github.com/bitronix/btm[Bitronix] is a popular open-source JTA transaction manager implementation. You can use the `spring-boot-starter-jta-bitronix` starter to add the appropriate Bitronix dependencies to your project. As with Atomikos, Spring Boot automatically configures Bitronix and post-processes your beans to ensure that startup and @@ -6158,7 +6158,7 @@ A list of the auto-configuration settings that are enabled by `@WebMvcTest` can [[boot-features-testing-spring-boot-applications-testing-autoconfigured-webflux-tests]] ==== Auto-configured Spring WebFlux Tests -To test that {spring-reference}html/web-reactive.html[Spring WebFlux] controllers are +To test that {spring-reference}/web-reactive.html[Spring WebFlux] controllers are working as expected, you can use the `@WebFluxTest` annotation. `@WebFluxTest` auto-configures the Spring WebFlux infrastructure and limits scanned beans to `@Controller`, `@ControllerAdvice`, `@JsonComponent`, `Converter`, `GenericConverter`, and @@ -6444,7 +6444,7 @@ configures Spring Data Neo4j repositories. Regular `@Component` beans are not lo the `ApplicationContext`. (For more about using Neo4J with Spring Boot, see "<>", earlier in this chapter.) -The followig example shows a typical setup for using Neo4J tests in Spring Boot: +The following example shows a typical setup for using Neo4J tests in Spring Boot: [source,java,indent=0] ---- diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/properties/SkipPropertyMapping.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/properties/SkipPropertyMapping.java index a1dc704706..3dd50f5b0d 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/properties/SkipPropertyMapping.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/properties/SkipPropertyMapping.java @@ -37,6 +37,6 @@ public enum SkipPropertyMapping { /** * Don't skip mapping the property. */ - NO, + NO } diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebMvcTest.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebMvcTest.java index 0cab34c7df..43971844a6 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebMvcTest.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebMvcTest.java @@ -130,7 +130,7 @@ public @interface WebMvcTest { * on the classpath. Defaults to {@code true}. * @return if Spring Security's MockMvc support is auto-configured */ - @AliasFor(annotation = AutoConfigureMockMvc.class, attribute = "secure") + @AliasFor(annotation = AutoConfigureMockMvc.class) boolean secure() default true; /** diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/properties/AnnotationsPropertySourceTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/properties/AnnotationsPropertySourceTests.java index 73b8655449..ceed71996d 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/properties/AnnotationsPropertySourceTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/properties/AnnotationsPropertySourceTests.java @@ -354,7 +354,7 @@ public class AnnotationsPropertySourceTests { @AliasedAttributeAnnotation static @interface AttributeWithAliasAnnotation { - @AliasFor(annotation = AliasedAttributeAnnotation.class, attribute = "value") + @AliasFor(annotation = AliasedAttributeAnnotation.class) String value() default "foo"; String someOtherAttribute() default "shouldNotBeMapped"; diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/filter/TestTypeExcludeFilter.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/filter/TestTypeExcludeFilter.java index 98f324520a..4b1f48a942 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/filter/TestTypeExcludeFilter.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/filter/TestTypeExcludeFilter.java @@ -36,7 +36,7 @@ class TestTypeExcludeFilter extends TypeExcludeFilter { "org.junit.jupiter.api.extension.ExtendWith" }; private static final String[] METHOD_ANNOTATIONS = { "org.junit.Test", - "org.junit.platform.commons.annotation.Testable", }; + "org.junit.platform.commons.annotation.Testable" }; @Override public boolean match(MetadataReader metadataReader, diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/json/JSONArray.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/json/JSONArray.java index 8ec69c237e..7383d7254d 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/json/JSONArray.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/json/JSONArray.java @@ -22,7 +22,7 @@ import java.util.Collection; import java.util.Iterator; import java.util.List; -// Note: this class was written without inspecting the non-free org.json sourcecode. +// Note: this class was written without inspecting the non-free org.json source code. /** * A dense indexed sequence of values. Values may be any mix of diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/json/JSONException.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/json/JSONException.java index af718b412b..557c4f576e 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/json/JSONException.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/json/JSONException.java @@ -16,7 +16,7 @@ package org.springframework.boot.configurationprocessor.json; -// Note: this class was written without inspecting the non-free org.json sourcecode. +// Note: this class was written without inspecting the non-free org.json source code. /** * Thrown to indicate a problem with the JSON API. Such problems include: diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/json/JSONObject.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/json/JSONObject.java index 6ebfefe14a..8390ff1881 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/json/JSONObject.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/json/JSONObject.java @@ -22,7 +22,7 @@ import java.util.HashMap; import java.util.Iterator; import java.util.Map; -// Note: this class was written without inspecting the non-free org.json sourcecode. +// Note: this class was written without inspecting the non-free org.json source code. /** * A modifiable set of name/value mappings. Names are unique, non-null strings. diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/json/JSONStringer.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/json/JSONStringer.java index 1c68370005..46a3aa30dc 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/json/JSONStringer.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/json/JSONStringer.java @@ -20,7 +20,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -// Note: this class was written without inspecting the non-free org.json sourcecode. +// Note: this class was written without inspecting the non-free org.json source code. /** * Implements {@link JSONObject#toString} and {@link JSONArray#toString}. Most @@ -104,7 +104,7 @@ public class JSONStringer { * A special bracketless array needed by JSONStringer.join() and * JSONObject.quote() only. Not used for JSON encoding. */ - NULL, + NULL } /** diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/json/JSONTokener.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/json/JSONTokener.java index cf848fa817..d2cc3e6318 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/json/JSONTokener.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/json/JSONTokener.java @@ -16,7 +16,7 @@ package org.springframework.boot.configurationprocessor.json; -// Note: this class was written without inspecting the non-free org.json sourcecode. +// Note: this class was written without inspecting the non-free org.json source code. /** * Parses a JSON (RFC 4627) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/data/RandomAccessDataFileTests.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/data/RandomAccessDataFileTests.java index 327fef8a5d..da3c483368 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/data/RandomAccessDataFileTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/data/RandomAccessDataFileTests.java @@ -102,10 +102,11 @@ public class RandomAccessDataFileTests { @Test public void fileExists() { + File file = new File("/does/not/exist"); this.thrown.expect(IllegalArgumentException.class); this.thrown.expectMessage(String.format("File %s must exist", - new File("/does/not/exist").getAbsolutePath())); - new RandomAccessDataFile(new File("/does/not/exist")); + file.getAbsolutePath())); + new RandomAccessDataFile(file); } @Test @@ -117,10 +118,11 @@ public class RandomAccessDataFileTests { @Test public void fileExistsWithConcurrentReads() { + File file = new File("/does/not/exist"); this.thrown.expect(IllegalArgumentException.class); this.thrown.expectMessage(String.format("File %s must exist", - new File("/does/not/exist").getAbsolutePath())); - new RandomAccessDataFile(new File("/does/not/exist"), 1); + file.getAbsolutePath())); + new RandomAccessDataFile(file, 1); } @Test diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SystemEnvironmentPropertyMapper.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SystemEnvironmentPropertyMapper.java index 3f4ae6323b..c26050a7f0 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SystemEnvironmentPropertyMapper.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SystemEnvironmentPropertyMapper.java @@ -46,7 +46,7 @@ final class SystemEnvironmentPropertyMapper implements PropertyMapper { } return new PropertyMapping[] { new PropertyMapping(name, configurationPropertyName), - new PropertyMapping(legacyName, configurationPropertyName), }; + new PropertyMapping(legacyName, configurationPropertyName) }; } @Override diff --git a/spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/domain/Rating.java b/spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/domain/Rating.java index dfbb6c5601..5af5d4f586 100644 --- a/spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/domain/Rating.java +++ b/spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/domain/Rating.java @@ -17,5 +17,5 @@ package sample.data.jpa.domain; public enum Rating { - TERRIBLE, POOR, AVERAGE, GOOD, EXCELLENT, + TERRIBLE, POOR, AVERAGE, GOOD, EXCELLENT }