Project: AspectJ
Bug 30026 NullPointerException when compiling
Reported: 2003-01-22 17:06:50 | Status: resolved fixed

With the following program I get a NullPointerException during compiling and a warning that the source code of Object is not available for weaving: public class NullPtr { public static void main(String args[]) { NullPtr np = new NullPtr(); np = null; } public void finalize() throws Throwable { } } aspect FinalizeContract { pointcut finalizeCall(Object o): this(Object+) && this(o) && execution(void finalize()); void around(Object o) throws Throwable: finalizeCall(o) { o.finalize(); // error ((NullPtr) o).finalize(); // ok proceed(o); } } It works if I comment out the line indicated by the // error comment or if I declare the aspect as privileged.

Files changed in fix:
tests/bugs/Finalizer.java