Skip to content

Commit 725337f

Browse files
committed
Make fields final
Closes gh-33537
1 parent 216d159 commit 725337f

File tree

285 files changed

+445
-437
lines changed

Some content is hidden

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

285 files changed

+445
-437
lines changed

buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/UpgradeBom.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
*/
5959
public class UpgradeBom extends DefaultTask {
6060

61-
private Set<String> repositoryUrls;
61+
private final Set<String> repositoryUrls;
6262

6363
private final BomExtension bom;
6464

buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/PrepareMavenBinaries.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
*/
3636
public class PrepareMavenBinaries extends DefaultTask {
3737

38-
private Set<String> versions = new LinkedHashSet<>();
38+
private final Set<String> versions = new LinkedHashSet<>();
3939

4040
private File outputDir;
4141

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/context/properties/ConfigurationPropertiesReportEndpointProperties.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public class ConfigurationPropertiesReportEndpointProperties {
4242
* Roles used to determine whether a user is authorized to be shown unsanitized
4343
* values. When empty, all authenticated users are authorized.
4444
*/
45-
private Set<String> roles = new HashSet<>();
45+
private final Set<String> roles = new HashSet<>();
4646

4747
public Show getShowValues() {
4848
return this.showValues;

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/env/EnvironmentEndpointProperties.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class EnvironmentEndpointProperties {
4141
* Roles used to determine whether a user is authorized to be shown unsanitized
4242
* values. When empty, all authenticated users are authorized.
4343
*/
44-
private Set<String> roles = new HashSet<>();
44+
private final Set<String> roles = new HashSet<>();
4545

4646
public Show getShowValues() {
4747
return this.showValues;

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/quartz/QuartzEndpointProperties.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class QuartzEndpointProperties {
4141
* Roles used to determine whether a user is authorized to be shown unsanitized job or
4242
* trigger values. When empty, all authenticated users are authorized.
4343
*/
44-
private Set<String> roles = new HashSet<>();
44+
private final Set<String> roles = new HashSet<>();
4545

4646
public Show getShowValues() {
4747
return this.showValues;

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/availability/AvailabilityProbesAutoConfigurationTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
*/
3535
class AvailabilityProbesAutoConfigurationTests {
3636

37-
private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
37+
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
3838
.withConfiguration(AutoConfigurations.of(ApplicationAvailabilityAutoConfiguration.class,
3939
AvailabilityHealthContributorAutoConfiguration.class, AvailabilityProbesAutoConfiguration.class));
4040

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/availability/AvailabilityProbesHealthEndpointGroupTests.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
*/
3333
class AvailabilityProbesHealthEndpointGroupTests {
3434

35-
private AvailabilityProbesHealthEndpointGroup group = new AvailabilityProbesHealthEndpointGroup(null, "a", "b");
35+
private final AvailabilityProbesHealthEndpointGroup group = new AvailabilityProbesHealthEndpointGroup(null, "a",
36+
"b");
3637

3738
@Test
3839
void isMemberWhenMemberReturnsTrue() {

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/availability/AvailabilityProbesHealthEndpointGroupsPostProcessorTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
*/
3838
class AvailabilityProbesHealthEndpointGroupsPostProcessorTests {
3939

40-
private AvailabilityProbesHealthEndpointGroupsPostProcessor postProcessor = new AvailabilityProbesHealthEndpointGroupsPostProcessor(
40+
private final AvailabilityProbesHealthEndpointGroupsPostProcessor postProcessor = new AvailabilityProbesHealthEndpointGroupsPostProcessor(
4141
new MockEnvironment());
4242

4343
@Test

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
*/
3232
class CloudFoundryEndpointFilterTests {
3333

34-
private CloudFoundryEndpointFilter filter = new CloudFoundryEndpointFilter();
34+
private final CloudFoundryEndpointFilter filter = new CloudFoundryEndpointFilter();
3535

3636
@Test
3737
void matchIfDiscovererCloudFoundryShouldReturnFalse() {

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@
7171
*/
7272
class CloudFoundryWebFluxEndpointIntegrationTests {
7373

74-
private static ReactiveTokenValidator tokenValidator = mock(ReactiveTokenValidator.class);
74+
private static final ReactiveTokenValidator tokenValidator = mock(ReactiveTokenValidator.class);
7575

76-
private static ReactiveCloudFoundrySecurityService securityService = mock(
76+
private static final ReactiveCloudFoundrySecurityService securityService = mock(
7777
ReactiveCloudFoundrySecurityService.class);
7878

7979
private final ReactiveWebApplicationContextRunner contextRunner = new ReactiveWebApplicationContextRunner(

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@
6666
*/
6767
class CloudFoundryMvcWebEndpointIntegrationTests {
6868

69-
private static TokenValidator tokenValidator = mock(TokenValidator.class);
69+
private static final TokenValidator tokenValidator = mock(TokenValidator.class);
7070

71-
private static CloudFoundrySecurityService securityService = mock(CloudFoundrySecurityService.class);
71+
private static final CloudFoundrySecurityService securityService = mock(CloudFoundrySecurityService.class);
7272

7373
@Test
7474
void operationWithSecurityInterceptorForbidden() {

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/jackson/JacksonEndpointAutoConfigurationTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
*/
4141
class JacksonEndpointAutoConfigurationTests {
4242

43-
private ApplicationContextRunner runner = new ApplicationContextRunner()
43+
private final ApplicationContextRunner runner = new ApplicationContextRunner()
4444
.withConfiguration(AutoConfigurations.of(JacksonEndpointAutoConfiguration.class));
4545

4646
@Test

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/MeterRegistryPostProcessorTests.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ class MeterRegistryPostProcessorTests {
5050

5151
private final MetricsProperties properties = new MetricsProperties();
5252

53-
private List<MeterRegistryCustomizer<?>> customizers = new ArrayList<>();
53+
private final List<MeterRegistryCustomizer<?>> customizers = new ArrayList<>();
5454

55-
private List<MeterFilter> filters = new ArrayList<>();
55+
private final List<MeterFilter> filters = new ArrayList<>();
5656

57-
private List<MeterBinder> binders = new ArrayList<>();
57+
private final List<MeterBinder> binders = new ArrayList<>();
5858

5959
@Mock
6060
private MeterRegistryCustomizer<MeterRegistry> mockCustomizer;

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/data/MetricsRepositoryMethodInvocationListenerBeanPostProcessorTests.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@
3636
*/
3737
class MetricsRepositoryMethodInvocationListenerBeanPostProcessorTests {
3838

39-
private MetricsRepositoryMethodInvocationListener listener = mock(MetricsRepositoryMethodInvocationListener.class);
39+
private final MetricsRepositoryMethodInvocationListener listener = mock(
40+
MetricsRepositoryMethodInvocationListener.class);
4041

41-
private MetricsRepositoryMethodInvocationListenerBeanPostProcessor postProcessor = new MetricsRepositoryMethodInvocationListenerBeanPostProcessor(
42+
private final MetricsRepositoryMethodInvocationListenerBeanPostProcessor postProcessor = new MetricsRepositoryMethodInvocationListenerBeanPostProcessor(
4243
SingletonSupplier.of(this.listener));
4344

4445
@Test

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/observation/web/client/ClientHttpObservationConventionAdapterTests.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ class ClientHttpObservationConventionAdapterTests {
4444

4545
private static final String TEST_METRIC_NAME = "test.metric.name";
4646

47-
private ClientHttpObservationConventionAdapter convention = new ClientHttpObservationConventionAdapter(
47+
private final ClientHttpObservationConventionAdapter convention = new ClientHttpObservationConventionAdapter(
4848
TEST_METRIC_NAME, new DefaultRestTemplateExchangeTagsProvider());
4949

50-
private ClientHttpRequest request = new MockClientHttpRequest(HttpMethod.GET, URI.create("/resource/test"));
50+
private final ClientHttpRequest request = new MockClientHttpRequest(HttpMethod.GET, URI.create("/resource/test"));
5151

52-
private ClientHttpResponse response = new MockClientHttpResponse("foo".getBytes(), HttpStatus.OK);
52+
private final ClientHttpResponse response = new MockClientHttpResponse("foo".getBytes(), HttpStatus.OK);
5353

5454
private ClientRequestObservationContext context;
5555

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/observation/web/client/ClientObservationConventionAdapterTests.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,14 @@ class ClientObservationConventionAdapterTests {
4343

4444
private static final String TEST_METRIC_NAME = "test.metric.name";
4545

46-
private ClientObservationConventionAdapter convention = new ClientObservationConventionAdapter(TEST_METRIC_NAME,
47-
new DefaultWebClientExchangeTagsProvider());
46+
private final ClientObservationConventionAdapter convention = new ClientObservationConventionAdapter(
47+
TEST_METRIC_NAME, new DefaultWebClientExchangeTagsProvider());
4848

49-
private ClientRequest.Builder requestBuilder = ClientRequest.create(HttpMethod.GET, URI.create("/resource/test"))
49+
private final ClientRequest.Builder requestBuilder = ClientRequest
50+
.create(HttpMethod.GET, URI.create("/resource/test"))
5051
.attribute(WebClient.class.getName() + ".uriTemplate", "/resource/{name}");
5152

52-
private ClientResponse response = ClientResponse.create(HttpStatus.OK).body("foo").build();
53+
private final ClientResponse response = ClientResponse.create(HttpStatus.OK).body("foo").build();
5354

5455
private ClientRequestObservationContext context;
5556

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/observation/web/servlet/ServerRequestObservationConventionAdapterTests.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,15 @@ class ServerRequestObservationConventionAdapterTests {
4747

4848
private static final String TEST_METRIC_NAME = "test.metric.name";
4949

50-
private ServerRequestObservationConventionAdapter convention = new ServerRequestObservationConventionAdapter(
50+
private final ServerRequestObservationConventionAdapter convention = new ServerRequestObservationConventionAdapter(
5151
TEST_METRIC_NAME, new DefaultWebMvcTagsProvider(), Collections.emptyList());
5252

53-
private MockHttpServletRequest request = new MockHttpServletRequest("GET", "/resource/test");
53+
private final MockHttpServletRequest request = new MockHttpServletRequest("GET", "/resource/test");
5454

55-
private MockHttpServletResponse response = new MockHttpServletResponse();
55+
private final MockHttpServletResponse response = new MockHttpServletResponse();
5656

57-
private ServerRequestObservationContext context = new ServerRequestObservationContext(this.request, this.response);
57+
private final ServerRequestObservationContext context = new ServerRequestObservationContext(this.request,
58+
this.response);
5859

5960
@Test
6061
void customNameIsUsed() {

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/CompositeHandlerExceptionResolverTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ class CompositeHandlerExceptionResolverTests {
4343

4444
private AnnotationConfigApplicationContext context;
4545

46-
private MockHttpServletRequest request = new MockHttpServletRequest();
46+
private final MockHttpServletRequest request = new MockHttpServletRequest();
4747

48-
private MockHttpServletResponse response = new MockHttpServletResponse();
48+
private final MockHttpServletResponse response = new MockHttpServletResponse();
4949

5050
@Test
5151
void resolverShouldDelegateToOtherResolversInContext() {

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/annotation/EndpointDiscoverer.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -401,11 +401,11 @@ private static class EndpointBean {
401401

402402
private final EndpointId id;
403403

404-
private boolean enabledByDefault;
404+
private final boolean enabledByDefault;
405405

406406
private final Class<?> filter;
407407

408-
private Set<ExtensionBean> extensions = new LinkedHashSet<>();
408+
private final Set<ExtensionBean> extensions = new LinkedHashSet<>();
409409

410410
EndpointBean(Environment environment, String beanName, Class<?> beanType, Supplier<Object> beanSupplier) {
411411
MergedAnnotation<Endpoint> annotation = MergedAnnotations.from(beanType, SearchStrategy.TYPE_HIERARCHY)

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/Health.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ public static class Builder {
190190

191191
private Status status;
192192

193-
private Map<String, Object> details;
193+
private final Map<String, Object> details;
194194

195195
private Throwable exception;
196196

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public Map<String, GroupLoggerLevelsDescriptor> getGroups() {
161161
*/
162162
public static class LoggerLevelsDescriptor implements OperationResponseBody {
163163

164-
private String configuredLevel;
164+
private final String configuredLevel;
165165

166166
public LoggerLevelsDescriptor(LogLevel configuredLevel) {
167167
this.configuredLevel = getName(configuredLevel);
@@ -182,7 +182,7 @@ public String getConfiguredLevel() {
182182
*/
183183
public static class GroupLoggerLevelsDescriptor extends LoggerLevelsDescriptor {
184184

185-
private List<String> members;
185+
private final List<String> members;
186186

187187
public GroupLoggerLevelsDescriptor(LogLevel configuredLevel, List<String> members) {
188188
super(configuredLevel);
@@ -200,7 +200,7 @@ public List<String> getMembers() {
200200
*/
201201
public static class SingleLoggerLevelsDescriptor extends LoggerLevelsDescriptor {
202202

203-
private String effectiveLevel;
203+
private final String effectiveLevel;
204204

205205
public SingleLoggerLevelsDescriptor(LoggerConfiguration configuration) {
206206
super(configuration.getConfiguredLevel());

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/management/HeapDumpWebEndpoint.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,9 @@ protected interface HeapDumper {
146146
*/
147147
protected static class HotSpotDiagnosticMXBeanHeapDumper implements HeapDumper {
148148

149-
private Object diagnosticMXBean;
149+
private final Object diagnosticMXBean;
150150

151-
private Method dumpHeapMethod;
151+
private final Method dumpHeapMethod;
152152

153153
@SuppressWarnings("unchecked")
154154
protected HotSpotDiagnosticMXBeanHeapDumper() {
@@ -189,9 +189,9 @@ private File createTempFile() throws IOException {
189189
*/
190190
private static final class OpenJ9DiagnosticsMXBeanHeapDumper implements HeapDumper {
191191

192-
private Object diagnosticMXBean;
192+
private final Object diagnosticMXBean;
193193

194-
private Method dumpHeapMethod;
194+
private final Method dumpHeapMethod;
195195

196196
@SuppressWarnings("unchecked")
197197
private OpenJ9DiagnosticsMXBeanHeapDumper() {

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/export/prometheus/PrometheusPushGatewayManager.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public class PrometheusPushGatewayManager {
5656

5757
private final TaskScheduler scheduler;
5858

59-
private ScheduledFuture<?> scheduled;
59+
private final ScheduledFuture<?> scheduled;
6060

6161
/**
6262
* Create a new {@link PrometheusPushGatewayManager} instance using a single threaded

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/security/AuthenticationAuditListener.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public class AuthenticationAuditListener extends AbstractAuthenticationAuditList
5353

5454
private static final String WEB_LISTENER_CHECK_CLASS = "org.springframework.security.web.authentication.switchuser.AuthenticationSwitchUserEvent";
5555

56-
private WebAuditListener webListener = maybeCreateWebListener();
56+
private final WebAuditListener webListener = maybeCreateWebListener();
5757

5858
private static WebAuditListener maybeCreateWebListener() {
5959
if (ClassUtils.isPresent(WEB_LISTENER_CHECK_CLASS, null)) {

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpointSerializationTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -497,9 +497,9 @@ public void setAddress(InetAddress address) {
497497

498498
public static class InitializedMapAndListProperties extends Foo {
499499

500-
private Map<String, Boolean> map = new HashMap<>();
500+
private final Map<String, Boolean> map = new HashMap<>();
501501

502-
private List<String> list = new ArrayList<>();
502+
private final List<String> list = new ArrayList<>();
503503

504504
public Map<String, Boolean> getMap() {
505505
return this.map;

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpointTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ public static class TestProperties {
435435

436436
private Duration duration = Duration.ofSeconds(10);
437437

438-
private String ignored = "dummy";
438+
private final String ignored = "dummy";
439439

440440
public String getDbPassword() {
441441
return this.dbPassword;
@@ -803,7 +803,7 @@ public static class SensibleProperties {
803803

804804
private URI noPasswordUri = URI.create("http://user:@localhost:8080");
805805

806-
private List<String> simpleList = new ArrayList<>();
806+
private final List<String> simpleList = new ArrayList<>();
807807

808808
private String rawSensitiveAddresses = "http://user:password@localhost:8080,http://user2:password2@localhost:8082";
809809

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/invoke/reflect/OperationMethodParameterTests.java

+6-5
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,17 @@
3838
*/
3939
class OperationMethodParameterTests {
4040

41-
private Method example = ReflectionUtils.findMethod(getClass(), "example", String.class, String.class);
41+
private final Method example = ReflectionUtils.findMethod(getClass(), "example", String.class, String.class);
4242

43-
private Method exampleJsr305 = ReflectionUtils.findMethod(getClass(), "exampleJsr305", String.class, String.class);
44-
45-
private Method exampleMetaJsr305 = ReflectionUtils.findMethod(getClass(), "exampleMetaJsr305", String.class,
43+
private final Method exampleJsr305 = ReflectionUtils.findMethod(getClass(), "exampleJsr305", String.class,
4644
String.class);
4745

48-
private Method exampleJsr305NonNull = ReflectionUtils.findMethod(getClass(), "exampleJsr305NonNull", String.class,
46+
private final Method exampleMetaJsr305 = ReflectionUtils.findMethod(getClass(), "exampleMetaJsr305", String.class,
4947
String.class);
5048

49+
private final Method exampleJsr305NonNull = ReflectionUtils.findMethod(getClass(), "exampleJsr305NonNull",
50+
String.class, String.class);
51+
5152
@Test
5253
void getNameShouldReturnName() {
5354
OperationMethodParameter parameter = new OperationMethodParameter("name", this.example.getParameters()[0]);

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/invoke/reflect/OperationMethodParametersTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@
4343
*/
4444
class OperationMethodParametersTests {
4545

46-
private Method exampleMethod = ReflectionUtils.findMethod(getClass(), "example", String.class);
46+
private final Method exampleMethod = ReflectionUtils.findMethod(getClass(), "example", String.class);
4747

48-
private Method exampleNoParamsMethod = ReflectionUtils.findMethod(getClass(), "exampleNoParams");
48+
private final Method exampleNoParamsMethod = ReflectionUtils.findMethod(getClass(), "exampleNoParams");
4949

5050
@Test
5151
void createWhenMethodIsNullShouldThrowException() {

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/invoke/reflect/OperationMethodTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
*/
3535
class OperationMethodTests {
3636

37-
private Method exampleMethod = ReflectionUtils.findMethod(getClass(), "example", String.class);
37+
private final Method exampleMethod = ReflectionUtils.findMethod(getClass(), "example", String.class);
3838

3939
@Test
4040
void createWhenMethodIsNullShouldThrowException() {

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/jmx/EndpointMBeanTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ class EndpointMBeanTests {
5454

5555
private static final String[] NO_SIGNATURE = {};
5656

57-
private TestExposableJmxEndpoint endpoint = new TestExposableJmxEndpoint(new TestJmxOperation());
57+
private final TestExposableJmxEndpoint endpoint = new TestExposableJmxEndpoint(new TestJmxOperation());
5858

59-
private TestJmxOperationResponseMapper responseMapper = new TestJmxOperationResponseMapper();
59+
private final TestJmxOperationResponseMapper responseMapper = new TestJmxOperationResponseMapper();
6060

6161
@Test
6262
void createWhenResponseMapperIsNullShouldThrowException() {

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/jmx/JacksonJmxOperationResponseMapperTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
*/
4343
class JacksonJmxOperationResponseMapperTests {
4444

45-
private JacksonJmxOperationResponseMapper mapper = new JacksonJmxOperationResponseMapper(null);
45+
private final JacksonJmxOperationResponseMapper mapper = new JacksonJmxOperationResponseMapper(null);
4646

4747
private final BasicJsonTester json = new BasicJsonTester(getClass());
4848

0 commit comments

Comments
 (0)