From 9e992d6e5e2809afdc18ee4ce4e3bc42b9883e00 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