Community
Participate
Working Groups
The following mistake causes a NPE: // mistake caused compiler crash rather than error thisJoinPoint.getSignature.toLongString() // CE 22 // correct //thisJoinPointStaticPart.getSignature().toLongString() Top of stack trace: org.aspectj.ajdt.internal.compiler.ast.ThisJoinPointVisitor.getEquivalentStaticBinding(ThisJoinPointVisitor.java:178) at org.aspectj.ajdt.internal.compiler.ast.ThisJoinPointVisitor.replaceEffectivelyStaticRef(ThisJoinPointVisitor.java:173) at org.aspectj.ajdt.internal.compiler.ast.ThisJoinPointVisitor.visit(ThisJoinPointVisitor.java:142) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.MessageSend.traverse(MessageSend.java:341) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.BinaryExpression.traverse(BinaryExpression.java:1756) See test at tests/bugs/TjpMistake.java
Fixed checked in (and testcase moved from ajcTestsFailing to ajc121-tests.xml). The fix is in the optimization code for method calls on this join point objects which says that if the call could be satisfied by a method on thisJoinPointStaticPart then use that rather than thisJoinPoint. The fix is to say that if the binding for the target of the call is null then don't attempt the optimization (because we are about to put out an error for this line of code anyway!). Waiting for build before closing bug.
Fix available: BUILD COMPLETE - build.379 Date of build: 09/30/2004 12:34:06 Time to build: 105 minutes 47 seconds Last changed: 09/30/2004 09:18:34 Last log entry: Fix for Bugzilla Bug 75129 NPE on thisJoinPoint mistake Latest good AspectJ jar available at: download.eclipse.org/technology/ajdt/dev/aspectj-DEVELOPMENT.jar
Fix released as part of AspectJ 1.2.1