diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle
index 412478465c9..5d9fe4c4b8c 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 6f13a5fbbac..9b30230ebe0 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 @@ class JavaConventions {
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 54a9e10dba5..d463a4fc18f 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 @@ class SkipSslVerificationHttpRequestFactory extends SimpleClientHttpRequestFacto
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 @@ class SkipSslVerificationHttpRequestFactory extends SimpleClientHttpRequestFacto
}
- 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 25700cda502..c3e88935d58 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 class LogFileWebEndpointAutoConfiguration {
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 fdb018f2276..7bd894f08a0 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 class JerseyServerMetricsAutoConfiguration {
/**
* 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 2317c4269b7..b8a63d0c4cc 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 @@ public final class EndpointRequest {
/**
* 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 e4eeaedbd9b..e6a689d0c48 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 @@ class CloudFoundryReactiveHealthEndpointWebExtensionTests {
});
}
- 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 f113a01ccff..6b4331d8540 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 @@ class CloudFoundryHealthEndpointWebExtensionTests {
});
}
- 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 8d47a690cbe..a001d686991 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 @@ class HealthEndpointDocumentationTests extends MockMvcEndpointDocumentationTests
}
- 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 f4a818f8c47..5d9c1d3466a 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 @@ class ObservationAutoConfigurationTests {
}
- 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 12ffa4d1cae..8ffcd64f4b2 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 @@ class ObservationRegistryConfigurerIntegrationTests {
}
- 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 62336cb379c..e882188eea6 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 @@ class BraveAutoConfigurationTests {
}
@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 6f3c4a373d0..bfef8cccd53 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 @@ class MicrometerTracingAutoConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
- private static class TracerConfiguration {
+ private static final class TracerConfiguration {
@Bean
Tracer tracer() {
@@ -133,7 +133,7 @@ class MicrometerTracingAutoConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
- private static class PropagatorConfiguration {
+ private static final class PropagatorConfiguration {
@Bean
Propagator propagator() {
@@ -143,7 +143,7 @@ class MicrometerTracingAutoConfigurationTests {
}
@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 8918f52ab53..8861c0ef208 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 @@ class OpenTelemetryAutoConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
- private static class CustomConfiguration {
+ private static final class CustomConfiguration {
@Bean
io.micrometer.tracing.Tracer customMicrometerTracer() {
@@ -343,7 +343,7 @@ class OpenTelemetryAutoConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
- private static class SdkTracerProviderCustomizationConfiguration {
+ private static final class SdkTracerProviderCustomizationConfiguration {
@Bean
@Order(1)
@@ -366,7 +366,7 @@ class OpenTelemetryAutoConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
- private static class InMemoryRecordingSpanExporterConfiguration {
+ private static final class InMemoryRecordingSpanExporterConfiguration {
@Bean
InMemoryRecordingSpanExporter spanExporter() {
@@ -375,7 +375,7 @@ class OpenTelemetryAutoConfigurationTests {
}
- 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 5d75c06b511..b46b6ba153d 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 @@ class OtlpAutoConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
- private static class CustomHttpExporterConfiguration {
+ private static final class CustomHttpExporterConfiguration {
@Bean
OtlpHttpSpanExporter customOtlpHttpSpanExporter() {
@@ -100,7 +100,7 @@ class OtlpAutoConfigurationTests {
}
@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 2d2f9d35a53..e0b5c51f91b 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 @@ class PrometheusExemplarsAutoConfigurationTests {
}
@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 a75d692772e..6f9f85069d2 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 @@ class WavefrontTracingAutoConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
- private static class CustomConfiguration {
+ private static final class CustomConfiguration {
@Bean
ApplicationTags customApplicationTags() {
@@ -203,7 +203,7 @@ class WavefrontTracingAutoConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
- private static class WavefrontSenderConfiguration {
+ private static final class WavefrontSenderConfiguration {
@Bean
WavefrontSender wavefrontSender() {
@@ -213,7 +213,7 @@ class WavefrontTracingAutoConfigurationTests {
}
@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 c647bfbfe2a..6453d24137d 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 @@ class ZipkinAutoConfigurationTests {
}
@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 735cd00d0c6..ba3c26c1f91 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 @@ class ZipkinConfigurationsBraveConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
- private static class ReporterConfiguration {
+ private static final class ReporterConfiguration {
@Bean
@SuppressWarnings("unchecked")
@@ -91,7 +91,7 @@ class ZipkinConfigurationsBraveConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
- private static class CustomConfiguration {
+ private static final class CustomConfiguration {
@Bean
@SuppressWarnings("unchecked")
@@ -102,7 +102,7 @@ class ZipkinConfigurationsBraveConfigurationTests {
}
@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 c3ef5f99c37..27fd9be141d 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 @@ class ZipkinConfigurationsOpenTelemetryConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
- private static class SenderConfiguration {
+ private static final class SenderConfiguration {
@Bean
Sender sender() {
@@ -81,7 +81,7 @@ class ZipkinConfigurationsOpenTelemetryConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
- private static class CustomConfiguration {
+ private static final class CustomConfiguration {
@Bean
ZipkinSpanExporter customZipkinSpanExporter() {
@@ -91,7 +91,7 @@ class ZipkinConfigurationsOpenTelemetryConfigurationTests {
}
@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 b09805215d6..45a9f3f1d22 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 @@ class ZipkinConfigurationsReporterConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
- private static class SenderConfiguration {
+ private static final class SenderConfiguration {
@Bean
Sender sender() {
@@ -74,7 +74,7 @@ class ZipkinConfigurationsReporterConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
- private static class CustomConfiguration {
+ private static final class CustomConfiguration {
@Bean
@SuppressWarnings("unchecked")
@@ -85,7 +85,7 @@ class ZipkinConfigurationsReporterConfigurationTests {
}
@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 3dfeeb37af5..9b98d24710a 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 @@ class ZipkinConfigurationsSenderConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
- private static class RestTemplateConfiguration {
+ private static final class RestTemplateConfiguration {
@Bean
ZipkinRestTemplateBuilderCustomizer zipkinRestTemplateBuilderCustomizer() {
@@ -183,7 +183,7 @@ class ZipkinConfigurationsSenderConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
- private static class WebClientConfiguration {
+ private static final class WebClientConfiguration {
@Bean
ZipkinWebClientBuilderCustomizer webClientBuilder() {
@@ -193,7 +193,7 @@ class ZipkinConfigurationsSenderConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
- private static class CustomConfiguration {
+ private static final class CustomConfiguration {
@Bean
Sender customSender() {
@@ -202,7 +202,7 @@ class ZipkinConfigurationsSenderConfigurationTests {
}
- 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 1e03b58419e..49389aebb26 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 @@ public class ConfigurationPropertiesReportEndpoint implements ApplicationContext
* 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 class ConfigurationPropertiesReportEndpoint implements ApplicationContext
* 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 41e8eeb4d26..a4fa71ebe62 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 @@ class OperationMethodParameter implements OperationParameter {
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 fc6a95ad1f7..845e9707c7e 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 class EndpointMBean implements DynamicMBean {
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 95a5024731b..e9f30aff62b 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 @@ class DiscoveredJmxOperation extends AbstractDiscoveredOperation implements JmxO
/**
* 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 9be3223ee6d..8f1afcc02e0 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 @@ public abstract class AbstractWebMvcEndpointHandlerMapping extends RequestMappin
return body;
}
- private static class FluxBodyConverter implements Function