groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sun...@apache.org
Subject groovy git commit: Make cached value unmodifiable
Date Mon, 11 Dec 2017 13:17:04 GMT
Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_6_X a8fe2136d -> d2526ca6b


Make cached value unmodifiable

(cherry picked from commit 6323cd1)


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/d2526ca6
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/d2526ca6
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/d2526ca6

Branch: refs/heads/GROOVY_2_6_X
Commit: d2526ca6bef326f89e2f2fac427f2eeb45cc84a2
Parents: a8fe213
Author: sunlan <sunlan@apache.org>
Authored: Mon Dec 11 20:22:11 2017 +0800
Committer: sunlan <sunlan@apache.org>
Committed: Mon Dec 11 21:16:58 2017 +0800

----------------------------------------------------------------------
 .../codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java   | 2 +-
 .../org/codehaus/groovy/macro/transform/MacroMethodsCache.java     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/d2526ca6/src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java b/src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java
index 95919c9..b326061 100644
--- a/src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java
+++ b/src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java
@@ -2189,7 +2189,7 @@ public abstract class StaticTypeCheckingSupport {
                                     );
                             scanner.scanClasspathModules();
 
-                            return getDGMMethods(modules);
+                            return Collections.unmodifiableMap(getDGMMethods(modules));
                         }
                     });
         }

http://git-wip-us.apache.org/repos/asf/groovy/blob/d2526ca6/subprojects/groovy-macro/src/main/groovy/org/codehaus/groovy/macro/transform/MacroMethodsCache.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-macro/src/main/groovy/org/codehaus/groovy/macro/transform/MacroMethodsCache.java
b/subprojects/groovy-macro/src/main/groovy/org/codehaus/groovy/macro/transform/MacroMethodsCache.java
index 5a6af4a..01201fd 100644
--- a/subprojects/groovy-macro/src/main/groovy/org/codehaus/groovy/macro/transform/MacroMethodsCache.java
+++ b/subprojects/groovy-macro/src/main/groovy/org/codehaus/groovy/macro/transform/MacroMethodsCache.java
@@ -50,7 +50,7 @@ class MacroMethodsCache {
         return CACHE.getAndPut(classLoader, new EvictableCache.ValueProvider<ClassLoader,
Map<String, List<MethodNode>>>() {
             @Override
             public Map<String, List<MethodNode>> provide(ClassLoader key) {
-                return getMacroMethodsFromClassLoader(key);
+                return Collections.unmodifiableMap(getMacroMethodsFromClassLoader(key));
             }
         });
     }


Mime
View raw message