--- /dev/null
+package bug; // I used a "bug" package under the "src" source folder.
+
+public aspect CantMatchOnInterfaceIntroducedToGenericClass {
+ public static interface Marker {}
+ public static class NonGenericClass {
+ public void doit(String msg) {
+ System.out.println("doit(): msg = "+msg);
+ }
+ }
+ public static class GenericClass<T> {
+ public void doit(T t) {
+ System.out.println("doit<T>(): t = "+t);
+ }
+ }
+
+ declare parents: NonGenericClass implements Marker;
+ declare parents: GenericClass implements Marker;
+
+ pointcut nonGenericCall(): call (void NonGenericClass.doit(..));
+ pointcut genericCall(): call (void GenericClass.doit(..));
+ pointcut markerCall(): call (void Marker+.doit(..));
+
+ private static int mCount = 0;
+
+ before(): nonGenericCall() {
+ System.out.println("nonGenericCall advice hit");
+ }
+ before(): genericCall() {
+ System.out.println("genericCall advice hit");
+ }
+ before(): markerCall() {
+ mCount++;
+ System.out.println("markerCall advice hit");
+ }
+
+ public static void main(String args[]) {
+ new NonGenericClass().doit("message1");
+ new GenericClass<Integer>().doit(new Integer(2));
+ if (mCount!=2) {
+ throw new RuntimeException("Did not hit marker+ advice twice!");
+ }
+ }
+}
public class Ajc161Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
// AspectJ1.6.1
+ public void testGenericMarkerMatch_pr203367() { runTest("generic marker match");}
// public void testSuperItds_pr134425() { runTest("super itds"); }
public void testSuperItds_pr198196_1() { runTest("super itds - 2"); }
public void testSuperItds_pr198196_2() { runTest("super itds - 3"); }
<!-- AspectJ v1.6.1 Tests -->
<suite>
+ <ajc-test dir="bugs161/pr203367" title="generic marker match">
+ <compile files="CantMatchOnInterfaceIntroducedToGenericClass.java" options="-1.5"/>
+ <run class="bug.CantMatchOnInterfaceIntroducedToGenericClass"/>
+ </ajc-test>
+
<ajc-test dir="bugs161/pr198196" title="super itds - 2">
<compile files="Marker.java Foo.java MarkerAspect2.java"/>
<run class="Foo">