Skip to content

Commit 45c3285

Browse files
committed
Fix Checkstyle upgrade
Closes gh-38746
1 parent 4699923 commit 45c3285

File tree

135 files changed

+329
-324
lines changed

Some content is hidden

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

135 files changed

+329
-324
lines changed

buildSrc/build.gradle

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,13 @@ if (versions.springFramework.contains("-")) {
3030
}
3131
}
3232

33+
checkstyle {
34+
toolVersion = "10.12.4"
35+
}
36+
3337
dependencies {
34-
checkstyle "io.spring.javaformat:spring-javaformat-checkstyle:${javaFormatVersion}"
38+
checkstyle("com.puppycrawl.tools:checkstyle:${checkstyle.toolVersion}")
39+
checkstyle("io.spring.javaformat:spring-javaformat-checkstyle:${javaFormatVersion}")
3540

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

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

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

Lines changed: 3 additions & 1 deletion
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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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.
@@ -93,7 +93,7 @@ public MeterFilter jerseyMetricsUriTagFilter() {
9393
/**
9494
* An {@link AnnotationFinder} that uses {@link AnnotationUtils}.
9595
*/
96-
private static class AnnotationUtilsAnnotationFinder implements AnnotationFinder {
96+
private static final class AnnotationUtilsAnnotationFinder implements AnnotationFinder {
9797

9898
@Override
9999
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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.
@@ -73,7 +73,7 @@ void healthComponentsAlwaysPresent() {
7373
});
7474
}
7575

76-
private static class TestHealthIndicator implements HealthIndicator {
76+
private static final class TestHealthIndicator implements HealthIndicator {
7777

7878
@Override
7979
public Health health() {

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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 3 additions & 3 deletions
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.
@@ -493,11 +493,11 @@ public boolean supportsContext(Context context) {
493493

494494
}
495495

496-
private static class CustomContext extends Context {
496+
private static final class CustomContext extends Context {
497497

498498
}
499499

500-
private static class CalledHandlers {
500+
private static final class CalledHandlers {
501501

502502
private final List<ObservationHandler<?>> calledHandlers = new ArrayList<>();
503503

0 commit comments

Comments
 (0)