Bug 324880 - Spurious warning in pointcut [Xlint:unmatchedSuperTypeInCall]
Summary: Spurious warning in pointcut [Xlint:unmatchedSuperTypeInCall]
Status: NEW
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.6.9   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-09 13:50 EDT by Andrew Eisenberg CLA
Modified: 2010-09-09 13:50 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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();
	}
}