Community
Participate
Working Groups
If you omit the @aspect annotation when using @pointcut you get a nice error but not if it's a pointcut library referenced from another aspect: java.lang.NullPointerException at org.aspectj.weaver.patterns.ReferencePointcut.concretize1(ReferencePointcut.java:361) at org.aspectj.weaver.patterns.Pointcut.concretize(Pointcut.java:233) at org.aspectj.weaver.patterns.Pointcut.concretize(Pointcut.java:220) at org.aspectj.weaver.Advice.concretize(Advice.java:353) at org.aspectj.weaver.bcel.BcelAdvice.concretize(BcelAdvice.java:86) at org.aspectj.weaver.CrosscuttingMembers.addShadowMu ... pter.java:107) at org.aspectj.ajde.internal.AspectJBuildManager$CompilerThread.run(AspectJBuildManager.java:191) NullPointerException thrown: null
Created attachment 52829 [details] Testcase The NPE only seems to occur with the older version of AspectJ 1.5.3-200608290814 that I have installed with AJDT. This testcase just yields: warning at C:\temp\ajcSandbox\org.aspectj-159854\ajcTest11388.tmp\test\ataspectj\pointcutlibrary\AtAspect.java:15::0 advice defined in test.ataspectj.pointcutlibrary.AtAspect has not been applied [Xlint:adviceDidNotMatch]
Is this anything to do with bug 158412 which was fixed on the 25th September?
It does seem the same. Now if you omit the @aspect annotation the pointcut _sometime_ does not match. I think we should issue an error message.
check this for 1.5.4 - is there still something to address here?
although the npe is gone, there is a still a problem here where we fail to correctly resolve @AspectJ pointcuts - if they don't get resolved then they fail to match. If they come in from a class in a .jar that is OK, the problem is when they are compiled all from source and exist as pointcuts in a regular class. I have had to change resolution quite a bit to allow for this but I seem to almost have a solution ready to commit.
Fixes committed for this. I modified the resolution process for @AJ pointcuts to correctly build LazyResolvedPointcutDefinitions. Also I changed a lot of the code that searches for @AspectJ annotations - that should be much faster now.
Created attachment 83250 [details] mylyn/context/zip
fix will be in next dev build