Project: AspectJ
Bug 203367 ITD of interface on generic type; can't match calls to methods on interface+
Reported: 2007-09-13 17:23:51 | Status: resolved fixed

Build ID: I20070621-1340 Steps To Reproduce: 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(..)); before(): nonGenericCall() { System.out.println("nonGenericCall: "+thisJoinPointStaticPart); } before(): genericCall() { System.out.println("genericCall: "+thisJoinPointStaticPart); } before(): markerCall() { System.out.println("markerCall: "+thisJoinPointStaticPart); } public static void main(String args[]) { new NonGenericClass().doit("message1"); new GenericClass<Integer>().doit(new Integer(2)); } } More information: The code pasted in the "steps" demonstrates the bug.

Files changed in fix:
tests/bugs161/pr203367/CantMatchOnInterfaceIntroducedToGenericClass.java tests/src/org/aspectj/systemtest/ajc161/Ajc161Tests.java