Skip to content

Commit 7087897

Browse files
committed
Merge branch '3.1.x' into 3.2.x
Closes gh-39091
2 parents d3b93f5 + 45c3285 commit 7087897

File tree

150 files changed

+358
-353
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+358
-353
lines changed

buildSrc/build.gradle

+6-5
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,13 @@ if (versions.springFramework.contains("-")) {
3131
}
3232
}
3333

34+
checkstyle {
35+
toolVersion = "10.12.4"
36+
}
37+
3438
dependencies {
35-
checkstyle "io.spring.javaformat:spring-javaformat-checkstyle:${javaFormatVersion}"
39+
checkstyle("com.puppycrawl.tools:checkstyle:${checkstyle.toolVersion}")
40+
checkstyle("io.spring.javaformat:spring-javaformat-checkstyle:${javaFormatVersion}")
3641

3742
implementation(platform("org.springframework:spring-framework-bom:${versions.springFramework}"))
3843
implementation("com.diffplug.gradle:goomph:3.37.2")
@@ -58,10 +63,6 @@ dependencies {
5863
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
5964
}
6065

61-
checkstyle {
62-
toolVersion = "10.12.4"
63-
}
64-
6566
gradlePlugin {
6667
plugins {
6768
annotationProcessorPlugin {

buildSrc/src/main/java/org/springframework/boot/build/JavaConventions.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -243,6 +243,8 @@ private void configureSpringJavaFormat(Project project) {
243243
checkstyle.getConfigDirectory().set(project.getRootProject().file("src/checkstyle"));
244244
String version = SpringJavaFormatPlugin.class.getPackage().getImplementationVersion();
245245
DependencySet checkstyleDependencies = project.getConfigurations().getByName("checkstyle").getDependencies();
246+
checkstyleDependencies
247+
.add(project.getDependencies().create("com.puppycrawl.tools:checkstyle:" + checkstyle.getToolVersion()));
246248
checkstyleDependencies
247249
.add(project.getDependencies().create("io.spring.javaformat:spring-javaformat-checkstyle:" + version));
248250
}

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/SkipSslVerificationHttpRequestFactory.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2022 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -62,7 +62,7 @@ private SSLSocketFactory createSslSocketFactory() throws Exception {
6262
return context.getSocketFactory();
6363
}
6464

65-
private static class SkipHostnameVerifier implements HostnameVerifier {
65+
private static final class SkipHostnameVerifier implements HostnameVerifier {
6666

6767
@Override
6868
public boolean verify(String s, SSLSession sslSession) {
@@ -71,7 +71,7 @@ public boolean verify(String s, SSLSession sslSession) {
7171

7272
}
7373

74-
private static class SkipX509TrustManager implements X509TrustManager {
74+
private static final class SkipX509TrustManager implements X509TrustManager {
7575

7676
@Override
7777
public X509Certificate[] getAcceptedIssuers() {

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/logging/LogFileWebEndpointAutoConfiguration.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2022 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -54,7 +54,7 @@ public LogFileWebEndpoint logFileWebEndpoint(ObjectProvider<LogFile> logFile,
5454
return new LogFileWebEndpoint(logFile.getIfAvailable(), properties.getExternalFile());
5555
}
5656

57-
private static class LogFileCondition extends SpringBootCondition {
57+
private static final class LogFileCondition extends SpringBootCondition {
5858

5959
@Override
6060
public ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeMetadata metadata) {

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/jersey/JerseyServerMetricsAutoConfiguration.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -92,7 +92,7 @@ public MeterFilter jerseyMetricsUriTagFilter(MetricsProperties metricsProperties
9292
/**
9393
* An {@link AnnotationFinder} that uses {@link AnnotationUtils}.
9494
*/
95-
private static class AnnotationUtilsAnnotationFinder implements AnnotationFinder {
95+
private static final class AnnotationUtilsAnnotationFinder implements AnnotationFinder {
9696

9797
@Override
9898
public <A extends Annotation> A findAnnotation(AnnotatedElement annotatedElement, Class<A> annotationType) {

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/servlet/EndpointRequest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -311,7 +311,7 @@ protected RequestMatcher createDelegate(WebApplicationContext context,
311311
/**
312312
* Factory used to create a {@link RequestMatcher}.
313313
*/
314-
private static class RequestMatcherFactory {
314+
private static final class RequestMatcherFactory {
315315

316316
RequestMatcher antPath(RequestMatcherProvider matcherProvider, String... parts) {
317317
StringBuilder pattern = new StringBuilder();

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/CloudFoundryReactiveHealthEndpointWebExtensionTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -75,7 +75,7 @@ void healthComponentsAlwaysPresent() {
7575
});
7676
}
7777

78-
private static class TestHealthIndicator implements HealthIndicator {
78+
private static final class TestHealthIndicator implements HealthIndicator {
7979

8080
@Override
8181
public Health health() {

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryHealthEndpointWebExtensionTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -70,7 +70,7 @@ void healthComponentsAlwaysPresent() {
7070
});
7171
}
7272

73-
private static class TestHealthIndicator implements HealthIndicator {
73+
private static final class TestHealthIndicator implements HealthIndicator {
7474

7575
@Override
7676
public Health health() {

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/HealthEndpointDocumentationTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -138,7 +138,7 @@ CompositeHealthContributor brokerHealthContributor() {
138138

139139
}
140140

141-
private static class TestHealthEndpointGroup implements HealthEndpointGroup {
141+
private static final class TestHealthEndpointGroup implements HealthEndpointGroup {
142142

143143
private final StatusAggregator statusAggregator = new SimpleStatusAggregator();
144144

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/observation/ObservationAutoConfigurationTests.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -561,11 +561,11 @@ public boolean supportsContext(Context context) {
561561

562562
}
563563

564-
private static class CustomContext extends Context {
564+
private static final class CustomContext extends Context {
565565

566566
}
567567

568-
private static class CalledHandlers {
568+
private static final class CalledHandlers {
569569

570570
private final List<ObservationHandler<?>> calledHandlers = new ArrayList<>();
571571

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/observation/ObservationRegistryConfigurerIntegrationTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -74,7 +74,7 @@ Customizer2 customizer2(CalledCustomizers calledCustomizers) {
7474

7575
}
7676

77-
private static class CalledCustomizers {
77+
private static final class CalledCustomizers {
7878

7979
private final List<ObservationRegistryCustomizer<?>> customizers = new ArrayList<>();
8080

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/opentelemetry/OpenTelemetryAutoConfigurationTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ void shouldRegisterSdkMeterProviderIfAvailable() {
140140
}
141141

142142
@Configuration(proxyBeanMethods = false)
143-
private static class UserConfiguration {
143+
private static final class UserConfiguration {
144144

145145
@Bean
146146
OpenTelemetry customOpenTelemetry() {

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/opentelemetry/OpenTelemetryPropertiesTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ void shouldNotDependOnOpenTelemetrySdk() {
4848

4949
@Configuration(proxyBeanMethods = false)
5050
@EnableConfigurationProperties(OpenTelemetryProperties.class)
51-
private static class TestConfiguration {
51+
private static final class TestConfiguration {
5252

5353
}
5454

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/r2dbc/R2dbcObservationAutoConfigurationTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ private static CapturingObservationHandler registerCapturingObservationHandler(
108108
return handler;
109109
}
110110

111-
private static class CapturingObservationHandler implements ObservationHandler<Context> {
111+
private static final class CapturingObservationHandler implements ObservationHandler<Context> {
112112

113113
private final AtomicReference<Context> context = new AtomicReference<>();
114114

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/BraveAutoConfigurationTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -443,7 +443,7 @@ static class AdditionalSpanHandler extends SpanHandler {
443443
}
444444

445445
@Configuration(proxyBeanMethods = false)
446-
private static class CustomConfiguration {
446+
private static final class CustomConfiguration {
447447

448448
@Bean
449449
Tracing customTracing() {

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/MicrometerTracingAutoConfigurationTests.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -162,7 +162,7 @@ void shouldConfigureSpanTagAnnotationHandler() {
162162
}
163163

164164
@Configuration(proxyBeanMethods = false)
165-
private static class TracerConfiguration {
165+
private static final class TracerConfiguration {
166166

167167
@Bean
168168
Tracer tracer() {
@@ -172,7 +172,7 @@ Tracer tracer() {
172172
}
173173

174174
@Configuration(proxyBeanMethods = false)
175-
private static class PropagatorConfiguration {
175+
private static final class PropagatorConfiguration {
176176

177177
@Bean
178178
Propagator propagator() {
@@ -182,7 +182,7 @@ Propagator propagator() {
182182
}
183183

184184
@Configuration(proxyBeanMethods = false)
185-
private static class CustomConfiguration {
185+
private static final class CustomConfiguration {
186186

187187
@Bean
188188
DefaultTracingObservationHandler customDefaultTracingObservationHandler() {
@@ -218,7 +218,7 @@ SpanAspect customSpanAspect(MethodInvocationProcessor methodInvocationProcessor)
218218
}
219219

220220
@Configuration(proxyBeanMethods = false)
221-
private static class SpanTagAnnotationHandlerConfiguration {
221+
private static final class SpanTagAnnotationHandlerConfiguration {
222222

223223
@Bean
224224
SpanTagAnnotationHandler spanTagAnnotationHandler() {

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/NoopTracerAutoConfigurationTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ void shouldBackOffIfMicrometerTracingIsMissing() {
6565
}
6666

6767
@Configuration(proxyBeanMethods = false)
68-
private static class CustomTracerConfiguration {
68+
private static final class CustomTracerConfiguration {
6969

7070
@Bean
7171
Tracer customTracer() {

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/OpenTelemetryAutoConfigurationTests.java

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -309,7 +309,7 @@ private List<TextMapPropagator> getInjectors(TextMapPropagator propagator) {
309309
}
310310

311311
@Configuration(proxyBeanMethods = false)
312-
private static class MeterProviderConfiguration {
312+
private static final class MeterProviderConfiguration {
313313

314314
@Bean
315315
MeterProvider meterProvider() {
@@ -322,7 +322,7 @@ MeterProvider meterProvider() {
322322
}
323323

324324
@Configuration(proxyBeanMethods = false)
325-
private static class AdditionalSpanProcessorConfiguration {
325+
private static final class AdditionalSpanProcessorConfiguration {
326326

327327
@Bean
328328
SpanProcessor customSpanProcessor() {
@@ -332,7 +332,7 @@ SpanProcessor customSpanProcessor() {
332332
}
333333

334334
@Configuration(proxyBeanMethods = false)
335-
private static class MultipleSpanExporterConfiguration {
335+
private static final class MultipleSpanExporterConfiguration {
336336

337337
@Bean
338338
SpanExporter spanExporter1() {
@@ -347,7 +347,7 @@ SpanExporter spanExporter2() {
347347
}
348348

349349
@Configuration(proxyBeanMethods = false)
350-
private static class CustomConfiguration {
350+
private static final class CustomConfiguration {
351351

352352
@Bean
353353
SpanProcessors customSpanProcessors() {
@@ -427,7 +427,7 @@ SpanCustomizer customSpanCustomizer() {
427427
}
428428

429429
@Configuration(proxyBeanMethods = false)
430-
private static class SdkTracerProviderCustomizationConfiguration {
430+
private static final class SdkTracerProviderCustomizationConfiguration {
431431

432432
@Bean
433433
@Order(1)
@@ -449,7 +449,7 @@ SdkTracerProviderBuilderCustomizer sdkTracerProviderBuilderCustomizerTwo() {
449449

450450
}
451451

452-
private static class DummySpanExporter implements SpanExporter {
452+
private static final class DummySpanExporter implements SpanExporter {
453453

454454
@Override
455455
public CompletableResultCode export(Collection<SpanData> spans) {
@@ -469,7 +469,7 @@ public CompletableResultCode shutdown() {
469469
}
470470

471471
@Configuration(proxyBeanMethods = false)
472-
private static class InMemoryRecordingSpanExporterConfiguration {
472+
private static final class InMemoryRecordingSpanExporterConfiguration {
473473

474474
@Bean
475475
InMemoryRecordingSpanExporter spanExporter() {
@@ -478,7 +478,7 @@ InMemoryRecordingSpanExporter spanExporter() {
478478

479479
}
480480

481-
private static class InMemoryRecordingSpanExporter implements SpanExporter {
481+
private static final class InMemoryRecordingSpanExporter implements SpanExporter {
482482

483483
private final List<SpanData> exportedSpans = new ArrayList<>();
484484

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/otlp/OtlpAutoConfigurationTests.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -127,7 +127,7 @@ void testConnectionFactoryWithOverridesWhenUsingCustomConnectionDetails() {
127127
}
128128

129129
@Configuration(proxyBeanMethods = false)
130-
private static class CustomHttpExporterConfiguration {
130+
private static final class CustomHttpExporterConfiguration {
131131

132132
@Bean
133133
OtlpHttpSpanExporter customOtlpHttpSpanExporter() {
@@ -137,7 +137,7 @@ OtlpHttpSpanExporter customOtlpHttpSpanExporter() {
137137
}
138138

139139
@Configuration(proxyBeanMethods = false)
140-
private static class CustomGrpcExporterConfiguration {
140+
private static final class CustomGrpcExporterConfiguration {
141141

142142
@Bean
143143
OtlpGrpcSpanExporter customOtlpGrpcSpanExporter() {

0 commit comments

Comments
 (0)