2002-12-30 21:31:30 +01:00
|
|
|
import org.aspectj.testing.Tester;
|
|
|
|
|
|
|
|
/** @testcase subtype pattern in dominates should pick out aspect subtypes */
|
|
|
|
public class DominatesTypePatternCE {
|
|
|
|
public static void main (String[] args) {
|
|
|
|
String s = new C().method();
|
|
|
|
Tester.check("pass".equals(s),
|
|
|
|
"\"pass\".equals(\"" + s + "\")");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class C {}
|
|
|
|
|
|
|
|
// works if A is specified explicitly
|
2003-01-14 18:33:36 +01:00
|
|
|
abstract aspect AA { declare precedence: AA, AA+; // CE, AA is matched by both pieces
|
2002-12-30 21:31:30 +01:00
|
|
|
public String C.method() { return "pass"; }
|
|
|
|
}
|
|
|
|
|
|
|
|
aspect A extends AA {
|
|
|
|
public String C.method() { return "fail"; }
|
|
|
|
}
|