Bug 324880

Summary: Spurious warning in pointcut [Xlint:unmatchedSuperTypeInCall]
Product: [Tools] AspectJ Reporter: Andrew Eisenberg <andrew.eisenberg>
Component: CompilerAssignee: aspectj inbox <aspectj-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3    
Version: 1.6.9   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Andrew Eisenberg CLA 2010-09-09 13:50:22 EDT
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();
	}
}