Project: AspectJ
Bug 103266 NPE on syntax error
Reported: 2005-07-10 01:40:14 | Status: resolved fixed

This example program generates an NPE on CVS HEAD and M2. I will attach the ajcore file. public abstract aspect WorkerExample { after() returning (RequestContext newContext) : call(RequestContext+.new (..)) { System.out.println("constructing "+newContext+" at "+thisJoinPoint.toLongString()+" from "+thisEnclosingJoinPointStaticPart+":"); } public abstract class RequestContext { public final Object execute() { return doExecute(); } /** template method */ public abstract Object doExecute(); } public static void main(String args[]) { new Runnable() { public void run() {} }.run(); }; } aspect ConcreteAlpha extends WorkerExample { Object around(final Object runnable) : execution(void Runnable.run()) && this(runnable) { System.out.println("monitoring operation: "+runnable+" at "+thisJoinPoint+", for "+thisJoinPoint.getThis()); RequestContext requestContext = new RequestContext() { public Object doExecute() { return proceed(runnable); } }; return requestContext.execute(); } } aspect ConcreteBeta extends WorkerExample { Object around() : call(void awqeyuwqer()) { RequestContext requestContext = new ConnectionRequestContext() { public Object doExecute() { return proceed(); } }; return requestContext.execute(); } }

Files changed in fix:
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/MakeDeclsPublicVisitor.java tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java