summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--loadtime/src/org/aspectj/weaver/loadtime/Aj.java14
1 files changed, 8 insertions, 6 deletions
diff --git a/loadtime/src/org/aspectj/weaver/loadtime/Aj.java b/loadtime/src/org/aspectj/weaver/loadtime/Aj.java
index 33398f0c5..43de84ef1 100644
--- a/loadtime/src/org/aspectj/weaver/loadtime/Aj.java
+++ b/loadtime/src/org/aspectj/weaver/loadtime/Aj.java
@@ -67,12 +67,14 @@ public class Aj implements ClassPreProcessor {
}
try {
- WeavingAdaptor weavingAdaptor = WeaverContainer.getWeaver(loader, weavingContext);
- if (weavingAdaptor == null) {
- if (trace.isTraceEnabled()) trace.exit("preProcess",bytes);
- return bytes;
- }
- return weavingAdaptor.weaveClass(className, bytes);
+ synchronized (loader) {
+ WeavingAdaptor weavingAdaptor = WeaverContainer.getWeaver(loader, weavingContext);
+ if (weavingAdaptor == null) {
+ if (trace.isTraceEnabled()) trace.exit("preProcess",bytes);
+ return bytes;
+ }
+ return weavingAdaptor.weaveClass(className, bytes);
+ }
} catch (Exception t) {
trace.error("preProcess",t);
//FIXME AV wondering if we should have the option to fail (throw runtime exception) here