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) {
// 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
}
private static final ClassLoader myClassLoader = WeavingAdaptor.class.getClassLoader();
- private static ExplicitlyInitializedClassLoaderWeavingAdaptor myClassLoaderAdpator;
+ private static ExplicitlyInitializedClassLoaderWeavingAdaptor myClassLoaderAdaptor;
}