Use Collection factory methods when applicable
This commit replaces the use of Collections.unmodifiableList/Set/Map with the corresponding 'of(...)' factory methods introduced in Java 9. Closes gh-27824
This commit is contained in:
committed by
Sam Brannen
parent
ab240f5d8e
commit
941b6af9ac
@@ -23,7 +23,6 @@ import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
@@ -65,15 +64,7 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
|
||||
|
||||
private static final Set<Class<?>> ANY_TYPES = Collections.emptySet();
|
||||
|
||||
private static final Set<Class<?>> BOOLEAN_TYPES;
|
||||
|
||||
static {
|
||||
Set<Class<?>> booleanTypes = new HashSet<>(4);
|
||||
booleanTypes.add(Boolean.class);
|
||||
booleanTypes.add(Boolean.TYPE);
|
||||
BOOLEAN_TYPES = Collections.unmodifiableSet(booleanTypes);
|
||||
}
|
||||
|
||||
private static final Set<Class<?>> BOOLEAN_TYPES = Set.of(Boolean.class, Boolean.TYPE);
|
||||
|
||||
private final boolean allowWrite;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user