--- /dev/null
+interface P<T> {
+ public T pm(T t);
+// public String pm2(String t);
+}
+
+interface C extends P<String> {
+ public void cm();
+}
+
+class CImpl implements C {
+ public void cm() {}
+ public String pm(String s) { System.err.println(s);return s;}
+// public String pm2(String s) { return s;}
+}
+
+public class B {
+
+ public static void main(String []argv) {
+ C test = new CImpl();
+ test.pm("foo"); // manifests as 'Object pm(Object) call' due to type C being used
+// test.pm2("foo");
+ }
+}
+
+aspect X {
+ before(): call(* pm(..)) { System.err.println("advice");}
+// before(): call(* pm2(..)) {}
+}
\ No newline at end of file
--- /dev/null
+interface P<T> {
+ public T pm(T t);
+ public String pm2(String t);
+}
+
+interface C extends P<String> {
+ public void cm();
+}
+
+class CImpl implements C {
+ public void cm() {}
+ public String pm(String s) { System.err.println(s);return s;}
+ public String pm2(String s) { System.err.println(s);return s;}
+}
+
+public class D {
+
+ public static void main(String []argv) {
+ CImpl test = new CImpl();
+ test.pm("foo"); // manifests as 'String pm(String) call' due to type CImpl being used
+ test.pm2("foo");
+ }
+}
+
+aspect X {
+ before(): call(* pm(..)) { System.err.println("advice");}
+ before(): call(* pm2(..)) { System.err.println("advice2");}
+}
\ No newline at end of file
--- /dev/null
+interface P<T> {
+ public T pm(T t);
+}
+
+interface C extends P<String> {
+ public void cm();
+}
+
+class CImpl implements C {
+ public void cm() {}
+ public String pm(String s) { System.err.println(s);return s;}
+}
+
+public class E {
+
+ public static void main(String []argv) {
+ C test = new CImpl();
+ test.pm("foo"); // manifests as 'Object pm(Object) call' due to type C being used
+ }
+}
+
+aspect X {
+ before(): call(* pm(String)) { System.err.println("advice");} // matches?
+}
\ No newline at end of file
--- /dev/null
+interface P<T> {
+ public T pm(T t);
+}
+
+interface C extends P<String> {
+ public void cm();
+}
+
+class CImpl implements C {
+ public void cm() {}
+ public String pm(String s) { System.err.println(s);return s;}
+}
+
+public class F {
+
+ public static void main(String []argv) {
+ C test = new CImpl();
+ test.pm("foo"); // manifests as 'Object pm(Object) call' due to type C being used
+ }
+}
+
+aspect X {
+ before(): call(String pm(..)) { System.err.println("advice");} // matches?
+}
\ No newline at end of file
--- /dev/null
+interface P<T> {
+ public T pm(T t);
+}
+
+interface C extends P<String> {
+ public void cm();
+}
+
+class CImpl implements C {
+ public void cm() {}
+ public String pm(String s) { System.err.println(s);return s;}
+}
+
+public class G {
+
+ public static void main(String []argv) {
+ C test = new CImpl();
+ test.pm("foo"); // manifests as 'Object pm(Object) call' due to type C being used
+ }
+}
+
+aspect X {
+ before(): call(* pm(Object)) { System.err.println("advice");} // no match...
+}
\ No newline at end of file
public class Ajc152Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
+ public void testPointcutsAndGenerics_pr137496_1() { runTest("pointcuts and generics - B");}
+ public void testPointcutsAndGenerics_pr137496_2() { runTest("pointcuts and generics - D");}
+ public void testPointcutsAndGenerics_pr137496_3() { runTest("pointcuts and generics - E");}
+ public void testPointcutsAndGenerics_pr137496_4() { runTest("pointcuts and generics - F");}
+ public void testPointcutsAndGenerics_pr137496_5() { runTest("pointcuts and generics - G");}
public void testAspectLibrariesAndASM_pr135001() { runTest("aspect libraries and asm");}
public void testStackOverflow_pr136258() { runTest("stack overflow");}
public void testIncorrectOverridesEvaluation13() { runTest("incorrect overrides evaluation - 1.3"); }
<run class="StatisticsTypeImpl"/>
</ajc-test>
+ <ajc-test dir="bugs152/pr137496" title="pointcuts and generics - B">
+ <compile files="B.java" options="-1.5 -showWeaveInfo">
+ <!--message kind="weave" text="Join point 'method-call(java.lang.String C.pm(java.lang.String))' in Type 'B' (B.java:20) advised by before advice from 'X' (B.java:26)"/-->
+ <message kind="weave" text="Join point 'method-call(java.lang.Object C.pm(java.lang.Object))' in Type 'B' (B.java:20) advised by before advice from 'X' (B.java:26)"/>
+ <!--message kind="weave" text="Join point 'method-call(java.lang.String C.pm2(java.lang.String))' in Type 'B' (B.java:21) advised by before advice from 'X' (B.java:27)"/-->
+ </compile>
+ <run class="B">
+ <stderr>
+ <line text="advice"/>
+ <line text="foo"/>
+ </stderr>
+ </run>
+ </ajc-test>
+
+ <ajc-test dir="bugs152/pr137496" title="pointcuts and generics - D">
+ <compile files="D.java" options="-1.5 -showWeaveInfo">
+ <message kind="weave" text="Join point 'method-call(java.lang.String CImpl.pm(java.lang.String))' in Type 'D' (D.java:20) advised by before advice from 'X' (D.java:26)"/>
+ <message kind="weave" text="Join point 'method-call(java.lang.String CImpl.pm2(java.lang.String))' in Type 'D' (D.java:21) advised by before advice from 'X' (D.java:27)"/>
+ </compile>
+ <run class="D">
+ <stderr>
+ <line text="advice"/>
+ <line text="foo"/>
+ <line text="advice2"/>
+ <line text="foo"/>
+ </stderr>
+ </run>
+ </ajc-test>
+
+ <ajc-test dir="bugs152/pr137496" title="pointcuts and generics - E">
+ <compile files="E.java" options="-1.5 -showWeaveInfo">
+ <message kind="weave" text="Join point 'method-call(java.lang.Object C.pm(java.lang.Object))' in Type 'E' (E.java:18) advised by before advice from 'X' (E.java:23)"/>
+ </compile>
+ <run class="E">
+ <stderr>
+ <line text="advice"/>
+ <line text="foo"/>
+ </stderr>
+ </run>
+ </ajc-test>
+
+
+ <ajc-test dir="bugs152/pr137496" title="pointcuts and generics - F">
+ <compile files="F.java" options="-1.5 -showWeaveInfo">
+ <message kind="weave" text="Join point 'method-call(java.lang.Object C.pm(java.lang.Object))' in Type 'F' (F.java:18) advised by before advice from 'X' (F.java:23)"/>
+ </compile>
+ <run class="F">
+ <stderr>
+ <line text="advice"/>
+ <line text="foo"/>
+ </stderr>
+ </run>
+ </ajc-test>
+
+ <ajc-test dir="bugs152/pr137496" title="pointcuts and generics - G">
+ <compile files="G.java" options="-1.5 -showWeaveInfo">
+ <message kind="warning" line="23" text="advice defined in X has not been applied [Xlint:adviceDidNotMatch]"/>
+ </compile>
+ <run class="G">
+ <stderr>
+ <line text="foo"/>
+ </stderr>
+ </run>
+ </ajc-test>
+
<ajc-test dir="bugs152/binaryDecp" title="incorrect overrides evaluation - 1.3">
<compile files="SubClassLoader.java,SubSubClassLoader.java" options="-1.3" outjar="lib.jar"/>
<compile files="X.aj" inpath="lib.jar" options="-showWeaveInfo">