diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/task/ScheduledBeanLazyInitializationExcludeFilter.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/task/ScheduledBeanLazyInitializationExcludeFilter.java index d68d513c2f..55e5f44286 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/task/ScheduledBeanLazyInitializationExcludeFilter.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/task/ScheduledBeanLazyInitializationExcludeFilter.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. @@ -18,7 +18,6 @@ package org.springframework.boot.autoconfigure.task; import java.lang.reflect.Method; import java.util.Arrays; -import java.util.Collections; import java.util.Map; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; @@ -43,7 +42,7 @@ import org.springframework.util.ClassUtils; */ class ScheduledBeanLazyInitializationExcludeFilter implements LazyInitializationExcludeFilter { - private final Set> nonAnnotatedClasses = Collections.newSetFromMap(new ConcurrentHashMap<>(64)); + private final Set> nonAnnotatedClasses = ConcurrentHashMap.newKeySet(64); ScheduledBeanLazyInitializationExcludeFilter() { // Ignore AOP infrastructure such as scoped proxies. diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/net/protocol/jar/JarUrlClassLoader.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/net/protocol/jar/JarUrlClassLoader.java index bf2aadc218..b32a9b1b56 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/net/protocol/jar/JarUrlClassLoader.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/net/protocol/jar/JarUrlClassLoader.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. @@ -22,7 +22,6 @@ import java.net.URL; import java.net.URLClassLoader; import java.net.URLConnection; import java.util.Arrays; -import java.util.Collections; import java.util.Enumeration; import java.util.Map; import java.util.Set; @@ -47,7 +46,7 @@ public abstract class JarUrlClassLoader extends URLClassLoader { private final Map jarFiles = new ConcurrentHashMap<>(); - private final Set undefinablePackages = Collections.newSetFromMap(new ConcurrentHashMap<>()); + private final Set undefinablePackages = ConcurrentHashMap.newKeySet(); /** * Create a new {@link LaunchedClassLoader} instance.