Project: AspectJ
Bug 151182 NPE in BcelWeaver using LTW
Reported: 2006-07-20 02:50:53 | Status: resolved fixed

Hi, I created a logging aspect for our application some time ago using 1.5.0 of AspectJ. I enabled this from time to time using Load Time Weaving. I have recently recompiled the aspect using 1.5.2 and tried to run it also using the 1.5.2 weaver jar, but it fails with a NullPointerException. This is part of one of the many stacktraces: 20 jul 2006 07:42:49,046 - java.lang.NullPointerException 20 jul 2006 07:42:49,062 - at org.aspectj.weaver.bcel.BcelWeaver.weaveParentTypeMungers(BcelWeaver.java:1367) 20 jul 2006 07:42:49,062 - at org.aspectj.weaver.bcel.BcelWeaver.weaveParentsFor(BcelWeaver.java:1237) 20 jul 2006 07:42:49,062 - at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeaver.java:1072) 20 jul 2006 07:42:49,062 - at org.aspectj.weaver.tools.WeavingAdaptor.getWovenBytes(WeavingAdaptor.java:284) 20 jul 2006 07:42:49,062 - at org.aspectj.weaver.tools.WeavingAdaptor.weaveClass(WeavingAdaptor.java:212) 20 jul 2006 07:42:49,062 - at org.aspectj.weaver.loadtime.Aj.preProcess(Aj.java:65) 20 jul 2006 07:42:49,062 - at org.aspectj.weaver.loadtime.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:55) 20 jul 2006 07:42:49,062 - at sun.instrument.TransformerManager.transform(Unknown Source) 20 jul 2006 07:42:49,062 - at sun.instrument.InstrumentationImpl.transform(Unknown Source) 20 jul 2006 07:42:49,062 - at java.lang.ClassLoader.defineClass1(Native Method) 20 jul 2006 07:42:49,062 - at java.lang.ClassLoader.defineClass(Unknown Source) I then tried with the 1.5.0 weaver jar (although the aspect was compiled using 1.5.2) and this ran without problems.

Files changed in fix:
loadtime/src/org/aspectj/weaver/loadtime/Aj.java