This is an automated email from the ASF dual-hosted git repository. paulk pushed a commit to branch GROOVY_3_0_X in repository https://gitbox.apache.org/repos/asf/groovy.git
The following commit(s) were added to refs/heads/GROOVY_3_0_X by this push: new 9b0b4e5 GROOVY-9637: prefactor existing utility 9b0b4e5 is described below commit 9b0b4e5478657a1bfc82d39634d24deeacc2910e Author: Daniel Sun <sun...@apache.org> AuthorDate: Mon Jul 13 02:40:57 2020 +0800 GROOVY-9637: prefactor existing utility --- .../org/apache/groovy/ast/tools/ImmutablePropertyUtils.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/apache/groovy/ast/tools/ImmutablePropertyUtils.java b/src/main/java/org/apache/groovy/ast/tools/ImmutablePropertyUtils.java index 4e2bde0..c89b484 100644 --- a/src/main/java/org/apache/groovy/ast/tools/ImmutablePropertyUtils.java +++ b/src/main/java/org/apache/groovy/ast/tools/ImmutablePropertyUtils.java @@ -69,7 +69,15 @@ public class ImmutablePropertyUtils { This list can by extended by providing "known immutable" classes via Immutable.knownImmutableClasses */ - private static Set<String> builtinImmutables = new HashSet<String>(Arrays.asList( + private static final Set<String> BUILTIN_IMMUTABLES = new HashSet<String>(Arrays.asList( + "boolean", + "byte", + "char", + "double", + "float", + "int", + "long", + "short", "java.lang.Class", "java.lang.Boolean", "java.lang.Byte", @@ -196,7 +204,7 @@ public class ImmutablePropertyUtils { } public static boolean isBuiltinImmutable(String typeName) { - return builtinImmutables.contains(typeName); + return BUILTIN_IMMUTABLES.contains(typeName); } private static boolean hasImmutableAnnotation(Class clazz) {