You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2020/07/23 05:00:50 UTC
[groovy] branch GROOVY_2_5_X updated: GROOVY-9637: prefactor
existing utility
This is an automated email from the ASF dual-hosted git repository.
paulk pushed a commit to branch GROOVY_2_5_X
in repository https://gitbox.apache.org/repos/asf/groovy.git
The following commit(s) were added to refs/heads/GROOVY_2_5_X by this push:
new 22acefc GROOVY-9637: prefactor existing utility
22acefc is described below
commit 22acefcdc12ffb165ec0d272a00f4eef71bd948c
Author: Daniel Sun <su...@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 c04c545..11d9265 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",
@@ -195,7 +203,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) {