Use ConcurrentHashMap.newKeySet

In places where a ConcurrentHashMap was used as a set by wrapping it
with Collections.newSetFromMap, switch to just using the set returned
by ConcurrentHashMap.newKeySet directly.

Closes gh-32294
This commit is contained in:
Patrick Strawderman
2024-02-19 08:57:33 -08:00
committed by Sam Brannen
parent ff9c7141c5
commit f9fe8efb2e
14 changed files with 16 additions and 29 deletions

View File

@@ -64,7 +64,7 @@ public class SessionAttributesHandler {
private final Set<Class<?>> attributeTypes = new HashSet<>();
private final Set<String> knownAttributeNames = Collections.newSetFromMap(new ConcurrentHashMap<>(4));
private final Set<String> knownAttributeNames = ConcurrentHashMap.newKeySet(4);
private final SessionAttributeStore sessionAttributeStore;