Community
Participate
Working Groups
Created attachment 96362 [details] Core dump ajc 1.5.4 reports an internal compiler error for an abstract method that is not implemented. Given: ------------------------------------ public interface FigureElement { public void moveBy(int dx, int dy); } public class Point implements FigureElement { private int x = 0, y = 0; Point(int x, int y) { super(); this.x = x; this.y = y; } public void moveBy(int dx, int dy) { x += dx; y += dy; } public String toString() { return "(" + x + ", " + y + ")"; } } public interface Drawable { public void draw(); } ------------------------------------ The aspect: ------------------------------------ public aspect Draw { declare parents: FigureElement extends Drawable; /* public void Point.draw() { System.out.println("drawing point: " + this); } */ } ------------------------------------ Resutls in an NPE and writes a core dump (attached). java.lang.NullPointerException at org.aspectj.ajdt.internal.compiler.problem.AjProblemReporter.abstractMethodMustBeImplemented(AjProblemReporter.java:231) Changing the declare parents to Point extends Drawable results in a clean error report, so the interface FigureElement is essential for this bug. Of course, uncommenting the inter-type method declaration solves the problem as well.
From Bugzilla it looks like the NPE has been addressed in AspectJ1.6.0rc1 - there are a number of bug reports with the same NPE on AjProblemReporter.java:231.
Fixed in 1.6.0 final, I just tried it.