Merge pull request #40567 from izeye

* pr/40567:
  Use ConcurrentHashMap.newKeySet where feasible

Closes gh-40567
This commit is contained in:
Scott Frederick
2024-04-29 15:42:39 -05:00

View File

@@ -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<Class<?>> nonAnnotatedClasses = Collections.newSetFromMap(new ConcurrentHashMap<>(64));
private final Set<Class<?>> nonAnnotatedClasses = ConcurrentHashMap.newKeySet(64);
ScheduledBeanLazyInitializationExcludeFilter() {
// Ignore AOP infrastructure such as scoped proxies.