]> source.dussan.org Git - aspectj.git/commitdiff
415266: ltw jmx fix
authorAndy Clement <aclement@gopivotal.com>
Tue, 1 Oct 2013 17:08:31 +0000 (10:08 -0700)
committerAndy Clement <aclement@gopivotal.com>
Tue, 1 Oct 2013 17:08:31 +0000 (10:08 -0700)
loadtime/src/org/aspectj/weaver/loadtime/Aj.java

index 42d7a258b8d548574f69915d849e7fbb32a8059b..03715b6a3410f7e7b147e8ec7bb431927d676f9a 100644 (file)
@@ -297,10 +297,9 @@ public class Aj implements ClassPreProcessor {
 
                        synchronized (weavingAdaptors) {
                                checkQ();
-                if(loader.equals(myClassLoader)){
-                    adaptor = myClassLoaderAdpator;
-                }
-                else{
+                if (loader.equals(myClassLoader)){
+                    adaptor = myClassLoaderAdaptor;
+                } else {
                        adaptor = (ExplicitlyInitializedClassLoaderWeavingAdaptor) weavingAdaptors.get(adaptorKey);
                 }
                                if (adaptor == null) {
@@ -308,12 +307,11 @@ public class Aj implements ClassPreProcessor {
                                        // within the synchronized block
                                        ClassLoaderWeavingAdaptor weavingAdaptor = new ClassLoaderWeavingAdaptor();
                                        adaptor = new ExplicitlyInitializedClassLoaderWeavingAdaptor(weavingAdaptor);
-                                         if(myClassLoaderAdpator == null){
-                               myClassLoaderAdpator = adaptor;
-                                         }
-                           else{
+                                         if(myClassLoaderAdaptor == null && loader.equals(myClassLoader)){
+                               myClassLoaderAdaptor = adaptor;
+                                         } else {
                                weavingAdaptors.put(adaptorKey, adaptor);
-                           }
+                         }
                                }
                        }
                        // perform the initialization
@@ -322,7 +320,7 @@ public class Aj implements ClassPreProcessor {
 
                }
                private static final ClassLoader myClassLoader = WeavingAdaptor.class.getClassLoader();
-               private static ExplicitlyInitializedClassLoaderWeavingAdaptor myClassLoaderAdpator;
+               private static ExplicitlyInitializedClassLoaderWeavingAdaptor myClassLoaderAdaptor;
        }