From 45c32854a53143a1a05e4f194752d3daf34fa710 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Tue, 9 Jan 2024 17:06:53 +0000 Subject: [PATCH] Fix Checkstyle upgrade Closes gh-38746 --- buildSrc/build.gradle | 11 +++++---- .../boot/build/JavaConventions.java | 4 +++- ...SkipSslVerificationHttpRequestFactory.java | 6 ++--- .../LogFileWebEndpointAutoConfiguration.java | 4 ++-- .../JerseyServerMetricsAutoConfiguration.java | 4 ++-- .../security/servlet/EndpointRequest.java | 4 ++-- ...activeHealthEndpointWebExtensionTests.java | 4 ++-- ...oundryHealthEndpointWebExtensionTests.java | 4 ++-- .../HealthEndpointDocumentationTests.java | 4 ++-- .../ObservationAutoConfigurationTests.java | 6 ++--- ...ionRegistryConfigurerIntegrationTests.java | 4 ++-- .../tracing/BraveAutoConfigurationTests.java | 4 ++-- ...crometerTracingAutoConfigurationTests.java | 8 +++---- .../OpenTelemetryAutoConfigurationTests.java | 10 ++++---- .../otlp/OtlpAutoConfigurationTests.java | 6 ++--- ...etheusExemplarsAutoConfigurationTests.java | 4 ++-- ...avefrontTracingAutoConfigurationTests.java | 8 +++---- .../zipkin/ZipkinAutoConfigurationTests.java | 4 ++-- ...ConfigurationsBraveConfigurationTests.java | 8 +++---- ...ationsOpenTelemetryConfigurationTests.java | 8 +++---- ...figurationsReporterConfigurationTests.java | 8 +++---- ...onfigurationsSenderConfigurationTests.java | 10 ++++---- ...ConfigurationPropertiesReportEndpoint.java | 6 ++--- .../reflect/OperationMethodParameter.java | 4 ++-- .../actuate/endpoint/jmx/EndpointMBean.java | 4 ++-- .../annotation/DiscoveredJmxOperation.java | 4 ++-- .../AbstractWebMvcEndpointHandlerMapping.java | 4 ++-- .../health/SimpleStatusAggregator.java | 4 ++-- .../jdbc/DataSourceHealthIndicator.java | 4 ++-- .../actuate/ldap/LdapHealthIndicator.java | 4 ++-- .../metrics/cache/CacheMetricsRegistrar.java | 4 ++-- .../neo4j/Neo4jReactiveHealthIndicator.java | 4 ++-- .../security/AuthenticationAuditListener.java | 4 ++-- .../OperationReflectiveProcessorTests.java | 4 ++-- .../cache/CachingOperationInvokerTests.java | 6 ++--- .../AutoConfigurationImportSelector.java | 4 ++-- .../BackgroundPreinitializer.java | 12 +++++----- .../cassandra/CassandraAutoConfiguration.java | 4 ++-- .../condition/ConditionEvaluationReport.java | 4 ++-- ...assandraReactiveRepositoriesRegistrar.java | 4 ++-- .../CassandraRepositoriesRegistrar.java | 4 ++-- ...ouchbaseReactiveRepositoriesRegistrar.java | 4 ++-- .../CouchbaseRepositoriesRegistrar.java | 4 ++-- .../ElasticsearchRepositoriesRegistrar.java | 4 ++-- ...iveElasticsearchRepositoriesRegistrar.java | 4 ++-- .../data/jdbc/JdbcRepositoriesRegistrar.java | 4 ++-- .../EnversRevisionRepositoriesRegistrar.java | 4 ++-- .../data/jpa/JpaRepositoriesRegistrar.java | 4 ++-- .../data/ldap/LdapRepositoriesRegistrar.java | 4 ++-- .../MongoReactiveRepositoriesRegistrar.java | 4 ++-- .../mongo/MongoRepositoriesRegistrar.java | 4 ++-- .../Neo4jReactiveRepositoriesRegistrar.java | 4 ++-- .../neo4j/Neo4jRepositoriesRegistrar.java | 4 ++-- ...dbcRepositoriesAutoConfigureRegistrar.java | 4 ++-- .../redis/LettuceConnectionConfiguration.java | 4 ++-- .../redis/RedisRepositoriesRegistrar.java | 4 ++-- ...ttpMessageConvertersAutoConfiguration.java | 4 ++-- ...grationAutoConfigurationScanRegistrar.java | 4 ++-- .../autoconfigure/kafka/KafkaProperties.java | 4 ++-- .../TemplateAvailabilityProviders.java | 4 ++-- .../client/RestTemplateAutoConfiguration.java | 4 ++-- .../AbstractErrorWebExceptionHandler.java | 4 ++-- .../DispatcherServletAutoConfiguration.java | 6 ++--- .../error/ErrorMvcAutoConfiguration.java | 6 ++--- ...owWebSocketServletWebServerCustomizer.java | 4 ++-- .../AutoConfigurationImportSelectorTests.java | 24 +++++++++---------- .../r2dbc/R2dbcAutoConfigurationTests.java | 4 ++-- ...nLazyInitializationExcludeFilterTests.java | 6 ++--- .../devtools/livereload/LiveReloadServer.java | 4 ++-- ...assLoaderFilesResourcePatternResolver.java | 4 ++-- .../restart/RestartScopeInitializer.java | 4 ++-- .../boot/devtools/restart/Restarter.java | 4 ++-- .../restart/SilentExitExceptionHandler.java | 4 ++-- .../DevToolsR2dbcAutoConfigurationTests.java | 4 ++-- .../filewatch/FileSystemWatcherTests.java | 4 ++-- .../RestartApplicationListenerTests.java | 4 ++-- .../MySpringBootTestsConfiguration.java | 2 +- ...ConfigurationContextCustomizerFactory.java | 4 ++-- .../RestDocsTestExecutionListener.java | 4 ++-- .../SpringBootMockMvcBuilderCustomizer.java | 8 +++---- .../test/context/SpringBootContextLoader.java | 4 ++-- ...ateJsonObjectContextCustomizerFactory.java | 4 ++-- .../mockito/MockitoTestExecutionListener.java | 4 ++-- .../test/web/client/TestRestTemplate.java | 4 ++-- .../context/SpringBootContextLoaderTests.java | 5 ++-- .../mockito/SpringBootMockResolverTests.java | 4 ++-- ...tomizerWithoutWebfluxIntegrationTests.java | 4 ++-- .../build/BuildpackLayersMetadata.java | 6 ++--- .../buildpack/platform/build/Lifecycle.java | 4 ++-- .../buildpack/platform/docker/DockerApi.java | 8 +++---- .../transport/LocalHttpClientTransport.java | 6 ++--- .../platform/socket/DomainSocket.java | 6 ++--- .../platform/socket/NamedPipeSocket.java | 8 +++---- .../cli/command/options/OptionHandler.java | 4 ++-- ...onstructorParameterPropertyDescriptor.java | 6 ++--- .../javac/JavaCompilerFieldValuesParser.java | 4 ++-- .../metadata/JsonConverter.java | 4 ++-- .../AbstractFieldValuesProcessorTests.java | 4 ++-- .../layertools/ExtractCommandTests.java | 4 ++-- .../boot/loader/tools/LogbackInitializer.java | 4 ++-- .../boot/loader/tools/MainClassFinder.java | 4 ++-- .../boot/loader/tools/Packager.java | 4 ++-- .../loader/data/RandomAccessDataFile.java | 4 ++-- .../loader/jarmode/LauncherJarModeTests.java | 4 ++-- .../main/java/org/test/SampleApplication.java | 4 ++-- .../boot/maven/CommandLineBuilder.java | 4 ++-- .../boot/SpringApplication.java | 4 ++-- .../boot/SpringApplicationShutdownHook.java | 6 ++--- .../boot/SpringBootExceptionHandler.java | 4 ++-- ...SpringApplicationAdminMXBeanRegistrar.java | 4 ++-- ...tContextApplicationContextInitializer.java | 4 ++-- .../event/EventPublishingRunListener.java | 4 ++-- .../logging/LoggingApplicationListener.java | 2 +- .../bind/BindableRuntimeHintsRegistrar.java | 4 ++-- .../boot/env/OriginTrackedYamlLoader.java | 4 ++-- .../boot/jdbc/DataSourceUnwrapper.java | 4 ++-- .../boot/jdbc/EmbeddedDatabaseConnection.java | 4 ++-- .../boot/json/JacksonJsonParser.java | 6 ++--- .../springframework/boot/util/LambdaSafe.java | 4 ++-- .../web/embedded/jetty/JasperInitializer.java | 6 ++--- .../jetty/JettyEmbeddedWebAppContext.java | 4 ++-- .../tomcat/TomcatServletWebServerFactory.java | 4 ++-- .../ServletContextInitializerBeans.java | 7 +++--- .../boot/DefaultBootstrapContextTests.java | 4 ++-- ...nactiveConfigDataAccessExceptionTests.java | 4 ++-- ...validConfigDataPropertyExceptionTests.java | 4 ++-- .../ConversionServiceDeducerTests.java | 6 ++--- .../MockConfigurationPropertySource.java | 4 ++-- ...ApplicationContextRequestMatcherTests.java | 4 ++-- .../JettyServletWebServerFactoryTests.java | 4 ++-- .../AbstractServletWebServerFactoryTests.java | 4 ++-- .../SpringBootServletInitializerTests.java | 4 ++-- .../SampleIntegrationApplication.java | 4 ++-- .../SampleParentContextApplication.java | 4 ++-- .../smoketest/mustache/WelcomeController.java | 6 ++--- 135 files changed, 329 insertions(+), 324 deletions(-) diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index 412478465c9e..5d9fe4c4b8cc 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -30,8 +30,13 @@ if (versions.springFramework.contains("-")) { } } +checkstyle { + toolVersion = "10.12.4" +} + dependencies { - checkstyle "io.spring.javaformat:spring-javaformat-checkstyle:${javaFormatVersion}" + checkstyle("com.puppycrawl.tools:checkstyle:${checkstyle.toolVersion}") + checkstyle("io.spring.javaformat:spring-javaformat-checkstyle:${javaFormatVersion}") implementation(platform("org.springframework:spring-framework-bom:${versions.springFramework}")) implementation("com.diffplug.gradle:goomph:3.37.2") @@ -57,10 +62,6 @@ dependencies { testRuntimeOnly("org.junit.platform:junit-platform-launcher") } -checkstyle { - toolVersion = "10.12.4" -} - gradlePlugin { plugins { annotationProcessorPlugin { diff --git a/buildSrc/src/main/java/org/springframework/boot/build/JavaConventions.java b/buildSrc/src/main/java/org/springframework/boot/build/JavaConventions.java index 6f13a5fbbac2..9b30230ebe0a 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/JavaConventions.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/JavaConventions.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -243,6 +243,8 @@ private void configureSpringJavaFormat(Project project) { checkstyle.getConfigDirectory().set(project.getRootProject().file("src/checkstyle")); String version = SpringJavaFormatPlugin.class.getPackage().getImplementationVersion(); DependencySet checkstyleDependencies = project.getConfigurations().getByName("checkstyle").getDependencies(); + checkstyleDependencies + .add(project.getDependencies().create("com.puppycrawl.tools:checkstyle:" + checkstyle.getToolVersion())); checkstyleDependencies .add(project.getDependencies().create("io.spring.javaformat:spring-javaformat-checkstyle:" + version)); } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/SkipSslVerificationHttpRequestFactory.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/SkipSslVerificationHttpRequestFactory.java index 54a9e10dba5a..d463a4fc18f2 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/SkipSslVerificationHttpRequestFactory.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/SkipSslVerificationHttpRequestFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2024 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. @@ -62,7 +62,7 @@ private SSLSocketFactory createSslSocketFactory() throws Exception { return context.getSocketFactory(); } - private static class SkipHostnameVerifier implements HostnameVerifier { + private static final class SkipHostnameVerifier implements HostnameVerifier { @Override public boolean verify(String s, SSLSession sslSession) { @@ -71,7 +71,7 @@ public boolean verify(String s, SSLSession sslSession) { } - private static class SkipX509TrustManager implements X509TrustManager { + private static final class SkipX509TrustManager implements X509TrustManager { @Override public X509Certificate[] getAcceptedIssuers() { diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/logging/LogFileWebEndpointAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/logging/LogFileWebEndpointAutoConfiguration.java index 25700cda5028..c3e88935d581 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/logging/LogFileWebEndpointAutoConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/logging/LogFileWebEndpointAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2024 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. @@ -54,7 +54,7 @@ public LogFileWebEndpoint logFileWebEndpoint(ObjectProvider logFile, return new LogFileWebEndpoint(logFile.getIfAvailable(), properties.getExternalFile()); } - private static class LogFileCondition extends SpringBootCondition { + private static final class LogFileCondition extends SpringBootCondition { @Override public ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeMetadata metadata) { diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/jersey/JerseyServerMetricsAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/jersey/JerseyServerMetricsAutoConfiguration.java index fdb018f2276d..7bd894f08a0e 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/jersey/JerseyServerMetricsAutoConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/jersey/JerseyServerMetricsAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2024 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. @@ -93,7 +93,7 @@ public MeterFilter jerseyMetricsUriTagFilter() { /** * An {@link AnnotationFinder} that uses {@link AnnotationUtils}. */ - private static class AnnotationUtilsAnnotationFinder implements AnnotationFinder { + private static final class AnnotationUtilsAnnotationFinder implements AnnotationFinder { @Override public A findAnnotation(AnnotatedElement annotatedElement, Class annotationType) { diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/servlet/EndpointRequest.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/servlet/EndpointRequest.java index 2317c4269b75..b8a63d0c4cc0 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/servlet/EndpointRequest.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/servlet/EndpointRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -311,7 +311,7 @@ protected RequestMatcher createDelegate(WebApplicationContext context, /** * Factory used to create a {@link RequestMatcher}. */ - private static class RequestMatcherFactory { + private static final class RequestMatcherFactory { RequestMatcher antPath(RequestMatcherProvider matcherProvider, String... parts) { StringBuilder pattern = new StringBuilder(); diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/CloudFoundryReactiveHealthEndpointWebExtensionTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/CloudFoundryReactiveHealthEndpointWebExtensionTests.java index e4eeaedbd9be..e6a689d0c48d 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/CloudFoundryReactiveHealthEndpointWebExtensionTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/CloudFoundryReactiveHealthEndpointWebExtensionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -73,7 +73,7 @@ void healthComponentsAlwaysPresent() { }); } - private static class TestHealthIndicator implements HealthIndicator { + private static final class TestHealthIndicator implements HealthIndicator { @Override public Health health() { diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryHealthEndpointWebExtensionTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryHealthEndpointWebExtensionTests.java index f113a01ccffa..6b4331d8540b 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryHealthEndpointWebExtensionTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryHealthEndpointWebExtensionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -70,7 +70,7 @@ void healthComponentsAlwaysPresent() { }); } - private static class TestHealthIndicator implements HealthIndicator { + private static final class TestHealthIndicator implements HealthIndicator { @Override public Health health() { diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/HealthEndpointDocumentationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/HealthEndpointDocumentationTests.java index 8d47a690cbec..a001d6869910 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/HealthEndpointDocumentationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/HealthEndpointDocumentationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -138,7 +138,7 @@ CompositeHealthContributor brokerHealthContributor() { } - private static class TestHealthEndpointGroup implements HealthEndpointGroup { + private static final class TestHealthEndpointGroup implements HealthEndpointGroup { private final StatusAggregator statusAggregator = new SimpleStatusAggregator(); diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/observation/ObservationAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/observation/ObservationAutoConfigurationTests.java index f4a818f8c471..5d9c1d3466a9 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/observation/ObservationAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/observation/ObservationAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -493,11 +493,11 @@ public boolean supportsContext(Context context) { } - private static class CustomContext extends Context { + private static final class CustomContext extends Context { } - private static class CalledHandlers { + private static final class CalledHandlers { private final List> calledHandlers = new ArrayList<>(); diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/observation/ObservationRegistryConfigurerIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/observation/ObservationRegistryConfigurerIntegrationTests.java index 12ffa4d1cae8..8ffcd64f4b2e 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/observation/ObservationRegistryConfigurerIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/observation/ObservationRegistryConfigurerIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -74,7 +74,7 @@ Customizer2 customizer2(CalledCustomizers calledCustomizers) { } - private static class CalledCustomizers { + private static final class CalledCustomizers { private final List> customizers = new ArrayList<>(); diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/BraveAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/BraveAutoConfigurationTests.java index 62336cb379c0..e882188eea6d 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/BraveAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/BraveAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -407,7 +407,7 @@ static class AdditionalSpanHandler extends SpanHandler { } @Configuration(proxyBeanMethods = false) - private static class CustomConfiguration { + private static final class CustomConfiguration { @Bean Tracing customTracing() { diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/MicrometerTracingAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/MicrometerTracingAutoConfigurationTests.java index 6f3c4a373d06..bfef8cccd539 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/MicrometerTracingAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/MicrometerTracingAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -123,7 +123,7 @@ void shouldNotSupplyBeansIfTracingIsDisabled() { } @Configuration(proxyBeanMethods = false) - private static class TracerConfiguration { + private static final class TracerConfiguration { @Bean Tracer tracer() { @@ -133,7 +133,7 @@ Tracer tracer() { } @Configuration(proxyBeanMethods = false) - private static class PropagatorConfiguration { + private static final class PropagatorConfiguration { @Bean Propagator propagator() { @@ -143,7 +143,7 @@ Propagator propagator() { } @Configuration(proxyBeanMethods = false) - private static class CustomConfiguration { + private static final class CustomConfiguration { @Bean DefaultTracingObservationHandler customDefaultTracingObservationHandler() { diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/OpenTelemetryAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/OpenTelemetryAutoConfigurationTests.java index 8918f52ab53d..8861c0ef2088 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/OpenTelemetryAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/OpenTelemetryAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -268,7 +268,7 @@ void shouldCustomizeSdkTracerProvider() { } @Configuration(proxyBeanMethods = false) - private static class CustomConfiguration { + private static final class CustomConfiguration { @Bean io.micrometer.tracing.Tracer customMicrometerTracer() { @@ -343,7 +343,7 @@ SpanCustomizer customSpanCustomizer() { } @Configuration(proxyBeanMethods = false) - private static class SdkTracerProviderCustomizationConfiguration { + private static final class SdkTracerProviderCustomizationConfiguration { @Bean @Order(1) @@ -366,7 +366,7 @@ SdkTracerProviderBuilderCustomizer sdkTracerProviderBuilderCustomizerTwo() { } @Configuration(proxyBeanMethods = false) - private static class InMemoryRecordingSpanExporterConfiguration { + private static final class InMemoryRecordingSpanExporterConfiguration { @Bean InMemoryRecordingSpanExporter spanExporter() { @@ -375,7 +375,7 @@ InMemoryRecordingSpanExporter spanExporter() { } - private static class InMemoryRecordingSpanExporter implements SpanExporter { + private static final class InMemoryRecordingSpanExporter implements SpanExporter { private final List exportedSpans = new ArrayList<>(); diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/otlp/OtlpAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/otlp/OtlpAutoConfigurationTests.java index 5d75c06b5112..b46b6ba153dc 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/otlp/OtlpAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/otlp/OtlpAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -90,7 +90,7 @@ void shouldBackOffWhenCustomGrpcExporterIsDefined() { } @Configuration(proxyBeanMethods = false) - private static class CustomHttpExporterConfiguration { + private static final class CustomHttpExporterConfiguration { @Bean OtlpHttpSpanExporter customOtlpHttpSpanExporter() { @@ -100,7 +100,7 @@ OtlpHttpSpanExporter customOtlpHttpSpanExporter() { } @Configuration(proxyBeanMethods = false) - private static class CustomGrpcExporterConfiguration { + private static final class CustomGrpcExporterConfiguration { @Bean OtlpGrpcSpanExporter customOtlpGrpcSpanExporter() { diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/prometheus/PrometheusExemplarsAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/prometheus/PrometheusExemplarsAutoConfigurationTests.java index 2d2f9d35a530..e0b5c51f91b0 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/prometheus/PrometheusExemplarsAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/prometheus/PrometheusExemplarsAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -93,7 +93,7 @@ void prometheusOpenMetricsOutputShouldContainExemplars() { } @Configuration(proxyBeanMethods = false) - private static class CustomConfiguration { + private static final class CustomConfiguration { static final SpanContextSupplier SUPPLIER = mock(SpanContextSupplier.class); diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/wavefront/WavefrontTracingAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/wavefront/WavefrontTracingAutoConfigurationTests.java index a75d692772e6..6f9f85069d2f 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/wavefront/WavefrontTracingAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/wavefront/WavefrontTracingAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -173,7 +173,7 @@ void shouldBackOffOnCustomBeans() { } @Configuration(proxyBeanMethods = false) - private static class CustomConfiguration { + private static final class CustomConfiguration { @Bean ApplicationTags customApplicationTags() { @@ -203,7 +203,7 @@ WavefrontOtelSpanExporter customWavefrontOtelSpanExporter() { } @Configuration(proxyBeanMethods = false) - private static class WavefrontSenderConfiguration { + private static final class WavefrontSenderConfiguration { @Bean WavefrontSender wavefrontSender() { @@ -213,7 +213,7 @@ WavefrontSender wavefrontSender() { } @Configuration(proxyBeanMethods = false) - private static class MeterRegistryConfiguration { + private static final class MeterRegistryConfiguration { @Bean MeterRegistry meterRegistry() { diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/zipkin/ZipkinAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/zipkin/ZipkinAutoConfigurationTests.java index c647bfbfe2ac..6453d24137dd 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/zipkin/ZipkinAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/zipkin/ZipkinAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -93,7 +93,7 @@ void shouldWorkWithoutSenders() { } @Configuration(proxyBeanMethods = false) - private static class CustomConfiguration { + private static final class CustomConfiguration { @Bean BytesEncoder customBytesEncoder() { diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/zipkin/ZipkinConfigurationsBraveConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/zipkin/ZipkinConfigurationsBraveConfigurationTests.java index 735cd00d0c6b..ba3c26c1f91d 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/zipkin/ZipkinConfigurationsBraveConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/zipkin/ZipkinConfigurationsBraveConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -80,7 +80,7 @@ void shouldSupplyZipkinSpanHandlerWithCustomSpanHandler() { } @Configuration(proxyBeanMethods = false) - private static class ReporterConfiguration { + private static final class ReporterConfiguration { @Bean @SuppressWarnings("unchecked") @@ -91,7 +91,7 @@ Reporter reporter() { } @Configuration(proxyBeanMethods = false) - private static class CustomConfiguration { + private static final class CustomConfiguration { @Bean @SuppressWarnings("unchecked") @@ -102,7 +102,7 @@ ZipkinSpanHandler customZipkinSpanHandler() { } @Configuration(proxyBeanMethods = false) - private static class CustomSpanHandlerConfiguration { + private static final class CustomSpanHandlerConfiguration { @Bean SpanHandler customSpanHandler() { diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/zipkin/ZipkinConfigurationsOpenTelemetryConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/zipkin/ZipkinConfigurationsOpenTelemetryConfigurationTests.java index c3ef5f99c371..27fd9be141d1 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/zipkin/ZipkinConfigurationsOpenTelemetryConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/zipkin/ZipkinConfigurationsOpenTelemetryConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -71,7 +71,7 @@ void shouldBackOffOnCustomBeans() { } @Configuration(proxyBeanMethods = false) - private static class SenderConfiguration { + private static final class SenderConfiguration { @Bean Sender sender() { @@ -81,7 +81,7 @@ Sender sender() { } @Configuration(proxyBeanMethods = false) - private static class CustomConfiguration { + private static final class CustomConfiguration { @Bean ZipkinSpanExporter customZipkinSpanExporter() { @@ -91,7 +91,7 @@ ZipkinSpanExporter customZipkinSpanExporter() { } @Configuration(proxyBeanMethods = false) - private static class BaseConfiguration { + private static final class BaseConfiguration { @Bean @ConditionalOnMissingBean diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/zipkin/ZipkinConfigurationsReporterConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/zipkin/ZipkinConfigurationsReporterConfigurationTests.java index b09805215d67..45a9f3f1d22d 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/zipkin/ZipkinConfigurationsReporterConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/zipkin/ZipkinConfigurationsReporterConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -64,7 +64,7 @@ void shouldBackOffOnCustomBeans() { } @Configuration(proxyBeanMethods = false) - private static class SenderConfiguration { + private static final class SenderConfiguration { @Bean Sender sender() { @@ -74,7 +74,7 @@ Sender sender() { } @Configuration(proxyBeanMethods = false) - private static class CustomConfiguration { + private static final class CustomConfiguration { @Bean @SuppressWarnings("unchecked") @@ -85,7 +85,7 @@ Reporter customReporter() { } @Configuration(proxyBeanMethods = false) - private static class BaseConfiguration { + private static final class BaseConfiguration { @Bean @ConditionalOnMissingBean diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/zipkin/ZipkinConfigurationsSenderConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/zipkin/ZipkinConfigurationsSenderConfigurationTests.java index 3dfeeb37af5e..9b98d24710a4 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/zipkin/ZipkinConfigurationsSenderConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/zipkin/ZipkinConfigurationsSenderConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -173,7 +173,7 @@ void shouldApplyZipkinRestTemplateBuilderCustomizers() throws IOException { } @Configuration(proxyBeanMethods = false) - private static class RestTemplateConfiguration { + private static final class RestTemplateConfiguration { @Bean ZipkinRestTemplateBuilderCustomizer zipkinRestTemplateBuilderCustomizer() { @@ -183,7 +183,7 @@ ZipkinRestTemplateBuilderCustomizer zipkinRestTemplateBuilderCustomizer() { } @Configuration(proxyBeanMethods = false) - private static class WebClientConfiguration { + private static final class WebClientConfiguration { @Bean ZipkinWebClientBuilderCustomizer webClientBuilder() { @@ -193,7 +193,7 @@ ZipkinWebClientBuilderCustomizer webClientBuilder() { } @Configuration(proxyBeanMethods = false) - private static class CustomConfiguration { + private static final class CustomConfiguration { @Bean Sender customSender() { @@ -202,7 +202,7 @@ Sender customSender() { } - private static class DummyZipkinRestTemplateBuilderCustomizer implements ZipkinRestTemplateBuilderCustomizer { + private static final class DummyZipkinRestTemplateBuilderCustomizer implements ZipkinRestTemplateBuilderCustomizer { @Override public RestTemplateBuilder customize(RestTemplateBuilder restTemplateBuilder) { diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpoint.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpoint.java index 1e03b58419e8..49389aebb264 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpoint.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -402,7 +402,7 @@ private String getQualifiedKey(String prefix, String key) { * Extension to {@link JacksonAnnotationIntrospector} to suppress CGLIB generated bean * properties. */ - private static class ConfigurationPropertiesAnnotationIntrospector extends JacksonAnnotationIntrospector { + private static final class ConfigurationPropertiesAnnotationIntrospector extends JacksonAnnotationIntrospector { @Override public Object findFilterId(Annotated a) { @@ -425,7 +425,7 @@ public Object findFilterId(Annotated a) { *
  • Properties that throw an exception when retrieving their value. * */ - private static class ConfigurationPropertiesPropertyFilter extends SimpleBeanPropertyFilter { + private static final class ConfigurationPropertiesPropertyFilter extends SimpleBeanPropertyFilter { private static final Log logger = LogFactory.getLog(ConfigurationPropertiesPropertyFilter.class); diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoke/reflect/OperationMethodParameter.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoke/reflect/OperationMethodParameter.java index 41e8eeb4d268..a4fa71ebe628 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoke/reflect/OperationMethodParameter.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoke/reflect/OperationMethodParameter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -81,7 +81,7 @@ public String toString() { return this.name + " of type " + this.parameter.getType().getName(); } - private static class Jsr305 { + private static final class Jsr305 { boolean isMandatory(Parameter parameter) { MergedAnnotation annotation = MergedAnnotations.from(parameter).get(Nonnull.class); diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/EndpointMBean.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/EndpointMBean.java index fc6a95ad1f74..845e9707c7e5 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/EndpointMBean.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/EndpointMBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -172,7 +172,7 @@ public AttributeList setAttributes(AttributeList attributes) { return new AttributeList(); } - private static class ReactiveHandler { + private static final class ReactiveHandler { static Object handle(Object result) { if (result instanceof Flux) { diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/annotation/DiscoveredJmxOperation.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/annotation/DiscoveredJmxOperation.java index 95a5024731bd..e9f30aff62b9 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/annotation/DiscoveredJmxOperation.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/annotation/DiscoveredJmxOperation.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -182,7 +182,7 @@ public String toString() { /** * Utility to convert to JMX supported types. */ - private static class JmxType { + private static final class JmxType { static Class get(Class source) { if (source.isEnum()) { diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/AbstractWebMvcEndpointHandlerMapping.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/AbstractWebMvcEndpointHandlerMapping.java index 9be3223ee6d1..8f1afcc02e0f 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/AbstractWebMvcEndpointHandlerMapping.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/AbstractWebMvcEndpointHandlerMapping.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -397,7 +397,7 @@ private Object convertIfNecessary(Object body) { return body; } - private static class FluxBodyConverter implements Function { + private static final class FluxBodyConverter implements Function { @Override public Object apply(Object body) { 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 6cb9295f64a2..417213e9d4d0 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 @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2024 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. @@ -100,7 +100,7 @@ private static String getUniformCode(String code) { /** * {@link Comparator} used to order {@link Status}. */ - private class StatusComparator implements Comparator { + private final class StatusComparator implements Comparator { @Override public int compare(Status s1, Status s2) { diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/jdbc/DataSourceHealthIndicator.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/jdbc/DataSourceHealthIndicator.java index b92c7398a67d..b7f86dee2128 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/jdbc/DataSourceHealthIndicator.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/jdbc/DataSourceHealthIndicator.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2024 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. @@ -163,7 +163,7 @@ public String getQuery() { /** * {@link RowMapper} that expects and returns results from a single column. */ - private static class SingleColumnRowMapper implements RowMapper { + private static final class SingleColumnRowMapper implements RowMapper { @Override public Object mapRow(ResultSet rs, int rowNum) throws SQLException { diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/ldap/LdapHealthIndicator.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/ldap/LdapHealthIndicator.java index bbe10cc1be7d..2000e549b62f 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/ldap/LdapHealthIndicator.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/ldap/LdapHealthIndicator.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2024 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. @@ -51,7 +51,7 @@ protected void doHealthCheck(Health.Builder builder) throws Exception { builder.up().withDetail("version", version); } - private static class VersionContextExecutor implements ContextExecutor { + private static final class VersionContextExecutor implements ContextExecutor { @Override public String executeWithContext(DirContext ctx) throws NamingException { diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/cache/CacheMetricsRegistrar.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/cache/CacheMetricsRegistrar.java index 3950bbd43ed3..fb5d05acb000 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/cache/CacheMetricsRegistrar.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/cache/CacheMetricsRegistrar.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -96,7 +96,7 @@ private Cache unwrapIfNecessary(Cache cache) { return cache; } - private static class TransactionAwareCacheDecoratorHandler { + private static final class TransactionAwareCacheDecoratorHandler { private static Cache unwrapIfNecessary(Cache cache) { try { diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/neo4j/Neo4jReactiveHealthIndicator.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/neo4j/Neo4jReactiveHealthIndicator.java index d959dc3b3077..639cb4bad2eb 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/neo4j/Neo4jReactiveHealthIndicator.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/neo4j/Neo4jReactiveHealthIndicator.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -88,7 +88,7 @@ private Mono healthDetails(ReactiveResult result) * Builder used to create a {@link Neo4jHealthDetails} from a {@link Record} and a * {@link ResultSummary}. */ - private static class Neo4jHealthDetailsBuilder { + private static final class Neo4jHealthDetailsBuilder { private Record record; diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/security/AuthenticationAuditListener.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/security/AuthenticationAuditListener.java index cc8839039b42..f35bd905935a 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/security/AuthenticationAuditListener.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/security/AuthenticationAuditListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2024 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. @@ -93,7 +93,7 @@ private void onAuthenticationSuccessEvent(AuthenticationSuccessEvent event) { publish(new AuditEvent(event.getAuthentication().getName(), AUTHENTICATION_SUCCESS, data)); } - private static class WebAuditListener { + private static final class WebAuditListener { void process(AuthenticationAuditListener listener, AbstractAuthenticationEvent input) { if (listener != null) { diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/annotation/OperationReflectiveProcessorTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/annotation/OperationReflectiveProcessorTests.java index be10d5f3b356..816a82aab294 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/annotation/OperationReflectiveProcessorTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/annotation/OperationReflectiveProcessorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -95,7 +95,7 @@ private void runProcessor(Method method) { } @SuppressWarnings("unused") - private static class Methods { + private static final class Methods { private String string() { return null; diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/invoker/cache/CachingOperationInvokerTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/invoker/cache/CachingOperationInvokerTests.java index 19efb8f682b2..33f89600192d 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/invoker/cache/CachingOperationInvokerTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/invoker/cache/CachingOperationInvokerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -261,7 +261,7 @@ void targetInvokedWithDifferentWebServerNamespace() { then(target).should(times(1)).invoke(contextManagement); } - private static class MonoOperationInvoker implements OperationInvoker { + private static final class MonoOperationInvoker implements OperationInvoker { static AtomicInteger invocations = new AtomicInteger(); @@ -275,7 +275,7 @@ public Mono invoke(InvocationContext context) { } - private static class FluxOperationInvoker implements OperationInvoker { + private static final class FluxOperationInvoker implements OperationInvoker { static AtomicInteger invocations = new AtomicInteger(); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationImportSelector.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationImportSelector.java index 592f87e10ffa..e9e9f1642920 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationImportSelector.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationImportSelector.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -390,7 +390,7 @@ List filter(List configurations) { } - private static class AutoConfigurationGroup + private static final class AutoConfigurationGroup implements DeferredImportSelector.Group, BeanClassLoaderAware, BeanFactoryAware, ResourceLoaderAware { private final Map entries = new LinkedHashMap<>(); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/BackgroundPreinitializer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/BackgroundPreinitializer.java index 7fc2382303ef..8ddac8fa3631 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/BackgroundPreinitializer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/BackgroundPreinitializer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2024 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. @@ -134,7 +134,7 @@ boolean runSafely(Runnable runnable) { /** * Early initializer for Spring MessageConverters. */ - private static class MessageConverterInitializer implements Runnable { + private static final class MessageConverterInitializer implements Runnable { @Override public void run() { @@ -146,7 +146,7 @@ public void run() { /** * Early initializer for jakarta.validation. */ - private static class ValidationInitializer implements Runnable { + private static final class ValidationInitializer implements Runnable { @Override public void run() { @@ -159,7 +159,7 @@ public void run() { /** * Early initializer for Jackson. */ - private static class JacksonInitializer implements Runnable { + private static final class JacksonInitializer implements Runnable { @Override public void run() { @@ -171,7 +171,7 @@ public void run() { /** * Early initializer for Spring's ConversionService. */ - private static class ConversionServiceInitializer implements Runnable { + private static final class ConversionServiceInitializer implements Runnable { @Override public void run() { @@ -180,7 +180,7 @@ public void run() { } - private static class CharsetInitializer implements Runnable { + private static final class CharsetInitializer implements Runnable { @Override public void run() { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cassandra/CassandraAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cassandra/CassandraAutoConfiguration.java index a62f62a364dc..e9ca33565ce8 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cassandra/CassandraAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cassandra/CassandraAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -277,7 +277,7 @@ private List mapContactPoints(CassandraConnectionDetails connectionDetai return connectionDetails.getContactPoints().stream().map((node) -> node.host() + ":" + node.port()).toList(); } - private static class CassandraDriverOptions { + private static final class CassandraDriverOptions { private final Map options = new LinkedHashMap<>(); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionEvaluationReport.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionEvaluationReport.java index cb987b1af3a9..6d9e727e8b3c 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionEvaluationReport.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionEvaluationReport.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -294,7 +294,7 @@ public String toString() { } - private static class AncestorsMatchedCondition implements Condition { + private static final class AncestorsMatchedCondition implements Condition { @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraReactiveRepositoriesRegistrar.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraReactiveRepositoriesRegistrar.java index 176f15121750..d2fa9e593530 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraReactiveRepositoriesRegistrar.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraReactiveRepositoriesRegistrar.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2024 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. @@ -48,7 +48,7 @@ protected RepositoryConfigurationExtension getRepositoryConfigurationExtension() } @EnableReactiveCassandraRepositories - private static class EnableReactiveCassandraRepositoriesConfiguration { + private static final class EnableReactiveCassandraRepositoriesConfiguration { } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraRepositoriesRegistrar.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraRepositoriesRegistrar.java index 4ed0ffbcf484..0f65cf74c182 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraRepositoriesRegistrar.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraRepositoriesRegistrar.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2024 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. @@ -48,7 +48,7 @@ protected RepositoryConfigurationExtension getRepositoryConfigurationExtension() } @EnableCassandraRepositories - private static class EnableCassandraRepositoriesConfiguration { + private static final class EnableCassandraRepositoriesConfiguration { } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/couchbase/CouchbaseReactiveRepositoriesRegistrar.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/couchbase/CouchbaseReactiveRepositoriesRegistrar.java index 9e91a829caf1..60c7672dba32 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/couchbase/CouchbaseReactiveRepositoriesRegistrar.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/couchbase/CouchbaseReactiveRepositoriesRegistrar.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2024 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. @@ -48,7 +48,7 @@ protected RepositoryConfigurationExtension getRepositoryConfigurationExtension() } @EnableReactiveCouchbaseRepositories - private static class EnableReactiveCouchbaseRepositoriesConfiguration { + private static final class EnableReactiveCouchbaseRepositoriesConfiguration { } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/couchbase/CouchbaseRepositoriesRegistrar.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/couchbase/CouchbaseRepositoriesRegistrar.java index 67fbc97c6187..bd8e384359c3 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/couchbase/CouchbaseRepositoriesRegistrar.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/couchbase/CouchbaseRepositoriesRegistrar.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2024 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. @@ -48,7 +48,7 @@ protected RepositoryConfigurationExtension getRepositoryConfigurationExtension() } @EnableCouchbaseRepositories - private static class EnableCouchbaseRepositoriesConfiguration { + private static final class EnableCouchbaseRepositoriesConfiguration { } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchRepositoriesRegistrar.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchRepositoriesRegistrar.java index 9076f8cf2fa3..d45200bb97cc 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchRepositoriesRegistrar.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchRepositoriesRegistrar.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2024 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. @@ -49,7 +49,7 @@ protected RepositoryConfigurationExtension getRepositoryConfigurationExtension() } @EnableElasticsearchRepositories - private static class EnableElasticsearchRepositoriesConfiguration { + private static final class EnableElasticsearchRepositoriesConfiguration { } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/elasticsearch/ReactiveElasticsearchRepositoriesRegistrar.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/elasticsearch/ReactiveElasticsearchRepositoriesRegistrar.java index d76679ee2e9f..152b265d9030 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/elasticsearch/ReactiveElasticsearchRepositoriesRegistrar.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/elasticsearch/ReactiveElasticsearchRepositoriesRegistrar.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2024 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. @@ -48,7 +48,7 @@ protected RepositoryConfigurationExtension getRepositoryConfigurationExtension() } @EnableReactiveElasticsearchRepositories - private static class EnableElasticsearchRepositoriesConfiguration { + private static final class EnableElasticsearchRepositoriesConfiguration { } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/jdbc/JdbcRepositoriesRegistrar.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/jdbc/JdbcRepositoriesRegistrar.java index 587d5851b1a2..cb7ba0a84e23 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/jdbc/JdbcRepositoriesRegistrar.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/jdbc/JdbcRepositoriesRegistrar.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2024 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. @@ -48,7 +48,7 @@ protected RepositoryConfigurationExtension getRepositoryConfigurationExtension() } @EnableJdbcRepositories - private static class EnableJdbcRepositoriesConfiguration { + private static final class EnableJdbcRepositoriesConfiguration { } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/jpa/EnversRevisionRepositoriesRegistrar.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/jpa/EnversRevisionRepositoriesRegistrar.java index e7a96433b6bb..497228765bce 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/jpa/EnversRevisionRepositoriesRegistrar.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/jpa/EnversRevisionRepositoriesRegistrar.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2024 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. @@ -34,7 +34,7 @@ protected Class getConfiguration() { } @EnableJpaRepositories(repositoryFactoryBeanClass = EnversRevisionRepositoryFactoryBean.class) - private static class EnableJpaRepositoriesConfiguration { + private static final class EnableJpaRepositoriesConfiguration { } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/jpa/JpaRepositoriesRegistrar.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/jpa/JpaRepositoriesRegistrar.java index 32f6a1628d54..84efc2c6169f 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/jpa/JpaRepositoriesRegistrar.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/jpa/JpaRepositoriesRegistrar.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2024 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. @@ -74,7 +74,7 @@ private void configureBootstrapMode(Environment environment) { } @EnableJpaRepositories - private static class EnableJpaRepositoriesConfiguration { + private static final class EnableJpaRepositoriesConfiguration { } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/ldap/LdapRepositoriesRegistrar.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/ldap/LdapRepositoriesRegistrar.java index d2679e79f654..8b93214c9231 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/ldap/LdapRepositoriesRegistrar.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/ldap/LdapRepositoriesRegistrar.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2024 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. @@ -48,7 +48,7 @@ protected RepositoryConfigurationExtension getRepositoryConfigurationExtension() } @EnableLdapRepositories - private static class EnableLdapRepositoriesConfiguration { + private static final class EnableLdapRepositoriesConfiguration { } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/mongo/MongoReactiveRepositoriesRegistrar.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/mongo/MongoReactiveRepositoriesRegistrar.java index 6d6c4067da4d..934712e14c52 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/mongo/MongoReactiveRepositoriesRegistrar.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/mongo/MongoReactiveRepositoriesRegistrar.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2024 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. @@ -48,7 +48,7 @@ protected RepositoryConfigurationExtension getRepositoryConfigurationExtension() } @EnableReactiveMongoRepositories - private static class EnableReactiveMongoRepositoriesConfiguration { + private static final class EnableReactiveMongoRepositoriesConfiguration { } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/mongo/MongoRepositoriesRegistrar.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/mongo/MongoRepositoriesRegistrar.java index d2835daff71a..516ccb14de27 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/mongo/MongoRepositoriesRegistrar.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/mongo/MongoRepositoriesRegistrar.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2024 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. @@ -48,7 +48,7 @@ protected RepositoryConfigurationExtension getRepositoryConfigurationExtension() } @EnableMongoRepositories - private static class EnableMongoRepositoriesConfiguration { + private static final class EnableMongoRepositoriesConfiguration { } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/neo4j/Neo4jReactiveRepositoriesRegistrar.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/neo4j/Neo4jReactiveRepositoriesRegistrar.java index e52749df5577..ab2e1b2eaa85 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/neo4j/Neo4jReactiveRepositoriesRegistrar.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/neo4j/Neo4jReactiveRepositoriesRegistrar.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2024 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. @@ -48,7 +48,7 @@ protected RepositoryConfigurationExtension getRepositoryConfigurationExtension() } @EnableReactiveNeo4jRepositories - private static class EnableReactiveNeo4jRepositoriesConfiguration { + private static final class EnableReactiveNeo4jRepositoriesConfiguration { } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/neo4j/Neo4jRepositoriesRegistrar.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/neo4j/Neo4jRepositoriesRegistrar.java index 7009b5bfdb52..b263aae84414 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/neo4j/Neo4jRepositoriesRegistrar.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/neo4j/Neo4jRepositoriesRegistrar.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2024 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. @@ -48,7 +48,7 @@ protected RepositoryConfigurationExtension getRepositoryConfigurationExtension() } @EnableNeo4jRepositories - private static class EnableNeo4jRepositoriesConfiguration { + private static final class EnableNeo4jRepositoriesConfiguration { } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/r2dbc/R2dbcRepositoriesAutoConfigureRegistrar.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/r2dbc/R2dbcRepositoriesAutoConfigureRegistrar.java index 955ee3d317e1..882b88b16e72 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/r2dbc/R2dbcRepositoriesAutoConfigureRegistrar.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/r2dbc/R2dbcRepositoriesAutoConfigureRegistrar.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2024 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. @@ -48,7 +48,7 @@ protected RepositoryConfigurationExtension getRepositoryConfigurationExtension() } @EnableR2dbcRepositories - private static class EnableR2dbcRepositoriesConfiguration { + private static final class EnableR2dbcRepositoriesConfiguration { } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/redis/LettuceConnectionConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/redis/LettuceConnectionConfiguration.java index 0f88d9029684..9fbdcfabee0c 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/redis/LettuceConnectionConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/redis/LettuceConnectionConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -189,7 +189,7 @@ private void customizeConfigurationFromUrl(LettuceClientConfiguration.LettuceCli /** * Inner class to allow optional commons-pool2 dependency. */ - private static class PoolBuilderFactory { + private static final class PoolBuilderFactory { LettuceClientConfigurationBuilder createBuilder(Pool properties) { return LettucePoolingClientConfiguration.builder().poolConfig(getPoolConfig(properties)); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisRepositoriesRegistrar.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisRepositoriesRegistrar.java index da3d6015a0aa..45213adfd119 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisRepositoriesRegistrar.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisRepositoriesRegistrar.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2024 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. @@ -48,7 +48,7 @@ protected RepositoryConfigurationExtension getRepositoryConfigurationExtension() } @EnableRedisRepositories - private static class EnableRedisRepositoriesConfiguration { + private static final class EnableRedisRepositoriesConfiguration { } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/HttpMessageConvertersAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/HttpMessageConvertersAutoConfiguration.java index 766650995da1..7b7e9134b5be 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/HttpMessageConvertersAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/HttpMessageConvertersAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2024 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. @@ -94,7 +94,7 @@ static class NotReactiveWebApplicationCondition extends NoneNestedConditions { } @ConditionalOnWebApplication(type = Type.REACTIVE) - private static class ReactiveWebApplication { + private static final class ReactiveWebApplication { } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfigurationScanRegistrar.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfigurationScanRegistrar.java index b5aa11aa355b..58ed54ca9887 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfigurationScanRegistrar.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfigurationScanRegistrar.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2024 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. @@ -59,7 +59,7 @@ protected Collection getBasePackages(AnnotationAttributes componentScan, } @IntegrationComponentScan - private static class IntegrationComponentScanConfiguration { + private static final class IntegrationComponentScanConfiguration { } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/kafka/KafkaProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/kafka/KafkaProperties.java index 50a2890821bc..cb6869b98666 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/kafka/KafkaProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/kafka/KafkaProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -1607,7 +1607,7 @@ public byte id() { } @SuppressWarnings("serial") - private static class Properties extends HashMap { + private static final class Properties extends HashMap { java.util.function.Consumer in(String key) { return (value) -> put(key, value); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/template/TemplateAvailabilityProviders.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/template/TemplateAvailabilityProviders.java index b787dc413a09..f6e2d678fb04 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/template/TemplateAvailabilityProviders.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/template/TemplateAvailabilityProviders.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2024 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. @@ -153,7 +153,7 @@ private TemplateAvailabilityProvider findProvider(String view, Environment envir return null; } - private static class NoTemplateAvailabilityProvider implements TemplateAvailabilityProvider { + private static final class NoTemplateAvailabilityProvider implements TemplateAvailabilityProvider { @Override public boolean isTemplateAvailable(String view, Environment environment, ClassLoader classLoader, diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/client/RestTemplateAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/client/RestTemplateAutoConfiguration.java index bbefd47fccf4..0986c60bd9b8 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/client/RestTemplateAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/client/RestTemplateAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2024 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. @@ -76,7 +76,7 @@ static class NotReactiveWebApplicationCondition extends NoneNestedConditions { } @ConditionalOnWebApplication(type = Type.REACTIVE) - private static class ReactiveWebApplication { + static class ReactiveWebApplication { } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/AbstractErrorWebExceptionHandler.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/AbstractErrorWebExceptionHandler.java index 11c1bf536cc9..1e8ddc1fd1f0 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/AbstractErrorWebExceptionHandler.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/AbstractErrorWebExceptionHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -352,7 +352,7 @@ private Mono write(ServerWebExchange exchange, ServerResponse re return response.writeTo(exchange, new ResponseContext()); } - private class ResponseContext implements ServerResponse.Context { + private final class ResponseContext implements ServerResponse.Context { @Override public List> messageWriters() { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/DispatcherServletAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/DispatcherServletAutoConfiguration.java index 5575bde20a9c..4e29ba2e0f10 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/DispatcherServletAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/DispatcherServletAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -127,7 +127,7 @@ public DispatcherServletRegistrationBean dispatcherServletRegistration(Dispatche } @Order(Ordered.LOWEST_PRECEDENCE - 10) - private static class DefaultDispatcherServletCondition extends SpringBootCondition { + private static final class DefaultDispatcherServletCondition extends SpringBootCondition { @Override public ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeMetadata metadata) { @@ -154,7 +154,7 @@ public ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeM } @Order(Ordered.LOWEST_PRECEDENCE - 10) - private static class DispatcherServletRegistrationCondition extends SpringBootCondition { + private static final class DispatcherServletRegistrationCondition extends SpringBootCondition { @Override public ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeMetadata metadata) { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/ErrorMvcAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/ErrorMvcAutoConfiguration.java index c28b7dfc79c6..fac3b91d7f8b 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/ErrorMvcAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/ErrorMvcAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -169,7 +169,7 @@ public BeanNameViewResolver beanNameViewResolver() { /** * {@link SpringBootCondition} that matches when no error template view is detected. */ - private static class ErrorTemplateMissingCondition extends SpringBootCondition { + private static final class ErrorTemplateMissingCondition extends SpringBootCondition { @Override public ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeMetadata metadata) { @@ -188,7 +188,7 @@ public ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeM /** * Simple {@link View} implementation that writes a default HTML error page. */ - private static class StaticView implements View { + private static final class StaticView implements View { private static final MediaType TEXT_HTML_UTF8 = new MediaType("text", "html", StandardCharsets.UTF_8); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/websocket/servlet/UndertowWebSocketServletWebServerCustomizer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/websocket/servlet/UndertowWebSocketServletWebServerCustomizer.java index d8b7fdb8c94c..d9826385d758 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/websocket/servlet/UndertowWebSocketServletWebServerCustomizer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/websocket/servlet/UndertowWebSocketServletWebServerCustomizer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2024 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. @@ -44,7 +44,7 @@ public int getOrder() { return 0; } - private static class WebsocketDeploymentInfoCustomizer implements UndertowDeploymentInfoCustomizer { + private static final class WebsocketDeploymentInfoCustomizer implements UndertowDeploymentInfoCustomizer { @Override public void customize(DeploymentInfo deploymentInfo) { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/AutoConfigurationImportSelectorTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/AutoConfigurationImportSelectorTests.java index bd14794b703b..b74a7cb99339 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/AutoConfigurationImportSelectorTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/AutoConfigurationImportSelectorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -216,7 +216,7 @@ private List getAutoConfigurationClassNames() { return ImportCandidates.load(AutoConfiguration.class, getClass().getClassLoader()).getCandidates(); } - private class TestAutoConfigurationImportSelector extends AutoConfigurationImportSelector { + private final class TestAutoConfigurationImportSelector extends AutoConfigurationImportSelector { private AutoConfigurationImportEvent lastEvent; @@ -269,54 +269,54 @@ BeanFactory getBeanFactory() { } @Configuration(proxyBeanMethods = false) - private class TestConfiguration { + private final class TestConfiguration { } @EnableAutoConfiguration - private class BasicEnableAutoConfiguration { + private final class BasicEnableAutoConfiguration { } @EnableAutoConfiguration(exclude = FreeMarkerAutoConfiguration.class) - private class EnableAutoConfigurationWithClassExclusions { + private final class EnableAutoConfigurationWithClassExclusions { } @SpringBootApplication(exclude = FreeMarkerAutoConfiguration.class) - private class SpringBootApplicationWithClassExclusions { + private final class SpringBootApplicationWithClassExclusions { } @EnableAutoConfiguration(excludeName = "org.springframework.boot.autoconfigure.mustache.MustacheAutoConfiguration") - private class EnableAutoConfigurationWithClassNameExclusions { + private final class EnableAutoConfigurationWithClassNameExclusions { } @EnableAutoConfiguration(exclude = MustacheAutoConfiguration.class, excludeName = "org.springframework.boot.autoconfigure.freemarker.FreeMarkerAutoConfiguration") - private class EnableAutoConfigurationWithClassAndClassNameExclusions { + private final class EnableAutoConfigurationWithClassAndClassNameExclusions { } @EnableAutoConfiguration(exclude = TestConfiguration.class) - private class EnableAutoConfigurationWithFaultyClassExclude { + private final class EnableAutoConfigurationWithFaultyClassExclude { } @EnableAutoConfiguration( excludeName = "org.springframework.boot.autoconfigure.AutoConfigurationImportSelectorTests.TestConfiguration") - private class EnableAutoConfigurationWithFaultyClassNameExclude { + private final class EnableAutoConfigurationWithFaultyClassNameExclude { } @EnableAutoConfiguration(excludeName = "org.springframework.boot.autoconfigure.DoesNotExist1") - private class EnableAutoConfigurationWithAbsentClassNameExclude { + private final class EnableAutoConfigurationWithAbsentClassNameExclude { } @SpringBootApplication(excludeName = "org.springframework.boot.autoconfigure.mustache.MustacheAutoConfiguration") - private class SpringBootApplicationWithClassNameExclusions { + private final class SpringBootApplicationWithClassNameExclusions { } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/r2dbc/R2dbcAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/r2dbc/R2dbcAutoConfigurationTests.java index c72df805dc22..9ef8ee88f397 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/r2dbc/R2dbcAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/r2dbc/R2dbcAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -405,7 +405,7 @@ protected Class loadClass(String name, boolean resolve) throws ClassNotFoundE } @Configuration(proxyBeanMethods = false) - private static class CustomizerConfiguration { + private static final class CustomizerConfiguration { @Bean ConnectionFactoryOptionsBuilderCustomizer customizer() { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/task/ScheduledBeanLazyInitializationExcludeFilterTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/task/ScheduledBeanLazyInitializationExcludeFilterTests.java index f53b86497141..3c5a1eddb093 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/task/ScheduledBeanLazyInitializationExcludeFilterTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/task/ScheduledBeanLazyInitializationExcludeFilterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2024 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. @@ -52,7 +52,7 @@ private boolean isExcluded(Class type) { return this.filter.isExcluded("test", new RootBeanDefinition(type), type); } - private static class TestBean { + private static final class TestBean { @Scheduled void doStuff() { @@ -60,7 +60,7 @@ void doStuff() { } - private static class AnotherTestBean { + private static final class AnotherTestBean { @Schedules({ @Scheduled(fixedRate = 5000), @Scheduled(fixedRate = 2500) }) void doStuff() { diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/livereload/LiveReloadServer.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/livereload/LiveReloadServer.java index 773fcabc87fe..d38ff5e72eaa 100644 --- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/livereload/LiveReloadServer.java +++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/livereload/LiveReloadServer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2024 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. @@ -298,7 +298,7 @@ private void runConnection(Connection connection) throws Exception { /** * {@link ThreadFactory} to create the worker threads. */ - private static class WorkerThreadFactory implements ThreadFactory { + private static final class WorkerThreadFactory implements ThreadFactory { private final AtomicInteger threadNumber = new AtomicInteger(1); diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/ClassLoaderFilesResourcePatternResolver.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/ClassLoaderFilesResourcePatternResolver.java index 593dbf35b8d4..4f29bcf58e9a 100644 --- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/ClassLoaderFilesResourcePatternResolver.java +++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/ClassLoaderFilesResourcePatternResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -212,7 +212,7 @@ ResourcePatternResolver getResourcePatternResolver(AbstractApplicationContext ap * {@link ResourcePatternResolverFactory} to be used when the classloader can access * {@link WebApplicationContext}. */ - private static class WebResourcePatternResolverFactory extends ResourcePatternResolverFactory { + private static final class WebResourcePatternResolverFactory extends ResourcePatternResolverFactory { @Override public ResourcePatternResolver getResourcePatternResolver(AbstractApplicationContext applicationContext, diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/RestartScopeInitializer.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/RestartScopeInitializer.java index 3ea95cabb833..668a6bfceaca 100644 --- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/RestartScopeInitializer.java +++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/RestartScopeInitializer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2024 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. @@ -37,7 +37,7 @@ public void initialize(ConfigurableApplicationContext applicationContext) { /** * {@link Scope} that stores beans as {@link Restarter} attributes. */ - private static class RestartScope implements Scope { + private static final class RestartScope implements Scope { @Override public Object get(String name, ObjectFactory objectFactory) { diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/Restarter.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/Restarter.java index 33cf6dc8d42d..071395a21e4e 100644 --- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/Restarter.java +++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/Restarter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -624,7 +624,7 @@ public void run() { /** * {@link ThreadFactory} that creates a leak safe thread. */ - private class LeakSafeThreadFactory implements ThreadFactory { + private final class LeakSafeThreadFactory implements ThreadFactory { @Override public Thread newThread(Runnable runnable) { diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/SilentExitExceptionHandler.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/SilentExitExceptionHandler.java index a2bf9189fb6f..e3437a74f957 100644 --- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/SilentExitExceptionHandler.java +++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/SilentExitExceptionHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2024 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. @@ -92,7 +92,7 @@ static void exitCurrentThread() { throw new SilentExitException(); } - private static class SilentExitException extends RuntimeException { + private static final class SilentExitException extends RuntimeException { } diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/DevToolsR2dbcAutoConfigurationTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/DevToolsR2dbcAutoConfigurationTests.java index 0e9d28f7c884..d06223ce7491 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/DevToolsR2dbcAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/DevToolsR2dbcAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -186,7 +186,7 @@ ConnectionFactory connectionFactoryTwo() { } - private static class MockConnectionFactory implements ConnectionFactory { + private static final class MockConnectionFactory implements ConnectionFactory { @Override public Publisher create() { diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/FileSystemWatcherTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/FileSystemWatcherTests.java index 0e3cdca195a0..b9b4928f5ea2 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/FileSystemWatcherTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/FileSystemWatcherTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -326,7 +326,7 @@ private File touch(File file) throws IOException { return file; } - private static class TestSnapshotStateRepository implements SnapshotStateRepository { + private static final class TestSnapshotStateRepository implements SnapshotStateRepository { private Object state; diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/RestartApplicationListenerTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/RestartApplicationListenerTests.java index 23468ef6dd49..d74166d7d81e 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/RestartApplicationListenerTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/RestartApplicationListenerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -127,7 +127,7 @@ private void testInitialize(boolean failed, RestartApplicationListener listener) } } - private static class ImplicitlyEnabledRestartApplicationListener extends RestartApplicationListener { + private static final class ImplicitlyEnabledRestartApplicationListener extends RestartApplicationListener { @Override boolean implicitlyEnableRestart() { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/utilities/testresttemplate/MySpringBootTestsConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/utilities/testresttemplate/MySpringBootTestsConfiguration.java index 9cbe6f25a551..13625a03569c 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/utilities/testresttemplate/MySpringBootTestsConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/utilities/testresttemplate/MySpringBootTestsConfiguration.java @@ -34,7 +34,7 @@ public class MySpringBootTestsConfiguration { @RestController - private static class ExampleController { + private static final class ExampleController { @RequestMapping("/example") ResponseEntity example() { diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/OverrideAutoConfigurationContextCustomizerFactory.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/OverrideAutoConfigurationContextCustomizerFactory.java index dd62a2d7705e..664e1e035d95 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/OverrideAutoConfigurationContextCustomizerFactory.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/OverrideAutoConfigurationContextCustomizerFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2024 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. @@ -51,7 +51,7 @@ public ContextCustomizer createContextCustomizer(Class testClass, /** * {@link ContextCustomizer} to disable full auto-configuration. */ - private static class DisableAutoConfigurationContextCustomizer implements ContextCustomizer { + private static final class DisableAutoConfigurationContextCustomizer implements ContextCustomizer { @Override public void customizeContext(ConfigurableApplicationContext context, MergedContextConfiguration mergedConfig) { diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/restdocs/RestDocsTestExecutionListener.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/restdocs/RestDocsTestExecutionListener.java index 9d0d7c6f1a52..4a602299b0b3 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/restdocs/RestDocsTestExecutionListener.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/restdocs/RestDocsTestExecutionListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -56,7 +56,7 @@ public void afterTestMethod(TestContext testContext) throws Exception { } } - private static class DocumentationHandler { + private static final class DocumentationHandler { private void beforeTestMethod(TestContext testContext) { ManualRestDocumentation restDocumentation = findManualRestDocumentation(testContext); diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/SpringBootMockMvcBuilderCustomizer.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/SpringBootMockMvcBuilderCustomizer.java index d739a2766b4a..24922c81f211 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/SpringBootMockMvcBuilderCustomizer.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/SpringBootMockMvcBuilderCustomizer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -177,7 +177,7 @@ void write(LinesWriter writer) { writer.write(((Printer) getPrinter()).getLines()); } - private static class Printer implements ResultValuePrinter { + private static final class Printer implements ResultValuePrinter { private final List lines = new ArrayList<>(); @@ -261,7 +261,7 @@ void clear() { /** * {@link LinesWriter} to output results to the log. */ - private static class LoggingLinesWriter implements LinesWriter { + private static final class LoggingLinesWriter implements LinesWriter { private static final Log logger = LogFactory.getLog("org.springframework.test.web.servlet.result"); @@ -318,7 +318,7 @@ protected void addAdaptableBeans(ListableBeanFactory beanFactory) { addAsRegistrationBean(beanFactory, Filter.class, new FilterRegistrationBeanAdapter()); } - private static class FilterRegistrationBeanAdapter implements RegistrationBeanAdapter { + private static final class FilterRegistrationBeanAdapter implements RegistrationBeanAdapter { @Override public RegistrationBean createRegistrationBean(String name, Filter source, int totalNumberOfSourceBeans) { diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringBootContextLoader.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringBootContextLoader.java index 1e673f8f2b49..cb646facf696 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringBootContextLoader.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringBootContextLoader.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -372,7 +372,7 @@ private enum Mode { /** * Inner class to configure {@link WebMergedContextConfiguration}. */ - private static class WebConfigurer { + private static final class WebConfigurer { void configure(MergedContextConfiguration mergedConfig, SpringApplication application, List> initializers) { diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/DuplicateJsonObjectContextCustomizerFactory.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/DuplicateJsonObjectContextCustomizerFactory.java index 785d24f40181..e1b364795e18 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/DuplicateJsonObjectContextCustomizerFactory.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/DuplicateJsonObjectContextCustomizerFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2024 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. @@ -44,7 +44,7 @@ public ContextCustomizer createContextCustomizer(Class testClass, return new DuplicateJsonObjectContextCustomizer(); } - private static class DuplicateJsonObjectContextCustomizer implements ContextCustomizer { + private static final class DuplicateJsonObjectContextCustomizer implements ContextCustomizer { private final Log logger = LogFactory.getLog(DuplicateJsonObjectContextCustomizer.class); diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockitoTestExecutionListener.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockitoTestExecutionListener.java index c2bfbf6e1e49..45712061c92c 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockitoTestExecutionListener.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockitoTestExecutionListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -121,7 +121,7 @@ private void postProcessFields(TestContext testContext, BiConsumer annotations = new LinkedHashSet<>(); diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/TestRestTemplate.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/TestRestTemplate.java index 432bdc85c8fb..02e9215de897 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/TestRestTemplate.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/TestRestTemplate.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -1080,7 +1080,7 @@ protected RequestConfig createRequestConfig() { } - private static class NoOpResponseErrorHandler extends DefaultResponseErrorHandler { + private static final class NoOpResponseErrorHandler extends DefaultResponseErrorHandler { @Override public void handleError(ClientHttpResponse response) throws IOException { diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/SpringBootContextLoaderTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/SpringBootContextLoaderTests.java index 6715719eab48..e314e15d4389 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/SpringBootContextLoaderTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/SpringBootContextLoaderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -446,7 +446,8 @@ final TestContext getExposedTestContext() { } - private static class ContextLoaderApplicationContextFailureProcessor implements ApplicationContextFailureProcessor { + private static final class ContextLoaderApplicationContextFailureProcessor + implements ApplicationContextFailureProcessor { static ApplicationContext failedContext; diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/SpringBootMockResolverTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/SpringBootMockResolverTests.java index ad41efe5cc07..fd9b30ebcd1c 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/SpringBootMockResolverTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/SpringBootMockResolverTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -54,7 +54,7 @@ private interface MyService { } - private static class MyServiceImpl implements MyService { + private static final class MyServiceImpl implements MyService { @Override public int a() { diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/reactive/server/WebTestClientContextCustomizerWithoutWebfluxIntegrationTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/reactive/server/WebTestClientContextCustomizerWithoutWebfluxIntegrationTests.java index 8acb1f7dde6c..7ab2edf0a68f 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/reactive/server/WebTestClientContextCustomizerWithoutWebfluxIntegrationTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/reactive/server/WebTestClientContextCustomizerWithoutWebfluxIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2024 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. @@ -45,7 +45,7 @@ void customizerIsNotCreatedWithoutWebClient() { } @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) - private static class TestClass { + private static final class TestClass { } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/BuildpackLayersMetadata.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/BuildpackLayersMetadata.java index 3b269c04217e..689729fa89c1 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/BuildpackLayersMetadata.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/BuildpackLayersMetadata.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -101,7 +101,7 @@ static BuildpackLayersMetadata fromJson(JsonNode node) { return new BuildpackLayersMetadata(node); } - private static class Buildpacks { + private static final class Buildpacks { private final Map buildpacks = new HashMap<>(); @@ -126,7 +126,7 @@ private static Buildpacks fromJson(JsonNode node) { } - private static class BuildpackVersions { + private static final class BuildpackVersions { private final Map versions = new HashMap<>(); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/Lifecycle.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/Lifecycle.java index a9bf57caee18..133f8e765b18 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/Lifecycle.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/Lifecycle.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -272,7 +272,7 @@ private void deleteVolume(VolumeName name) throws IOException { /** * Common directories used by the various phases. */ - private static class Directory { + private static final class Directory { /** * The directory used by buildpacks to write their layer contributions. A new diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/DockerApi.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/DockerApi.java index 4ee957b5daea..d6c788259ad0 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/DockerApi.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/DockerApi.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -500,7 +500,7 @@ public void delete(VolumeName name, boolean force) throws IOException { /** * {@link UpdateListener} used to capture the image digest. */ - private static class DigestCaptureUpdateListener implements UpdateListener { + private static final class DigestCaptureUpdateListener implements UpdateListener { private static final String PREFIX = "Digest:"; @@ -521,7 +521,7 @@ public void onUpdate(ProgressUpdateEvent event) { /** * {@link UpdateListener} used to ensure an image load response stream. */ - private static class StreamCaptureUpdateListener implements UpdateListener { + private static final class StreamCaptureUpdateListener implements UpdateListener { private String stream; @@ -540,7 +540,7 @@ String getCapturedStream() { * {@link UpdateListener} used to capture the details of an error in a response * stream. */ - private static class ErrorCaptureUpdateListener implements UpdateListener { + private static final class ErrorCaptureUpdateListener implements UpdateListener { @Override public void onUpdate(PushImageUpdateEvent event) { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/transport/LocalHttpClientTransport.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/transport/LocalHttpClientTransport.java index 13241f726c58..81e7c12e9389 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/transport/LocalHttpClientTransport.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/transport/LocalHttpClientTransport.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -93,7 +93,7 @@ private static Registry getRegistry(String host) { /** * {@link DnsResolver} that ensures only the loopback address is used. */ - private static class LocalDnsResolver implements DnsResolver { + private static final class LocalDnsResolver implements DnsResolver { private static final InetAddress LOOPBACK = InetAddress.getLoopbackAddress(); @@ -141,7 +141,7 @@ public Socket connectSocket(TimeValue connectTimeout, Socket socket, HttpHost ho /** * {@link SchemePortResolver} for local Docker. */ - private static class LocalSchemePortResolver implements SchemePortResolver { + private static final class LocalSchemePortResolver implements SchemePortResolver { private static final int DEFAULT_DOCKER_PORT = 2376; diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/socket/DomainSocket.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/socket/DomainSocket.java index 7d885efb5409..0c587f6b5f13 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/socket/DomainSocket.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/socket/DomainSocket.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -157,7 +157,7 @@ private static boolean isBsdPlatform() { /** * {@link InputStream} returned from the {@link DomainSocket}. */ - private class DomainSocketInputStream extends InputStream { + private final class DomainSocketInputStream extends InputStream { @Override public int read() throws IOException { @@ -180,7 +180,7 @@ public int read(byte[] b, int off, int len) throws IOException { /** * {@link OutputStream} returned from the {@link DomainSocket}. */ - private class DomainSocketOutputStream extends OutputStream { + private final class DomainSocketOutputStream extends OutputStream { @Override public void write(int b) throws IOException { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/socket/NamedPipeSocket.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/socket/NamedPipeSocket.java index 0feda07377a5..462b9d4de32f 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/socket/NamedPipeSocket.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/socket/NamedPipeSocket.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -159,7 +159,7 @@ public boolean isOpen() { return this.fileChannel.isOpen(); } - private static class CompletableFutureHandler extends CompletableFuture + private static final class CompletableFutureHandler extends CompletableFuture implements CompletionHandler { @Override @@ -183,7 +183,7 @@ public void failed(Throwable exc, Object attachment) { /** * Waits for the name pipe file using a simple sleep. */ - private static class SleepAwaiter implements Consumer { + private static final class SleepAwaiter implements Consumer { @Override public void accept(String path) { @@ -200,7 +200,7 @@ public void accept(String path) { /** * Waits for the name pipe file using Windows specific logic. */ - private static class WindowsAwaiter implements Consumer { + private static final class WindowsAwaiter implements Consumer { @Override public void accept(String path) { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/options/OptionHandler.java b/spring-boot-project/spring-boot-tools/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/options/OptionHandler.java index 4f018fa78953..e4bab56e08f4 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/options/OptionHandler.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/options/OptionHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -145,7 +145,7 @@ public Collection getOptionsHelp() { return this.optionHelp; } - private static class OptionHelpFormatter implements HelpFormatter { + private static final class OptionHelpFormatter implements HelpFormatter { private final List help = new ArrayList<>(); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/ConstructorParameterPropertyDescriptor.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/ConstructorParameterPropertyDescriptor.java index bc5b57f79b7b..a567a946585f 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/ConstructorParameterPropertyDescriptor.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/ConstructorParameterPropertyDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -101,7 +101,7 @@ private Object coerceValue(TypeMirror type, String value) { return (coercedValue != null) ? coercedValue : value; } - private static class DefaultValueCoercionTypeVisitor extends TypeKindVisitor8 { + private static final class DefaultValueCoercionTypeVisitor extends TypeKindVisitor8 { private static final DefaultValueCoercionTypeVisitor INSTANCE = new DefaultValueCoercionTypeVisitor(); @@ -161,7 +161,7 @@ public Object visitPrimitiveAsDouble(PrimitiveType t, String value) { } - private static class DefaultPrimitiveTypeVisitor extends TypeKindVisitor8 { + private static final class DefaultPrimitiveTypeVisitor extends TypeKindVisitor8 { private static final DefaultPrimitiveTypeVisitor INSTANCE = new DefaultPrimitiveTypeVisitor(); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/fieldvalues/javac/JavaCompilerFieldValuesParser.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/fieldvalues/javac/JavaCompilerFieldValuesParser.java index 7e574f1db331..c14bf74e73f4 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/fieldvalues/javac/JavaCompilerFieldValuesParser.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/fieldvalues/javac/JavaCompilerFieldValuesParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2024 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. @@ -57,7 +57,7 @@ public Map getFieldValues(TypeElement element) throws Exception /** * {@link TreeVisitor} to collect fields. */ - private static class FieldCollector implements TreeVisitor { + private static final class FieldCollector implements TreeVisitor { private static final Map> WRAPPER_TYPES; diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/metadata/JsonConverter.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/metadata/JsonConverter.java index 4c4cfda98ab4..af740a80c24b 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/metadata/JsonConverter.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/metadata/JsonConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -160,7 +160,7 @@ private Object extractItemValue(Object value) { return defaultValue; } - private static class ItemMetadataComparator implements Comparator { + private static final class ItemMetadataComparator implements Comparator { private static final Comparator GROUP = Comparator.comparing(ItemMetadata::getName) .thenComparing(ItemMetadata::getSourceType, Comparator.nullsFirst(Comparator.naturalOrder())); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/fieldvalues/AbstractFieldValuesProcessorTests.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/fieldvalues/AbstractFieldValuesProcessorTests.java index 025c0025adb6..138d7db7502d 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/fieldvalues/AbstractFieldValuesProcessorTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/fieldvalues/AbstractFieldValuesProcessorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -109,7 +109,7 @@ void getFieldValues() throws Exception { @SupportedAnnotationTypes({ "org.springframework.boot.configurationsample.ConfigurationProperties" }) @SupportedSourceVersion(SourceVersion.RELEASE_6) - private class TestProcessor extends AbstractProcessor { + private final class TestProcessor extends AbstractProcessor { private FieldValuesParser processor; diff --git a/spring-boot-project/spring-boot-tools/spring-boot-jarmode-layertools/src/test/java/org/springframework/boot/jarmode/layertools/ExtractCommandTests.java b/spring-boot-project/spring-boot-tools/spring-boot-jarmode-layertools/src/test/java/org/springframework/boot/jarmode/layertools/ExtractCommandTests.java index b8abc1ac3f6c..1ec5a39214bf 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-jarmode-layertools/src/test/java/org/springframework/boot/jarmode/layertools/ExtractCommandTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-jarmode-layertools/src/test/java/org/springframework/boot/jarmode/layertools/ExtractCommandTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -217,7 +217,7 @@ private String getFile(String fileName) throws Exception { return FileCopyUtils.copyToString(reader); } - private static class TestLayers implements Layers { + private static final class TestLayers implements Layers { @Override public Iterator iterator() { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/LogbackInitializer.java b/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/LogbackInitializer.java index e3229edd61a9..826afe8fa4da 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/LogbackInitializer.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/LogbackInitializer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2024 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. @@ -38,7 +38,7 @@ public static void initialize() { } } - private static class Initializer { + private static final class Initializer { void setRootLogLevel() { ILoggerFactory factory = LoggerFactory.getILoggerFactory(); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/MainClassFinder.java b/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/MainClassFinder.java index 9a4709df89bf..638b193bd17e 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/MainClassFinder.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/MainClassFinder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2024 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. @@ -261,7 +261,7 @@ private static ClassDescriptor createClassDescriptor(InputStream inputStream) { } } - private static class ClassEntryComparator implements Comparator { + private static final class ClassEntryComparator implements Comparator { @Override public int compare(JarEntry o1, JarEntry o2) { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/Packager.java b/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/Packager.java index 815e0ee4a935..335a45a6c586 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/Packager.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/Packager.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -551,7 +551,7 @@ private void writeClasspathIndexIfNecessary(Collection paths, Layout lay * An {@link UnpackHandler} that determines that an entry needs to be unpacked if * a library that requires unpacking has a matching entry name. */ - private class PackagedLibrariesUnpackHandler implements UnpackHandler { + private final class PackagedLibrariesUnpackHandler implements UnpackHandler { @Override public boolean requiresUnpack(String name) { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/data/RandomAccessDataFile.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/data/RandomAccessDataFile.java index 06d9abcda51a..fe1fef990e78 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/data/RandomAccessDataFile.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/data/RandomAccessDataFile.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2024 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. @@ -129,7 +129,7 @@ public void close() throws IOException { /** * {@link InputStream} implementation for the {@link RandomAccessDataFile}. */ - private class DataInputStream extends InputStream { + private final class DataInputStream extends InputStream { private int position; diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/jarmode/LauncherJarModeTests.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/jarmode/LauncherJarModeTests.java index 93179bad6fe2..dfd4d671e012 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/jarmode/LauncherJarModeTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/jarmode/LauncherJarModeTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2024 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. @@ -64,7 +64,7 @@ void launchWhenJarModePropertyIsNotAcceptedThrowsException(CapturedOutput out) t assertThat(out).contains("Unsupported jarmode 'idontexist'"); } - private static class TestLauncher extends Launcher { + private static final class TestLauncher extends Launcher { @Override protected String getMainClass() throws Exception { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/start-stop/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/start-stop/src/main/java/org/test/SampleApplication.java index 19b91bac5262..8dc0b3e7c02c 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/start-stop/src/main/java/org/test/SampleApplication.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/start-stop/src/main/java/org/test/SampleApplication.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2024 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. @@ -59,7 +59,7 @@ public interface SpringApplicationAdminMXBean { } - static class SpringApplicationAdmin implements SpringApplicationAdminMXBean { + static final class SpringApplicationAdmin implements SpringApplicationAdminMXBean { private boolean ready; diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/CommandLineBuilder.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/CommandLineBuilder.java index d2a04dd6910d..ba5a45ce8667 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/CommandLineBuilder.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/CommandLineBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -120,7 +120,7 @@ private static File toFile(URL element) { /** * Format System properties. */ - private static class SystemPropertyFormatter { + private static final class SystemPropertyFormatter { static String format(String key, String value) { if (key == null) { 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 4e2ca911c3c9..ed21921e80f2 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 @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -1485,7 +1485,7 @@ public SpringApplication.Running run(String... args) { * {@link SpringApplicationRunListener} to capture {@link Running} application * details. */ - private static class RunListener implements SpringApplicationRunListener, Running { + private static final class RunListener implements SpringApplicationRunListener, Running { private final List contexts = Collections .synchronizedList(new ArrayList<>()); diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplicationShutdownHook.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplicationShutdownHook.java index 1b24d5c0b4e4..b609a9315747 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplicationShutdownHook.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplicationShutdownHook.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -169,7 +169,7 @@ private void assertNotInProgress() { /** * The handler actions for this shutdown hook. */ - private class Handlers implements SpringApplicationShutdownHandlers, Runnable { + private final class Handlers implements SpringApplicationShutdownHandlers, Runnable { private final Set actions = Collections.newSetFromMap(new IdentityHashMap<>()); @@ -207,7 +207,7 @@ public void run() { /** * {@link ApplicationListener} to track closed contexts. */ - private class ApplicationContextClosedListener implements ApplicationListener { + private final class ApplicationContextClosedListener implements ApplicationListener { @Override public void onApplicationEvent(ContextClosedEvent event) { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringBootExceptionHandler.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringBootExceptionHandler.java index 69987c511beb..d7540ad596e9 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringBootExceptionHandler.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringBootExceptionHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2024 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. @@ -117,7 +117,7 @@ static SpringBootExceptionHandler forCurrentThread() { /** * Thread local used to attach and track handlers. */ - private static class LoggedExceptionHandlerThreadLocal extends ThreadLocal { + private static final class LoggedExceptionHandlerThreadLocal extends ThreadLocal { @Override protected SpringBootExceptionHandler initialValue() { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/admin/SpringApplicationAdminMXBeanRegistrar.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/admin/SpringApplicationAdminMXBeanRegistrar.java index 25fe02d57fd8..71ebfd98353f 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/admin/SpringApplicationAdminMXBeanRegistrar.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/admin/SpringApplicationAdminMXBeanRegistrar.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2024 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. @@ -137,7 +137,7 @@ public void destroy() throws Exception { ManagementFactory.getPlatformMBeanServer().unregisterMBean(this.objectName); } - private class SpringApplicationAdmin implements SpringApplicationAdminMXBean { + private final class SpringApplicationAdmin implements SpringApplicationAdminMXBean { @Override public boolean isReady() { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/builder/ParentContextApplicationContextInitializer.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/builder/ParentContextApplicationContextInitializer.java index e0e0ed91aa38..1c843b5d649c 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/builder/ParentContextApplicationContextInitializer.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/builder/ParentContextApplicationContextInitializer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2024 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. @@ -60,7 +60,7 @@ public void initialize(ConfigurableApplicationContext applicationContext) { } } - private static class EventPublisher implements ApplicationListener, Ordered { + private static final class EventPublisher implements ApplicationListener, Ordered { private static final EventPublisher INSTANCE = new EventPublisher(); diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/event/EventPublishingRunListener.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/event/EventPublishingRunListener.java index f73bf8386654..e84c0a7a4465 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/event/EventPublishingRunListener.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/event/EventPublishingRunListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -140,7 +140,7 @@ private void refreshApplicationListeners() { this.application.getListeners().forEach(this.initialMulticaster::addApplicationListener); } - private static class LoggingErrorHandler implements ErrorHandler { + private static final class LoggingErrorHandler implements ErrorHandler { private static final Log logger = LogFactory.getLog(EventPublishingRunListener.class); diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/logging/LoggingApplicationListener.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/logging/LoggingApplicationListener.java index 2de4b2534d1d..81e8d9afd0ba 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/logging/LoggingApplicationListener.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/logging/LoggingApplicationListener.java @@ -457,7 +457,7 @@ public void setParseArgs(boolean parseArgs) { this.parseArgs = parseArgs; } - private class Lifecycle implements SmartLifecycle { + private final class Lifecycle implements SmartLifecycle { private volatile boolean running; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindableRuntimeHintsRegistrar.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindableRuntimeHintsRegistrar.java index c2ce25d84290..07e4f8299bdf 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindableRuntimeHintsRegistrar.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindableRuntimeHintsRegistrar.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -341,7 +341,7 @@ private boolean isJavaType(Class candidate) { /** * Inner class to avoid a hard dependency on Kotlin at runtime. */ - private static class KotlinDelegate { + private static final class KotlinDelegate { static void handleConstructor(ReflectionHints hints, Constructor constructor) { KClass kClass = JvmClassMappingKt.getKotlinClass(constructor.getDeclaringClass()); diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/env/OriginTrackedYamlLoader.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/env/OriginTrackedYamlLoader.java index 5660f46a4a99..0eef7864dae1 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/env/OriginTrackedYamlLoader.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/env/OriginTrackedYamlLoader.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -169,7 +169,7 @@ private static Node get(Node node) { /** * {@link Resolver} that limits {@link Tag#TIMESTAMP} tags. */ - private static class NoTimestampResolver extends Resolver { + private static final class NoTimestampResolver extends Resolver { @Override public void addImplicitResolver(Tag tag, Pattern regexp, String first, int limit) { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jdbc/DataSourceUnwrapper.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jdbc/DataSourceUnwrapper.java index 39c839220a3c..1dcd4fd37f91 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jdbc/DataSourceUnwrapper.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jdbc/DataSourceUnwrapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2024 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. @@ -102,7 +102,7 @@ private static S safeUnwrap(Wrapper wrapper, Class target) { return null; } - private static class DelegatingDataSourceUnwrapper { + private static final class DelegatingDataSourceUnwrapper { private static DataSource getTargetDataSource(DataSource dataSource) { if (dataSource instanceof DelegatingDataSource delegatingDataSource) { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jdbc/EmbeddedDatabaseConnection.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jdbc/EmbeddedDatabaseConnection.java index 35b9fc1ff542..21f7fac9868c 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jdbc/EmbeddedDatabaseConnection.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jdbc/EmbeddedDatabaseConnection.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -191,7 +191,7 @@ public static EmbeddedDatabaseConnection get(ClassLoader classLoader) { /** * {@link ConnectionCallback} to determine if a connection is embedded. */ - private static class IsEmbedded implements ConnectionCallback { + private static final class IsEmbedded implements ConnectionCallback { @Override public Boolean doInConnection(Connection connection) throws SQLException, DataAccessException { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/json/JacksonJsonParser.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/json/JacksonJsonParser.java index 97a14c10c214..7d3f7f3cb447 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/json/JacksonJsonParser.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/json/JacksonJsonParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2024 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. @@ -68,11 +68,11 @@ private ObjectMapper getObjectMapper() { return this.objectMapper; } - private static class MapTypeReference extends TypeReference> { + private static final class MapTypeReference extends TypeReference> { } - private static class ListTypeReference extends TypeReference> { + private static final class ListTypeReference extends TypeReference> { } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/util/LambdaSafe.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/util/LambdaSafe.java index 21ec25238cd5..5f030ad6f799 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/util/LambdaSafe.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/util/LambdaSafe.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -342,7 +342,7 @@ static Filter allowAll() { * {@link Filter} that matches when the callback has a single generic and primary * argument is an instance of it. */ - private static class GenericTypeFilter implements Filter { + private static final class GenericTypeFilter implements Filter { @Override public boolean match(Class callbackType, C callbackInstance, A argument, Object[] additionalArguments) { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/JasperInitializer.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/JasperInitializer.java index 74b6b5a7561a..db5185247bd2 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/JasperInitializer.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/JasperInitializer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -108,7 +108,7 @@ private void setExtendedListenerTypes(boolean extended) { /** * {@link URLStreamHandlerFactory} to support {@literal war} protocol. */ - private static class WarUrlStreamHandlerFactory implements URLStreamHandlerFactory { + private static final class WarUrlStreamHandlerFactory implements URLStreamHandlerFactory { @Override public URLStreamHandler createURLStreamHandler(String protocol) { @@ -125,7 +125,7 @@ public URLStreamHandler createURLStreamHandler(String protocol) { * {@link URL urls} produced by * {@link org.apache.tomcat.util.scan.JarFactory#getJarEntryURL(URL, String)}. */ - private static class WarUrlStreamHandler extends URLStreamHandler { + private static final class WarUrlStreamHandler extends URLStreamHandler { @Override protected void parseURL(URL u, String spec, int start, int limit) { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/JettyEmbeddedWebAppContext.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/JettyEmbeddedWebAppContext.java index 000c0acd79cb..233105263857 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/JettyEmbeddedWebAppContext.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/JettyEmbeddedWebAppContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2024 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. @@ -36,7 +36,7 @@ void deferredInitialize() throws Exception { ((JettyEmbeddedServletHandler) getServletHandler()).deferredInitialize(); } - private static class JettyEmbeddedServletHandler extends ServletHandler { + private static final class JettyEmbeddedServletHandler extends ServletHandler { @Override public void initialize() throws Exception { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatServletWebServerFactory.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatServletWebServerFactory.java index d5853b6f14f5..d244d200526c 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatServletWebServerFactory.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatServletWebServerFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -758,7 +758,7 @@ public void setDisableMBeanRegistry(boolean disableMBeanRegistry) { * {@link LifecycleListener} is used so not to interfere with Tomcat's default manager * creation logic. */ - private static class DisablePersistSessionListener implements LifecycleListener { + private static final class DisablePersistSessionListener implements LifecycleListener { @Override public void lifecycleEvent(LifecycleEvent event) { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletContextInitializerBeans.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletContextInitializerBeans.java index 157963fac1f5..7a5c24cc1d31 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletContextInitializerBeans.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletContextInitializerBeans.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -285,7 +285,7 @@ public RegistrationBean createRegistrationBean(String name, Servlet source, int /** * {@link RegistrationBeanAdapter} for {@link Filter} beans. */ - private static class FilterRegistrationBeanAdapter implements RegistrationBeanAdapter { + private static final class FilterRegistrationBeanAdapter implements RegistrationBeanAdapter { @Override public RegistrationBean createRegistrationBean(String name, Filter source, int totalNumberOfSourceBeans) { @@ -299,7 +299,8 @@ public RegistrationBean createRegistrationBean(String name, Filter source, int t /** * {@link RegistrationBeanAdapter} for certain {@link EventListener} beans. */ - private static class ServletListenerRegistrationBeanAdapter implements RegistrationBeanAdapter { + private static final class ServletListenerRegistrationBeanAdapter + implements RegistrationBeanAdapter { @Override public RegistrationBean createRegistrationBean(String name, EventListener source, diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/DefaultBootstrapContextTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/DefaultBootstrapContextTests.java index 8b3854907662..44cf908ade0a 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/DefaultBootstrapContextTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/DefaultBootstrapContextTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -275,7 +275,7 @@ void instanceSupplierWithScopeChangesScope() { assertThat(supplier.get(null)).isEqualTo("test"); } - private static class TestCloseListener + private static final class TestCloseListener implements ApplicationListener, AssertProvider { private int called; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/config/InactiveConfigDataAccessExceptionTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/config/InactiveConfigDataAccessExceptionTests.java index 7071e437c791..7209c7f8d822 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/config/InactiveConfigDataAccessExceptionTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/config/InactiveConfigDataAccessExceptionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -129,7 +129,7 @@ void throwIfPropertyFoundWhenPropertyFoundThrowsException() { + "cannot contain property 'spring' [origin: \"spring\" from property source \"mockProperties\"]"); } - private static class TestConfigDataResource extends ConfigDataResource { + private static final class TestConfigDataResource extends ConfigDataResource { @Override public String toString() { diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/config/InvalidConfigDataPropertyExceptionTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/config/InvalidConfigDataPropertyExceptionTests.java index d9961b02b8bb..4c198709f06f 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/config/InvalidConfigDataPropertyExceptionTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/config/InvalidConfigDataPropertyExceptionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -149,7 +149,7 @@ void throwOrWarnWhenHasNoInvalidPropertyDoesNothing() { InvalidConfigDataPropertyException.throwIfPropertyFound(contributor); } - private static class TestConfigDataResource extends ConfigDataResource { + private static final class TestConfigDataResource extends ConfigDataResource { @Override public String toString() { diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConversionServiceDeducerTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConversionServiceDeducerTests.java index 30286fe950b5..1e4213830ebd 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConversionServiceDeducerTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConversionServiceDeducerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2024 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. @@ -105,11 +105,11 @@ TestConverter testConverter() { } - private static class TestApplicationConversionService extends ApplicationConversionService { + private static final class TestApplicationConversionService extends ApplicationConversionService { } - private static class TestConverter implements Converter { + private static final class TestConverter implements Converter { @Override public OutputStream convert(InputStream source) { diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/source/MockConfigurationPropertySource.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/source/MockConfigurationPropertySource.java index 976630b3f62b..b803071b7d2f 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/source/MockConfigurationPropertySource.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/source/MockConfigurationPropertySource.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2024 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. @@ -94,7 +94,7 @@ private OriginTrackedValue findValue(ConfigurationPropertyName name) { return this.map.get(name); } - private class NonIterable implements ConfigurationPropertySource { + private final class NonIterable implements ConfigurationPropertySource { @Override public Object getUnderlyingSource() { diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/security/servlet/ApplicationContextRequestMatcherTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/security/servlet/ApplicationContextRequestMatcherTests.java index 7773b6dbc0e3..cb028295eed0 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/security/servlet/ApplicationContextRequestMatcherTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/security/servlet/ApplicationContextRequestMatcherTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -217,7 +217,7 @@ protected boolean matches(HttpServletRequest request, Supplier context) } - private static class AssertingUncaughtExceptionHandler implements UncaughtExceptionHandler { + private static final class AssertingUncaughtExceptionHandler implements UncaughtExceptionHandler { private volatile Throwable ex; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/jetty/JettyServletWebServerFactoryTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/jetty/JettyServletWebServerFactoryTests.java index 63fe24022315..3f5d33d8c1ba 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/jetty/JettyServletWebServerFactoryTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/jetty/JettyServletWebServerFactoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -532,7 +532,7 @@ private WebAppContext findWebAppContext(Handler handler) { throw new IllegalStateException("No WebAppContext found"); } - private static class CustomErrorHandler extends ErrorPageErrorHandler { + private static final class CustomErrorHandler extends ErrorPageErrorHandler { } diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactoryTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactoryTests.java index 8cf70b35bc1f..0cb29be33cf5 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactoryTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -1570,7 +1570,7 @@ private void loadStore(KeyStore keyStore, Resource resource) } } - private class TestGzipInputStreamFactory implements InputStreamFactory { + private final class TestGzipInputStreamFactory implements InputStreamFactory { private final AtomicBoolean requested = new AtomicBoolean(); diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/support/SpringBootServletInitializerTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/support/SpringBootServletInitializerTests.java index add6f2cc058d..60dc447cfe6e 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/support/SpringBootServletInitializerTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/support/SpringBootServletInitializerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -252,7 +252,7 @@ protected WebApplicationContext run(SpringApplication application) { } - private class CustomSpringBootServletInitializer extends MockSpringBootServletInitializer { + private final class CustomSpringBootServletInitializer extends MockSpringBootServletInitializer { private final CustomSpringApplicationBuilder applicationBuilder = new CustomSpringApplicationBuilder(); diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-integration/src/main/java/smoketest/integration/SampleIntegrationApplication.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-integration/src/main/java/smoketest/integration/SampleIntegrationApplication.java index 6b69bf1a522a..adc012a29515 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-integration/src/main/java/smoketest/integration/SampleIntegrationApplication.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-integration/src/main/java/smoketest/integration/SampleIntegrationApplication.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -75,7 +75,7 @@ public static void main(String[] args) { SpringApplication.run(SampleIntegrationApplication.class, args); } - private static class FixedRatePoller implements Consumer { + private static final class FixedRatePoller implements Consumer { @Override public void accept(SourcePollingChannelAdapterSpec spec) { diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-parent-context/src/main/java/smoketest/parent/SampleParentContextApplication.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-parent-context/src/main/java/smoketest/parent/SampleParentContextApplication.java index fa3eeefcc079..6557d6a03788 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-parent-context/src/main/java/smoketest/parent/SampleParentContextApplication.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-parent-context/src/main/java/smoketest/parent/SampleParentContextApplication.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -81,7 +81,7 @@ public IntegrationFlow integrationFlow(SampleEndpoint endpoint) { .get(); } - private static class FixedRatePoller implements Consumer { + private static final class FixedRatePoller implements Consumer { @Override public void accept(SourcePollingChannelAdapterSpec spec) { diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-mustache/src/main/java/smoketest/mustache/WelcomeController.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-mustache/src/main/java/smoketest/mustache/WelcomeController.java index f9043ac5d04e..ec0af5c71301 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-mustache/src/main/java/smoketest/mustache/WelcomeController.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-mustache/src/main/java/smoketest/mustache/WelcomeController.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2024 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. @@ -55,12 +55,12 @@ public String insufficientStorage() { } @ResponseStatus(HttpStatus.SERVICE_UNAVAILABLE) - private static class ServiceUnavailableException extends RuntimeException { + private static final class ServiceUnavailableException extends RuntimeException { } @ResponseStatus(HttpStatus.INSUFFICIENT_STORAGE) - private static class InsufficientStorageException extends RuntimeException { + private static final class InsufficientStorageException extends RuntimeException { }