diff options
author | acolyer <acolyer> | 2005-12-13 22:23:24 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2005-12-13 22:23:24 +0000 |
commit | 588e7b91e892db8db779142184ae3cad169c4a11 (patch) | |
tree | 10a2e204292cea0a544459ac42bc63538b81ffe1 | |
parent | b7929e91659708dc27141f587ad236af7bfa8287 (diff) | |
download | aspectj-588e7b91e892db8db779142184ae3cad169c4a11.tar.gz aspectj-588e7b91e892db8db779142184ae3cad169c4a11.zip |
fix for enh 120743
-rw-r--r-- | loadtime/src/org/aspectj/weaver/loadtime/Aj.java | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/loadtime/src/org/aspectj/weaver/loadtime/Aj.java b/loadtime/src/org/aspectj/weaver/loadtime/Aj.java index c5818e208..fd045c3e6 100644 --- a/loadtime/src/org/aspectj/weaver/loadtime/Aj.java +++ b/loadtime/src/org/aspectj/weaver/loadtime/Aj.java @@ -59,6 +59,9 @@ public class Aj implements ClassPreProcessor { try { WeavingAdaptor weavingAdaptor = WeaverContainer.getWeaver(loader, weavingContext); + if (weavingAdaptor == null) { + return bytes; + } return weavingAdaptor.weaveClass(className, bytes); } catch (Throwable t) { //FIXME AV wondering if we should have the option to fail (throw runtime exception) here @@ -81,11 +84,17 @@ public class Aj implements ClassPreProcessor { synchronized(weavingAdaptors) { adaptor = (ExplicitlyInitializedClassLoaderWeavingAdaptor) weavingAdaptors.get(loader); if (adaptor == null) { - // create it and put it back in the weavingAdaptors map but avoid any kind of instantiation - // within the synchronized block - ClassLoaderWeavingAdaptor weavingAdaptor = new ClassLoaderWeavingAdaptor(loader, weavingContext); - adaptor = new ExplicitlyInitializedClassLoaderWeavingAdaptor(weavingAdaptor); - weavingAdaptors.put(loader, adaptor); + String loaderClassName = loader.getClass().getName(); + if (loaderClassName.equals("sun.reflect.DelegatingClassLoader")) { + // we don't weave reflection generated types at all! + return null; + } else { + // create it and put it back in the weavingAdaptors map but avoid any kind of instantiation + // within the synchronized block + ClassLoaderWeavingAdaptor weavingAdaptor = new ClassLoaderWeavingAdaptor(loader, weavingContext); + adaptor = new ExplicitlyInitializedClassLoaderWeavingAdaptor(weavingAdaptor); + weavingAdaptors.put(loader, adaptor); + } } } // perform the initialization |