Community
Participate
Working Groups
Reported on the mailing list by Simone: I tried disabling pipelining as described in bug 146781, that is using -Xset:pipelineCompilation=false, but unfortunately I get this error while compiling with -XterminateAfterCompilation : java.lang.NullPointerException at org.aspectj.weaver.ReferenceType.isAspect(ReferenceType.java:160) at org.aspectj.ajdt.internal.core.builder.AjBuildManager$4.addAspectName(AjBuildManager.java:1108) at org.aspectj.ajdt.internal.core.builder.AjBuildManager$4.acceptResult(AjBuildManager.java:1047) at
I've been trying to recreate this, but I can't so can't make a fix. The stack trace is from the logic driven due to -outxml being specified. However, I have no clue why the delegate is null when isAspect() is being called against the reference type. I have a few bugs where the delegate is unexpectedly null, I don't yet know if they all have the same root cause. I've tried combining -XterminateAfterCompilation and -Xset:pipelineCompilation=false but it doesn't fail. Can you tell me if the code you are processing with the command that fails has already been woven in an earlier compile?
Hi Andy, now that I have better knowledge of the testing system, I'll try to setup a test case. Anyway, most probably it is already pre-woven with other aspects. It is inside a maven build of multiple modules, all having aspects. Removing -outxml works like a charm.
I just committed a fix under another bug for a null delegate (which is the situation here too). The problem was that the delegate was null for a type generated during the compilation process (eg. a marker interface for a perclause). If the problems here with -XterminateAfterCompilation and -outxml also involved aspects with perclauses (or some other construct that would lead to generation of a class at compile time) then it may be the same issue here and so also resolved. Here is a program that crashes: public aspect Foo perthis(execution(* *(..))) { } ajc -1.5 -XterminateAfterCompilation -outxml Foo.java java.lang.NullPointerException at org.aspectj.weaver.ReferenceType.isAspect(ReferenceType.java:165) at org.aspectj.ajdt.internal.core.builder.AjBuildManager$4.addAspectName(AjBuildManager.java:1095) at org.aspectj.ajdt.internal.core.builder.AjBuildManager$4.acceptResult(AjBuildManager.java:1040) I've confirmed this is now fixed in AspectJ. No dev build for a while due to test failures on the build machine (classpath related) - fix will be in next successful dev build.