diff options
author | mwebster <mwebster> | 2006-07-27 09:25:50 +0000 |
---|---|---|
committer | mwebster <mwebster> | 2006-07-27 09:25:50 +0000 |
commit | 397a19d441eaf7fdc67e841232b410358b48ba11 (patch) | |
tree | a67e0abd10469f848e5ad8eca9cd853a72623930 /loadtime | |
parent | cb812785a69a69f6eaa70ce959ea72c84062daa0 (diff) | |
download | aspectj-397a19d441eaf7fdc67e841232b410358b48ba11.tar.gz aspectj-397a19d441eaf7fdc67e841232b410358b48ba11.zip |
Bug 151182 "NPE in BcelWeaver using LTW" (synchronize(loader) for adaptor create, initialize and weave)
Diffstat (limited to 'loadtime')
-rw-r--r-- | loadtime/src/org/aspectj/weaver/loadtime/Aj.java | 14 |
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 |