Community
Participate
Working Groups
When I try to save and compile the following aspect, I get a compiler exception. public aspect F implements Comparable pertarget(within(F)) { } java.lang.NullPointerException at org.aspectj.weaver.ReferenceType.isAspect(ReferenceType.java:165) at org.aspectj.ajdt.internal.core.builder.AjBuildManager$4.acceptResult(AjBuildManager.java:1032) at org.aspectj.ajdt.internal.compiler.AjPipeliningCompilerAdapter.acceptResult(AjPipeliningCompilerAdapter.java:383) at org.aspectj.ajdt.internal.compiler.AjPipeliningCompilerAdapter.afterProcessing(AjPipeliningCompilerAdapter.java:356) at org.aspectj.ajdt.internal.compiler.CompilerAdapter.ajc$after$org_aspectj_ajdt_internal_compiler_CompilerAdapter$5$6b855184(CompilerAdapter.aj:98) at org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:652) at org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:392) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performCompilation(AjBuildManager.java:975) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:265) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:179) at org.aspectj.ajde.core.internal.AjdeCoreBuildManager.performBuild(AjdeCoreBuildManager.java:104) at org.aspectj.ajde.core.AjCompiler.build(AjCompiler.java:88) at org.eclipse.ajdt.core.builder.AJBuilder.build(AJBuilder.java:227) at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:633) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201) at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256) at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:309) at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:341) at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140) at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Created attachment 116000 [details] Project with failing aspect
oooo - interesting. could be the same thing as the XterminateAfterCompilation issue. nice little testcase :)
I get no crash on the command line or in AJDT. I get the expected error that the aspect doesn't implement compareTo
I see you said OS = All - did it also fail for you on windows?
i'll try it on my Mac
Yes, it was only Mac. Odd. Maybe something else was going on. Going to try it in a different workspace.
Still throwing the same error for me. I tried it on a clean workspace with the AJDT Version: 1.6.1.200810222003 and AspectJ version: 1.6.3.20081019220500.
ok - finally recreated it on my Mac. It is a problem related to building broken code, and we knew there would be a few, where we try to soldier on even though the source isn't valid. The error about not implementing Comparable is created and we return from compilation early. We return before the delegate is setup properly for the inner interface $ajcMightHaveAspect that is created due to the per clause. The delegate being null then causes the problem. Test and fix committed. I don't believe the other users with null delegate problems were building broken code (I know some were just binary weaving) so I doubt my fix will help them.