diff --git a/CONTRIBUTING.adoc b/CONTRIBUTING.adoc index 43cfab53e9..8991bcd44f 100755 --- a/CONTRIBUTING.adoc +++ b/CONTRIBUTING.adoc @@ -115,7 +115,7 @@ Running a full build is a two phase process. Preparing the build will compile and install the `spring-boot-maven-plugin` so that it can be referenced during the full build. It also generates a `settings.xml` file that enables a `snapshot`, `milestone` or `release` profiles based on the version being -build. To prepare the build, from the root directory use: +built. To prepare the build, from the root directory use: [indent=0] ---- diff --git a/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/CloudFoundryWebEndpointServletHandlerMapping.java b/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/CloudFoundryWebEndpointServletHandlerMapping.java index 735b42b251..c94e8a3f14 100644 --- a/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/CloudFoundryWebEndpointServletHandlerMapping.java +++ b/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/CloudFoundryWebEndpointServletHandlerMapping.java @@ -53,7 +53,7 @@ import org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMappi /** * A custom {@link RequestMappingInfoHandlerMapping} that makes web endpoints available on - * Cloudfoundry specific URLS over HTTP using Spring MVC. + * Cloud Foundry specific URLs over HTTP using Spring MVC. * * @author Madhura Bhave */ diff --git a/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/health/HealthIndicatorProperties.java b/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/health/HealthIndicatorProperties.java index ddbdc441a8..4204199aad 100644 --- a/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/health/HealthIndicatorProperties.java +++ b/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 = null; /** - * Mapping of health statuses to HttpStatus codes. By default, registered health + * Mapping of health statuses to HTTP status codes. By default, registered health * statuses map to sensible defaults (i.e. UP maps to 200). */ private final Map httpMapping = new HashMap<>(); diff --git a/spring-boot-actuator-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/spring-boot-actuator-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json index 235d6ef233..9bcb4e3219 100644 --- a/spring-boot-actuator-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/spring-boot-actuator-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -513,7 +513,7 @@ { "name": "endpoints.health.mapping", "type": "java.util.Map", - "description": "Mapping of health statuses to HttpStatus codes. By default, registered health\n statuses map to sensible defaults (i.e. UP maps to 200).", + "description": "Mapping of health statuses to HTTP status codes. By default, registered health\n statuses map to sensible defaults (i.e. UP maps to 200).", "deprecation": { "replacement": "management.health.status.http-mapping", "level": "error" diff --git a/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/jolokia/JolokiaManagementContextConfigurationTests.java b/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/jolokia/JolokiaManagementContextConfigurationTests.java index 0db7c5ee50..20e67ce51f 100644 --- a/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/jolokia/JolokiaManagementContextConfigurationTests.java +++ b/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/jolokia/JolokiaManagementContextConfigurationTests.java @@ -45,7 +45,7 @@ public class JolokiaManagementContextConfigurationTests { JolokiaManagementContextConfiguration.class)); @Test - public void jolokiaIsEnabledByDefault() { + public void jolokiaCanBeEnabled() { this.contextRunner.withPropertyValues("management.jolokia.enabled=true") .run((context) -> { context.getBean(ServletRegistrationBean.class); diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/ShutdownEndpoint.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/ShutdownEndpoint.java index a9da05e5a3..53e5a1964f 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/ShutdownEndpoint.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/ShutdownEndpoint.java @@ -38,18 +38,18 @@ import org.springframework.context.ConfigurableApplicationContext; @Endpoint(id = "shutdown", defaultEnablement = DefaultEnablement.DISABLED) public class ShutdownEndpoint implements ApplicationContextAware { - private static final Map NO_CONTEXT_MESSAGE = Collections - .unmodifiableMap(Collections.singletonMap("message", + private static final Map NO_CONTEXT_MESSAGE = Collections + .unmodifiableMap(Collections.singletonMap("message", "No context to shutdown.")); - private static final Map SHUTDOWN_MESSAGE = Collections - .unmodifiableMap(Collections.singletonMap("message", + private static final Map SHUTDOWN_MESSAGE = Collections + .unmodifiableMap(Collections.singletonMap("message", "Shutting down, bye...")); private ConfigurableApplicationContext context; @WriteOperation - public Map shutdown() { + public Map shutdown() { if (this.context == null) { return NO_CONTEXT_MESSAGE; } diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/CompositeReactiveHealthIndicator.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/CompositeReactiveHealthIndicator.java index 9a4a7dd605..ca19554f93 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/CompositeReactiveHealthIndicator.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/CompositeReactiveHealthIndicator.java @@ -74,7 +74,7 @@ public class CompositeReactiveHealthIndicator implements ReactiveHealthIndicator } /** - * Specify an alternative timeout {@link Health} if an {@link HealthIndicator} failed + * Specify an alternative timeout {@link Health} if a {@link HealthIndicator} failed * to reply after specified {@code timeout}. * @param timeout number of milliseconds to wait before using the * {@code timeoutHealth} diff --git a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/context/ShutdownEndpointTests.java b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/context/ShutdownEndpointTests.java index 46b0fd7f26..c9445e4162 100644 --- a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/context/ShutdownEndpointTests.java +++ b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/context/ShutdownEndpointTests.java @@ -51,7 +51,7 @@ public class ShutdownEndpointTests { contextRunner.run((context) -> { EndpointConfig config = context.getBean(EndpointConfig.class); ClassLoader previousTccl = Thread.currentThread().getContextClassLoader(); - Map result; + Map result; Thread.currentThread().setContextClassLoader( new URLClassLoader(new URL[0], getClass().getClassLoader())); try { @@ -60,7 +60,7 @@ public class ShutdownEndpointTests { finally { Thread.currentThread().setContextClassLoader(previousTccl); } - assertThat((String) result.get("message")).startsWith("Shutting down"); + assertThat(result.get("message")).startsWith("Shutting down"); assertThat(((ConfigurableApplicationContext) context).isActive()).isTrue(); assertThat(config.latch.await(10, TimeUnit.SECONDS)).isTrue(); assertThat(config.threadContextClassLoader) @@ -74,7 +74,7 @@ public class ShutdownEndpointTests { EmptyConfig.class).child(EndpointConfig.class) .web(WebApplicationType.NONE).run(); CountDownLatch latch = context.getBean(EndpointConfig.class).latch; - assertThat((String) context.getBean(ShutdownEndpoint.class).shutdown() + assertThat(context.getBean(ShutdownEndpoint.class).shutdown() .get("message")).startsWith("Shutting down"); assertThat(context.isActive()).isTrue(); assertThat(latch.await(10, TimeUnit.SECONDS)).isTrue(); @@ -87,7 +87,7 @@ public class ShutdownEndpointTests { .web(WebApplicationType.NONE).run(); CountDownLatch parentLatch = context.getBean(EndpointConfig.class).latch; CountDownLatch childLatch = context.getBean(EmptyConfig.class).latch; - assertThat((String) context.getBean(ShutdownEndpoint.class).shutdown() + assertThat(context.getBean(ShutdownEndpoint.class).shutdown() .get("message")).startsWith("Shutting down"); assertThat(context.isActive()).isTrue(); assertThat(parentLatch.await(10, TimeUnit.SECONDS)).isTrue(); diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/SessionProperties.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/SessionProperties.java index e001b17e8e..ff7aa7499a 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/SessionProperties.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/SessionProperties.java @@ -42,7 +42,7 @@ public class SessionProperties { */ private StoreType storeType; - private Integer timeout; + private final Integer timeout; private Servlet servlet = new Servlet(); diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/http/HttpMessageConvertersAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/http/HttpMessageConvertersAutoConfigurationTests.java index 0191380ce4..be0f33c5cb 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/http/HttpMessageConvertersAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/http/HttpMessageConvertersAutoConfigurationTests.java @@ -190,7 +190,7 @@ public class HttpMessageConvertersAutoConfigurationTests { } @Test - public void sringCustomConverter() { + public void stringCustomConverter() { this.contextRunner.withUserConfiguration(StringConverterConfig.class) .run(assertConverter(StringHttpMessageConverter.class, "customStringMessageConverter")); diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/SecurityAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/SecurityAutoConfigurationTests.java index c000ec22ca..d650394f72 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/SecurityAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/SecurityAutoConfigurationTests.java @@ -335,7 +335,7 @@ public class SecurityAutoConfigurationTests { protected static class TestAuthenticationProviderConfiguration { @Bean - public AuthenticationProvider myauthenticationProvider() { + public AuthenticationProvider myAuthenticationProvider() { return new TestingAuthenticationProvider(); } diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/cli/DefaultCommandFactory.java b/spring-boot-cli/src/main/java/org/springframework/boot/cli/DefaultCommandFactory.java index 8c5813e9e7..80ef7dff6a 100644 --- a/spring-boot-cli/src/main/java/org/springframework/boot/cli/DefaultCommandFactory.java +++ b/spring-boot-cli/src/main/java/org/springframework/boot/cli/DefaultCommandFactory.java @@ -38,14 +38,14 @@ import org.springframework.boot.cli.command.run.RunCommand; */ public class DefaultCommandFactory implements CommandFactory { - private static final List DEFAULT_COMMANDS = Arrays.asList( + private static final List defaultCommands = Arrays.asList( new VersionCommand(), new RunCommand(), new GrabCommand(), new JarCommand(), new WarCommand(), new InstallCommand(), new UninstallCommand(), new InitCommand()); @Override public Collection getCommands() { - return DEFAULT_COMMANDS; + return defaultCommands; } } diff --git a/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/env/DevToolsPropertyDefaultsPostProcessor.java b/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/env/DevToolsPropertyDefaultsPostProcessor.java index 28ef8e409f..31cd442082 100755 --- a/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/env/DevToolsPropertyDefaultsPostProcessor.java +++ b/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/env/DevToolsPropertyDefaultsPostProcessor.java @@ -42,23 +42,23 @@ import org.springframework.core.env.PropertySource; @Order(Ordered.LOWEST_PRECEDENCE) public class DevToolsPropertyDefaultsPostProcessor implements EnvironmentPostProcessor { - private static final Map PROPERTIES; + private static final Map properties; static { - Map properties = new HashMap<>(); - properties.put("spring.thymeleaf.cache", "false"); - properties.put("spring.freemarker.cache", "false"); - properties.put("spring.groovy.template.cache", "false"); - properties.put("spring.mustache.cache", "false"); - properties.put("server.session.persistent", "true"); - properties.put("spring.h2.console.enabled", "true"); - properties.put("spring.resources.cache-period", "0"); - properties.put("spring.resources.chain.cache", "false"); - properties.put("spring.template.provider.cache", "false"); - properties.put("spring.mvc.log-resolved-exception", "true"); - properties.put("server.servlet.jsp.init-parameters.development", "true"); - properties.put("spring.reactor.stacktrace-mode.enabled", "true"); - PROPERTIES = Collections.unmodifiableMap(properties); + Map devToolsProperties = new HashMap<>(); + devToolsProperties.put("spring.thymeleaf.cache", "false"); + devToolsProperties.put("spring.freemarker.cache", "false"); + devToolsProperties.put("spring.groovy.template.cache", "false"); + devToolsProperties.put("spring.mustache.cache", "false"); + devToolsProperties.put("server.session.persistent", "true"); + devToolsProperties.put("spring.h2.console.enabled", "true"); + devToolsProperties.put("spring.resources.cache-period", "0"); + devToolsProperties.put("spring.resources.chain.cache", "false"); + devToolsProperties.put("spring.template.provider.cache", "false"); + devToolsProperties.put("spring.mvc.log-resolved-exception", "true"); + devToolsProperties.put("server.servlet.jsp.init-parameters.development", "true"); + devToolsProperties.put("spring.reactor.stacktrace-mode.enabled", "true"); + properties = Collections.unmodifiableMap(devToolsProperties); } @Override @@ -66,7 +66,7 @@ public class DevToolsPropertyDefaultsPostProcessor implements EnvironmentPostPro SpringApplication application) { if (isLocalApplication(environment) && canAddProperties(environment)) { PropertySource propertySource = new MapPropertySource("refresh", - PROPERTIES); + properties); environment.getPropertySources().addLast(propertySource); } } diff --git a/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc b/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc index 66fb7540a4..7ef4ea34f1 100644 --- a/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc +++ b/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc @@ -1249,7 +1249,7 @@ content into your application; rather pick only the properties that you need. management.health.rabbit.enabled=true # Enable RabbitMQ health check. management.health.redis.enabled=true # Enable Redis health check. management.health.solr.enabled=true # Enable Solr health check. - management.health.status.http-mapping= # Mapping of health statuses to HttpStatus codes. By default, registered health statuses map to sensible defaults (i.e. UP maps to 200). + management.health.status.http-mapping= # Mapping of health statuses to HTTP status codes. By default, registered health statuses map to sensible defaults (i.e. UP maps to 200). management.health.status.order=DOWN, OUT_OF_SERVICE, UP, UNKNOWN # Comma-separated list of health statuses in order of severity. # INFO CONTRIBUTORS ({sc-spring-boot-actuator}/autoconfigure/info/InfoContributorProperties.{sc-ext}[InfoContributorProperties]) diff --git a/spring-boot-docs/src/main/asciidoc/howto.adoc b/spring-boot-docs/src/main/asciidoc/howto.adoc index 1df9d2f5ae..e84e265581 100644 --- a/spring-boot-docs/src/main/asciidoc/howto.adoc +++ b/spring-boot-docs/src/main/asciidoc/howto.adoc @@ -1836,7 +1836,7 @@ respectively. Spring Data REST can expose the `Repository` implementations as REST endpoints for you as long as Spring MVC has been enabled for the application. -Spring Boot exposes as set of useful properties from the `spring.data.rest` namespace that +Spring Boot exposes a set of useful properties from the `spring.data.rest` namespace that customize the {spring-data-rest-javadoc}/core/config/RepositoryRestConfiguration.{dc-ext}[`RepositoryRestConfiguration`]. If you need to provide additional customization, you should use a diff --git a/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc b/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc index f7d979fed4..329ad50111 100644 --- a/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc +++ b/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc @@ -114,7 +114,7 @@ The following technology agnostic endpoints are available: |Allows the application to be gracefully shutdown (not enabled by default). |`status` -|Show application status information (i.e. `health` status with no additional details) +|Show application status information (i.e. `health` status with no additional details). |`threaddump` |Performs a thread dump. @@ -393,7 +393,7 @@ to your application properties: The HTTP status code in the response reflects the overall health status (e.g. `UP` maps to 200, `OUT_OF_SERVICE` or `DOWN` to 503). You might also want to register custom status mappings if you access the health endpoint over HTTP. For example, the following -maps `FATAL` to `HttpStatus.SERVICE_UNAVAILABLE`: +maps `FATAL` to 503 (service unavailable). [source,properties,indent=0] ---- diff --git a/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc b/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc index 7186bc5256..9dc2ed40fa 100644 --- a/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc +++ b/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc @@ -1903,7 +1903,7 @@ You can also customize the static resource locations using `spring.resources.static-locations` (replacing the default values with a list of directory locations). The root Servlet context path `"/"` will be automatically added as a location as well. If you do this the default welcome page detection will -switch to your custom locations, so if there is an `index.html` in any of your locations +switch to your custom locations. So if there is an `index.html` in any of your locations on startup, it will be the home page of the application. In addition to the '`standard`' static resource locations above, a special case is made diff --git a/spring-boot-test/src/main/java/org/springframework/boot/test/context/ImportsContextCustomizer.java b/spring-boot-test/src/main/java/org/springframework/boot/test/context/ImportsContextCustomizer.java index 7d761fac2b..e8c8e9ea99 100644 --- a/spring-boot-test/src/main/java/org/springframework/boot/test/context/ImportsContextCustomizer.java +++ b/spring-boot-test/src/main/java/org/springframework/boot/test/context/ImportsContextCustomizer.java @@ -228,14 +228,14 @@ class ImportsContextCustomizer implements ContextCustomizer { private static final Class[] NO_IMPORTS = {}; - private static final Set ANNOTATION_FILTERS; + private static final Set annotationFilters; static { Set filters = new HashSet<>(); filters.add(new JavaLangAnnotationFilter()); filters.add(new KotlinAnnotationFilter()); filters.add(new SpockAnnotationFilter()); - ANNOTATION_FILTERS = Collections.unmodifiableSet(filters); + annotationFilters = Collections.unmodifiableSet(filters); } private final Set key; @@ -274,7 +274,7 @@ class ImportsContextCustomizer implements ContextCustomizer { } private boolean isIgnoredAnnotation(Annotation annotation) { - for (AnnotationFilter annotationFilter : ANNOTATION_FILTERS) { + for (AnnotationFilter annotationFilter : annotationFilters) { if (annotationFilter.isIgnored(annotation)) { return true; } diff --git a/spring-boot-test/src/test/java/org/springframework/boot/test/context/assertj/ApplicationContextAssertTests.java b/spring-boot-test/src/test/java/org/springframework/boot/test/context/assertj/ApplicationContextAssertTests.java index 7cf22c871f..7d877d18b3 100644 --- a/spring-boot-test/src/test/java/org/springframework/boot/test/context/assertj/ApplicationContextAssertTests.java +++ b/spring-boot-test/src/test/java/org/springframework/boot/test/context/assertj/ApplicationContextAssertTests.java @@ -29,7 +29,7 @@ import static org.assertj.core.api.Assertions.assertThat; * Tests for {@link ApplicationContextAssert}. * * @author Phillip Webb - * @uathor Andy Wilkinson + * @author Andy Wilkinson */ public class ApplicationContextAssertTests { diff --git a/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/fieldvalues/javac/JavaCompilerFieldValuesParser.java b/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/fieldvalues/javac/JavaCompilerFieldValuesParser.java index 2675668e69..dc87c14620 100644 --- a/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/fieldvalues/javac/JavaCompilerFieldValuesParser.java +++ b/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/fieldvalues/javac/JavaCompilerFieldValuesParser.java @@ -76,7 +76,7 @@ public class JavaCompilerFieldValuesParser implements FieldValuesParser { WRAPPER_TYPES = Collections.unmodifiableMap(types); } - private static final Map, Object> DEFAULT_TYPE_VALUES; + private static final Map, Object> defaultTypeValues; static { Map, Object> values = new HashMap<>(); @@ -85,16 +85,16 @@ public class JavaCompilerFieldValuesParser implements FieldValuesParser { values.put(Short.class, (short) 0); values.put(Integer.class, 0); values.put(Long.class, (long) 0); - DEFAULT_TYPE_VALUES = Collections.unmodifiableMap(values); + defaultTypeValues = Collections.unmodifiableMap(values); } - private static final Map WELL_KNOWN_STATIC_FINALS; + private static final Map wellKnownStaticFinals; static { Map values = new HashMap<>(); values.put("Boolean.TRUE", true); values.put("Boolean.FALSE", false); - WELL_KNOWN_STATIC_FINALS = Collections.unmodifiableMap(values); + wellKnownStaticFinals = Collections.unmodifiableMap(values); } private final Map fieldValues = new HashMap<>(); @@ -115,7 +115,7 @@ public class JavaCompilerFieldValuesParser implements FieldValuesParser { private Object getValue(VariableTree variable) throws Exception { ExpressionTree initializer = variable.getInitializer(); Class wrapperType = WRAPPER_TYPES.get(variable.getType()); - Object defaultValue = DEFAULT_TYPE_VALUES.get(wrapperType); + Object defaultValue = defaultTypeValues.get(wrapperType); if (initializer != null) { return getValue(initializer, defaultValue); } @@ -148,7 +148,7 @@ public class JavaCompilerFieldValuesParser implements FieldValuesParser { return this.staticFinals.get(expression.toString()); } if (expression.getKind().equals("MEMBER_SELECT")) { - return WELL_KNOWN_STATIC_FINALS.get(expression.toString()); + return wellKnownStaticFinals.get(expression.toString()); } return defaultValue; } diff --git a/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/Layouts.java b/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/Layouts.java index f57d1d81b8..78e5e44371 100644 --- a/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/Layouts.java +++ b/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/Layouts.java @@ -120,7 +120,7 @@ public final class Layouts { */ public static class War implements Layout { - private static final Map SCOPE_DESTINATIONS; + private static final Map scopeDestinations; static { Map map = new HashMap<>(); @@ -128,7 +128,7 @@ public final class Layouts { map.put(LibraryScope.CUSTOM, "WEB-INF/lib/"); map.put(LibraryScope.RUNTIME, "WEB-INF/lib/"); map.put(LibraryScope.PROVIDED, "WEB-INF/lib-provided/"); - SCOPE_DESTINATIONS = Collections.unmodifiableMap(map); + scopeDestinations = Collections.unmodifiableMap(map); } @Override @@ -138,7 +138,7 @@ public final class Layouts { @Override public String getLibraryDestination(String libraryName, LibraryScope scope) { - return SCOPE_DESTINATIONS.get(scope); + return scopeDestinations.get(scope); } @Override diff --git a/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/ArtifactsLibraries.java b/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/ArtifactsLibraries.java index fed687bf27..5ed0dbe765 100644 --- a/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/ArtifactsLibraries.java +++ b/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/ArtifactsLibraries.java @@ -42,15 +42,15 @@ import org.springframework.boot.loader.tools.LibraryScope; */ public class ArtifactsLibraries implements Libraries { - private static final Map SCOPES; + private static final Map scopes; static { - Map scopes = new HashMap<>(); - scopes.put(Artifact.SCOPE_COMPILE, LibraryScope.COMPILE); - scopes.put(Artifact.SCOPE_RUNTIME, LibraryScope.RUNTIME); - scopes.put(Artifact.SCOPE_PROVIDED, LibraryScope.PROVIDED); - scopes.put(Artifact.SCOPE_SYSTEM, LibraryScope.PROVIDED); - SCOPES = Collections.unmodifiableMap(scopes); + Map libraryScopes = new HashMap<>(); + libraryScopes.put(Artifact.SCOPE_COMPILE, LibraryScope.COMPILE); + libraryScopes.put(Artifact.SCOPE_RUNTIME, LibraryScope.RUNTIME); + libraryScopes.put(Artifact.SCOPE_PROVIDED, LibraryScope.PROVIDED); + libraryScopes.put(Artifact.SCOPE_SYSTEM, LibraryScope.PROVIDED); + scopes = Collections.unmodifiableMap(libraryScopes); } private final Set artifacts; @@ -70,7 +70,7 @@ public class ArtifactsLibraries implements Libraries { public void doWithLibraries(LibraryCallback callback) throws IOException { Set duplicates = getDuplicates(this.artifacts); for (Artifact artifact : this.artifacts) { - LibraryScope scope = SCOPES.get(artifact.getScope()); + LibraryScope scope = scopes.get(artifact.getScope()); if (scope != null && artifact.getFile() != null) { String name = getFileName(artifact); if (duplicates.contains(name)) { diff --git a/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Binder.java b/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Binder.java index c68aa9bfb8..5e13273718 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Binder.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Binder.java @@ -56,12 +56,12 @@ public class Binder { private static final Set> NON_BEAN_CLASSES = Collections .unmodifiableSet(new HashSet<>(Arrays.asList(Object.class, Class.class))); - private static final List BEAN_BINDERS; + private static final List beanBinders; static { - List beanBinders = new ArrayList<>(); - beanBinders.add(new JavaBeanBinder()); - BEAN_BINDERS = Collections.unmodifiableList(beanBinders); + List binders = new ArrayList<>(); + binders.add(new JavaBeanBinder()); + beanBinders = Collections.unmodifiableList(binders); } private final Iterable sources; @@ -302,7 +302,7 @@ public class Binder { return null; } return context.withBean(type, () -> { - Stream boundBeans = BEAN_BINDERS.stream() + Stream boundBeans = beanBinders.stream() .map((b) -> b.bind(name, target, context, propertyBinder)); return boundBeans.filter(Objects::nonNull).findFirst().orElse(null); }); diff --git a/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/ColorConverter.java b/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/ColorConverter.java index 5cdce0a85c..3f6340fea1 100644 --- a/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/ColorConverter.java +++ b/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/ColorConverter.java @@ -49,28 +49,28 @@ import org.springframework.boot.ansi.AnsiStyle; @ConverterKeys({ "clr", "color" }) public final class ColorConverter extends LogEventPatternConverter { - private static final Map ELEMENTS; + private static final Map elements; static { - Map elements = new HashMap<>(); - elements.put("faint", AnsiStyle.FAINT); - elements.put("red", AnsiColor.RED); - elements.put("green", AnsiColor.GREEN); - elements.put("yellow", AnsiColor.YELLOW); - elements.put("blue", AnsiColor.BLUE); - elements.put("magenta", AnsiColor.MAGENTA); - elements.put("cyan", AnsiColor.CYAN); - ELEMENTS = Collections.unmodifiableMap(elements); + Map ansiElements = new HashMap<>(); + ansiElements.put("faint", AnsiStyle.FAINT); + ansiElements.put("red", AnsiColor.RED); + ansiElements.put("green", AnsiColor.GREEN); + ansiElements.put("yellow", AnsiColor.YELLOW); + ansiElements.put("blue", AnsiColor.BLUE); + ansiElements.put("magenta", AnsiColor.MAGENTA); + ansiElements.put("cyan", AnsiColor.CYAN); + elements = Collections.unmodifiableMap(ansiElements); } - private static final Map LEVELS; + private static final Map levels; static { - Map levels = new HashMap<>(); - levels.put(Level.FATAL.intLevel(), AnsiColor.RED); - levels.put(Level.ERROR.intLevel(), AnsiColor.RED); - levels.put(Level.WARN.intLevel(), AnsiColor.YELLOW); - LEVELS = Collections.unmodifiableMap(levels); + Map ansiLevels = new HashMap<>(); + ansiLevels.put(Level.FATAL.intLevel(), AnsiColor.RED); + ansiLevels.put(Level.ERROR.intLevel(), AnsiColor.RED); + ansiLevels.put(Level.WARN.intLevel(), AnsiColor.YELLOW); + levels = Collections.unmodifiableMap(ansiLevels); } private final List formatters; @@ -101,7 +101,7 @@ public final class ColorConverter extends LogEventPatternConverter { } PatternParser parser = PatternLayout.createPatternParser(config); List formatters = parser.parse(options[0]); - AnsiElement element = (options.length == 1 ? null : ELEMENTS.get(options[1])); + AnsiElement element = (options.length == 1 ? null : elements.get(options[1])); return new ColorConverter(formatters, element); } @@ -125,7 +125,7 @@ public final class ColorConverter extends LogEventPatternConverter { AnsiElement element = this.styling; if (element == null) { // Assume highlighting - element = LEVELS.get(event.getLevel().intLevel()); + element = levels.get(event.getLevel().intLevel()); element = (element == null ? AnsiColor.GREEN : element); } appendAnsiString(toAppendTo, buf.toString(), element); diff --git a/spring-boot/src/main/java/org/springframework/boot/logging/logback/ColorConverter.java b/spring-boot/src/main/java/org/springframework/boot/logging/logback/ColorConverter.java index 7bc70e1d20..470646f3fc 100644 --- a/spring-boot/src/main/java/org/springframework/boot/logging/logback/ColorConverter.java +++ b/spring-boot/src/main/java/org/springframework/boot/logging/logback/ColorConverter.java @@ -38,35 +38,35 @@ import org.springframework.boot.ansi.AnsiStyle; */ public class ColorConverter extends CompositeConverter { - private static final Map ELEMENTS; + private static final Map elements; static { - Map elements = new HashMap<>(); - elements.put("faint", AnsiStyle.FAINT); - elements.put("red", AnsiColor.RED); - elements.put("green", AnsiColor.GREEN); - elements.put("yellow", AnsiColor.YELLOW); - elements.put("blue", AnsiColor.BLUE); - elements.put("magenta", AnsiColor.MAGENTA); - elements.put("cyan", AnsiColor.CYAN); - ELEMENTS = Collections.unmodifiableMap(elements); + Map ansiElements = new HashMap<>(); + ansiElements.put("faint", AnsiStyle.FAINT); + ansiElements.put("red", AnsiColor.RED); + ansiElements.put("green", AnsiColor.GREEN); + ansiElements.put("yellow", AnsiColor.YELLOW); + ansiElements.put("blue", AnsiColor.BLUE); + ansiElements.put("magenta", AnsiColor.MAGENTA); + ansiElements.put("cyan", AnsiColor.CYAN); + elements = Collections.unmodifiableMap(ansiElements); } - private static final Map LEVELS; + private static final Map levels; static { - Map levels = new HashMap<>(); - levels.put(Level.ERROR_INTEGER, AnsiColor.RED); - levels.put(Level.WARN_INTEGER, AnsiColor.YELLOW); - LEVELS = Collections.unmodifiableMap(levels); + Map ansiLevels = new HashMap<>(); + ansiLevels.put(Level.ERROR_INTEGER, AnsiColor.RED); + ansiLevels.put(Level.WARN_INTEGER, AnsiColor.YELLOW); + levels = Collections.unmodifiableMap(ansiLevels); } @Override protected String transform(ILoggingEvent event, String in) { - AnsiElement element = ELEMENTS.get(getFirstOption()); + AnsiElement element = elements.get(getFirstOption()); if (element == null) { // Assume highlighting - element = LEVELS.get(event.getLevel().toInteger()); + element = levels.get(event.getLevel().toInteger()); element = (element == null ? AnsiColor.GREEN : element); } return toAnsiString(in, element); diff --git a/spring-boot/src/main/java/org/springframework/boot/system/ApplicationPidFileWriter.java b/spring-boot/src/main/java/org/springframework/boot/system/ApplicationPidFileWriter.java index 726a32a06e..67da5c258c 100644 --- a/spring-boot/src/main/java/org/springframework/boot/system/ApplicationPidFileWriter.java +++ b/spring-boot/src/main/java/org/springframework/boot/system/ApplicationPidFileWriter.java @@ -66,23 +66,23 @@ public class ApplicationPidFileWriter private static final String DEFAULT_FILE_NAME = "application.pid"; - private static final List FILE_PROPERTIES; + private static final List fileProperties; static { List properties = new ArrayList<>(); properties.add(new SpringProperty("spring.pid.", "file")); properties.add(new SpringProperty("spring.", "pidfile")); properties.add(new SystemProperty("PIDFILE")); - FILE_PROPERTIES = Collections.unmodifiableList(properties); + fileProperties = Collections.unmodifiableList(properties); } - private static final List FAIL_ON_WRITE_ERROR_PROPERTIES; + private static final List failOnWriteErrorProperties; static { List properties = new ArrayList<>(); properties.add(new SpringProperty("spring.pid.", "fail-on-write-error")); properties.add(new SystemProperty("PID_FAIL_ON_WRITE_ERROR")); - FAIL_ON_WRITE_ERROR_PROPERTIES = Collections.unmodifiableList(properties); + failOnWriteErrorProperties = Collections.unmodifiableList(properties); } private static final AtomicBoolean created = new AtomicBoolean(false); @@ -153,7 +153,7 @@ public class ApplicationPidFileWriter private void writePidFile(SpringApplicationEvent event) throws IOException { File pidFile = this.file; - String override = getProperty(event, FILE_PROPERTIES); + String override = getProperty(event, fileProperties); if (override != null) { pidFile = new File(override); } @@ -162,7 +162,7 @@ public class ApplicationPidFileWriter } private boolean failOnWriteError(SpringApplicationEvent event) { - String value = getProperty(event, FAIL_ON_WRITE_ERROR_PROPERTIES); + String value = getProperty(event, failOnWriteErrorProperties); return (value == null ? false : Boolean.parseBoolean(value)); } diff --git a/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletComponentRegisteringPostProcessor.java b/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletComponentRegisteringPostProcessor.java index 4d9b41ff70..e6667e65c4 100644 --- a/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletComponentRegisteringPostProcessor.java +++ b/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletComponentRegisteringPostProcessor.java @@ -43,14 +43,14 @@ import org.springframework.web.context.WebApplicationContext; class ServletComponentRegisteringPostProcessor implements BeanFactoryPostProcessor, ApplicationContextAware { - private static final List HANDLERS; + private static final List handlers; static { - List handlers = new ArrayList<>(); - handlers.add(new WebServletHandler()); - handlers.add(new WebFilterHandler()); - handlers.add(new WebListenerHandler()); - HANDLERS = Collections.unmodifiableList(handlers); + List servletComponentHandlers = new ArrayList<>(); + servletComponentHandlers.add(new WebServletHandler()); + servletComponentHandlers.add(new WebFilterHandler()); + servletComponentHandlers.add(new WebListenerHandler()); + handlers = Collections.unmodifiableList(servletComponentHandlers); } private final Set packagesToScan; @@ -78,7 +78,7 @@ class ServletComponentRegisteringPostProcessor for (BeanDefinition candidate : componentProvider .findCandidateComponents(packageToScan)) { if (candidate instanceof ScannedGenericBeanDefinition) { - for (ServletComponentHandler handler : HANDLERS) { + for (ServletComponentHandler handler : handlers) { handler.handle(((ScannedGenericBeanDefinition) candidate), (BeanDefinitionRegistry) this.applicationContext); } @@ -97,7 +97,7 @@ class ServletComponentRegisteringPostProcessor false); componentProvider.setEnvironment(this.applicationContext.getEnvironment()); componentProvider.setResourceLoader(this.applicationContext); - for (ServletComponentHandler handler : HANDLERS) { + for (ServletComponentHandler handler : handlers) { componentProvider.addIncludeFilter(handler.getTypeFilter()); } return componentProvider;