Skip to content

Commit e2973a9

Browse files
izeyescottfrederick
authored andcommitted
Use ConcurrentHashMap.newKeySet where feasible
See gh-40567
1 parent 1591344 commit e2973a9

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/task/ScheduledBeanLazyInitializationExcludeFilter.java

+2-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.
@@ -18,7 +18,6 @@
1818

1919
import java.lang.reflect.Method;
2020
import java.util.Arrays;
21-
import java.util.Collections;
2221
import java.util.Map;
2322
import java.util.Set;
2423
import java.util.concurrent.ConcurrentHashMap;
@@ -43,7 +42,7 @@
4342
*/
4443
class ScheduledBeanLazyInitializationExcludeFilter implements LazyInitializationExcludeFilter {
4544

46-
private final Set<Class<?>> nonAnnotatedClasses = Collections.newSetFromMap(new ConcurrentHashMap<>(64));
45+
private final Set<Class<?>> nonAnnotatedClasses = ConcurrentHashMap.newKeySet(64);
4746

4847
ScheduledBeanLazyInitializationExcludeFilter() {
4948
// Ignore AOP infrastructure such as scoped proxies.

0 commit comments

Comments
 (0)