diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/TracingProperties.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/TracingProperties.java index 175ff03a8175..e1975b66263d 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/TracingProperties.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/TracingProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 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. @@ -199,12 +199,12 @@ public static class Propagation { /** * Tracing context propagation types produced by the application. */ - private List produce = List.of(PropagationType.W3C); + private List produce = new ArrayList<>(List.of(PropagationType.W3C)); /** * Tracing context propagation types consumed by the application. */ - private List consume = List.of(PropagationType.values()); + private List consume = new ArrayList<>(List.of(PropagationType.values())); public void setType(List type) { this.type = type; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/quartz/QuartzProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/quartz/QuartzProperties.java index cc2ebaf5e56b..bda279a00209 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/quartz/QuartzProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/quartz/QuartzProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2025 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. @@ -18,7 +18,6 @@ import java.time.Duration; import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -155,7 +154,7 @@ public static class Jdbc { /** * Prefixes for single-line comments in SQL initialization scripts. */ - private List commentPrefix = new ArrayList<>(Arrays.asList("#", "--")); + private List commentPrefix = new ArrayList<>(List.of("#", "--")); public String getSchema() { return this.schema; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/OAuth2ResourceServerProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/OAuth2ResourceServerProperties.java index ff57def944a7..0619324e0ea9 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/OAuth2ResourceServerProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/OAuth2ResourceServerProperties.java @@ -20,7 +20,6 @@ import java.io.InputStream; import java.nio.charset.StandardCharsets; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; import org.springframework.boot.context.properties.ConfigurationProperties; @@ -62,7 +61,7 @@ public static class Jwt { /** * JSON Web Algorithms used for verifying the digital signatures. */ - private List jwsAlgorithms = Arrays.asList("RS256"); + private List jwsAlgorithms = new ArrayList<>(List.of("RS256")); /** * URI that can either be an OpenID Connect discovery endpoint or an OAuth 2.0 diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/SessionProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/SessionProperties.java index 962621274655..c1ee30919210 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/SessionProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/SessionProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 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. @@ -18,7 +18,6 @@ import java.time.Duration; import java.time.temporal.ChronoUnit; -import java.util.Arrays; import java.util.HashSet; import java.util.Set; import java.util.function.Supplier; @@ -88,7 +87,7 @@ public static class Servlet { * Session repository filter dispatcher types. */ private Set filterDispatcherTypes = new HashSet<>( - Arrays.asList(DispatcherType.ASYNC, DispatcherType.ERROR, DispatcherType.REQUEST)); + Set.of(DispatcherType.ASYNC, DispatcherType.ERROR, DispatcherType.REQUEST)); public int getFilterOrder() { return this.filterOrder; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/appendix/configurationmetadata/annotationprocessor/automaticmetadatageneration/MyMessagingProperties.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/appendix/configurationmetadata/annotationprocessor/automaticmetadatageneration/MyMessagingProperties.java index e03d8b131d1d..d93b61498f7c 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/appendix/configurationmetadata/annotationprocessor/automaticmetadatageneration/MyMessagingProperties.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/appendix/configurationmetadata/annotationprocessor/automaticmetadatageneration/MyMessagingProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2025 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. @@ -17,7 +17,6 @@ package org.springframework.boot.docs.appendix.configurationmetadata.annotationprocessor.automaticmetadatageneration; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; import org.springframework.boot.context.properties.ConfigurationProperties; @@ -25,7 +24,7 @@ @ConfigurationProperties(prefix = "my.messaging") public class MyMessagingProperties { - private List addresses = new ArrayList<>(Arrays.asList("a", "b")); + private List addresses = new ArrayList<>(List.of("a", "b")); private ContainerType containerType = ContainerType.SIMPLE;