Community
Participate
Working Groups
In the following code, I get a warning in the pointcut definition with the following text: "does not match because declaring type is p.Shape, if match desired use target(p.Triangle) [Xlint:unmatchedSuperTypeInCall]", But the advice does match in the call in the main method. It seems like this warning should not be there. package p; class Shape { public void m() { } } class Triangle extends Shape { public void m() { } } aspect Aspect { pointcut callMethTriangle() : call (public void Triangle.m()); before(Triangle t) : callMethTriangle() && target(t){ System.out.println("Triangle avdice"); } public static void main(String[] args) { Shape s = new Triangle(); ((Triangle) s).m(); } }