Repository: groovy
Updated Branches:
  refs/heads/master 8fc0e4be4 -> ec7b147b4


Minor refactoring: Use `UnlimitedConcurrentCache` instead for better performance


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

Branch: refs/heads/master
Commit: ec7b147b4b90c55e1d117f3bac63b060eeb79386
Parents: 8fc0e4b
Author: Daniel Sun <sun...@apache.org>
Authored: Sun Aug 12 00:42:11 2018 +0800
Committer: Daniel Sun <sun...@apache.org>
Committed: Sun Aug 12 00:42:11 2018 +0800

----------------------------------------------------------------------
 src/main/java/org/codehaus/groovy/control/ResolveVisitor.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/ec7b147b/src/main/java/org/codehaus/groovy/control/ResolveVisitor.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/control/ResolveVisitor.java 
b/src/main/java/org/codehaus/groovy/control/ResolveVisitor.java
index b5f108f..1c93351 100644
--- a/src/main/java/org/codehaus/groovy/control/ResolveVisitor.java
+++ b/src/main/java/org/codehaus/groovy/control/ResolveVisitor.java
@@ -59,8 +59,8 @@ import org.codehaus.groovy.ast.stmt.CatchStatement;
 import org.codehaus.groovy.ast.stmt.ForStatement;
 import org.codehaus.groovy.ast.stmt.Statement;
 import org.codehaus.groovy.control.ClassNodeResolver.LookupResult;
-import org.codehaus.groovy.runtime.memoize.ConcurrentCommonCache;
 import org.codehaus.groovy.runtime.memoize.EvictableCache;
+import org.codehaus.groovy.runtime.memoize.UnlimitedConcurrentCache;
 import org.codehaus.groovy.syntax.Types;
 import org.codehaus.groovy.transform.trait.Traits;
 import org.objectweb.asm.Opcodes;
@@ -504,7 +504,7 @@ public class ResolveVisitor extends 
ClassCodeExpressionTransformer {
         return false;
     }
 
-    private static final EvictableCache<String, Set<String>> 
DEFAULT_IMPORT_CLASS_AND_PACKAGES_CACHE = new ConcurrentCommonCache<>();
+    private static final EvictableCache<String, Set<String>> 
DEFAULT_IMPORT_CLASS_AND_PACKAGES_CACHE = new UnlimitedConcurrentCache<>();
 
     private boolean resolveFromDefaultImports(final ClassNode type, final 
String[] packagePrefixes) {
         final String typeName = type.getName();
@@ -521,7 +521,7 @@ public class ResolveVisitor extends 
ClassCodeExpressionTransformer {
                 type.setRedirect(tmp.redirect());
 
                 if (DEFAULT_IMPORTS == packagePrefixes) { // Only the 
non-cached type and packages should be cached
-                    Set<String> packagePrefixSet = 
DEFAULT_IMPORT_CLASS_AND_PACKAGES_CACHE.getAndPut(typeName, new 
ConcurrentCommonCache.ValueProvider<String, Set<String>>() {
+                    Set<String> packagePrefixSet = 
DEFAULT_IMPORT_CLASS_AND_PACKAGES_CACHE.getAndPut(typeName, new 
UnlimitedConcurrentCache.ValueProvider<String, Set<String>>() {
                         @Override
                         public Set<String> provide(String key) {
                             return new HashSet<>(2);

Reply via email to