Skip to content

Commit

Permalink
Use ConcurrentHashMap.newKeySet where feasible
Browse files Browse the repository at this point in the history
  • Loading branch information
izeye committed Apr 29, 2024
1 parent 6c15478 commit 0cecb38
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

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;
Expand All @@ -43,7 +42,7 @@
*/
class ScheduledBeanLazyInitializationExcludeFilter implements LazyInitializationExcludeFilter {

private final Set<Class<?>> nonAnnotatedClasses = Collections.newSetFromMap(new ConcurrentHashMap<>(64));
private final Set<Class<?>> nonAnnotatedClasses = ConcurrentHashMap.newKeySet(64);

ScheduledBeanLazyInitializationExcludeFilter() {
// Ignore AOP infrastructure such as scoped proxies.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
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;
Expand All @@ -47,7 +46,7 @@ public abstract class JarUrlClassLoader extends URLClassLoader {

private final Map<URL, JarFile> jarFiles = new ConcurrentHashMap<>();

private final Set<String> undefinablePackages = Collections.newSetFromMap(new ConcurrentHashMap<>());
private final Set<String> undefinablePackages = ConcurrentHashMap.newKeySet();

/**
* Create a new {@link LaunchedClassLoader} instance.
Expand Down

0 comments on commit 0cecb38

Please sign in to comment.