From 397a19d441eaf7fdc67e841232b410358b48ba11 Mon Sep 17 00:00:00 2001 From: mwebster Date: Thu, 27 Jul 2006 09:25:50 +0000 Subject: [PATCH] Bug 151182 "NPE in BcelWeaver using LTW" (synchronize(loader) for adaptor create, initialize and weave) --- loadtime/src/org/aspectj/weaver/loadtime/Aj.java | 14 ++++++++------ 1 file 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 -- 2.39.5