From f68fad1168cb96b6dd5402b4778a25e8b4d0acab Mon Sep 17 00:00:00 2001 From: Andy Clement Date: Tue, 1 Oct 2013 10:08:31 -0700 Subject: [PATCH] 415266: ltw jmx fix --- .../src/org/aspectj/weaver/loadtime/Aj.java | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/loadtime/src/org/aspectj/weaver/loadtime/Aj.java b/loadtime/src/org/aspectj/weaver/loadtime/Aj.java index 42d7a258b..03715b6a3 100644 --- a/loadtime/src/org/aspectj/weaver/loadtime/Aj.java +++ b/loadtime/src/org/aspectj/weaver/loadtime/Aj.java @@ -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; } -- 2.39.5