]> source.dussan.org Git - aspectj.git/commitdiff
Temporarily removing world reuse - needs a bit more thought
authorAndy Clement <aclement@pivotal.io>
Fri, 20 Oct 2017 19:37:58 +0000 (12:37 -0700)
committerAndy Clement <aclement@pivotal.io>
Fri, 20 Oct 2017 19:37:58 +0000 (12:37 -0700)
org.aspectj.matcher/src/org/aspectj/weaver/reflect/ReflectionWorld.java

index d06db52d1813dc4882bf3c9e35f71b53c88f106a..c784ff288a0d2508ccf76273191047b3a61d4302 100644 (file)
@@ -43,6 +43,14 @@ public class ReflectionWorld extends World implements IReflectionWorld {
        private Map<String,Class<?>> inProgressResolutionClasses = new HashMap<String,Class<?>>();
        
        public static ReflectionWorld getReflectionWorldFor(WeakClassLoaderReference classLoaderReference) {
+               
+               // Temporarily do as before. Although the cache makes things faster it needs a bit more thought because
+               // if the world has pointcutdesignators registered then someone may inadvertently register additional
+               // ones on reusing a world (when they would be expecting a clean world). We can't automatically
+               // clear them because we don't know when they are finished with.
+               return new ReflectionWorld(classLoaderReference);
+               
+               /*
                synchronized (rworlds) {
                        // Tidyup any no longer relevant entries...
                        for (Iterator<Map.Entry<WeakClassLoaderReference, ReflectionWorld>> it = rworlds.entrySet().iterator();
@@ -62,6 +70,7 @@ public class ReflectionWorld extends World implements IReflectionWorld {
                        }
                        return rworld;
                }
+               */
        }
        
        public static void cleanUpWorlds() {