--- /dev/null
+public aspect SomeAspect {
+ declare parents: SomeBaseClass implements SomeInterface;
+ declare parents: SomeBaseClass3 implements SomeInterface;
+
+ before() : execution(* (SomeInterface+).tag*(..)) {
+ System.out.println("correct advice :-)");
+ }
+
+ before() : execution(* (!SomeInterface+).tag*(..)) {
+ System.out.println("this advice should never run...");
+ }
+}
+
--- /dev/null
+public class SomeBaseClass<Type extends Object> {
+
+ public void tag_someBaseMethod() {
+ System.out.println("some base method");
+ }
+
+ public static void main(String[] args) {
+ new SomeBaseClass<Object>().tag_someBaseMethod();
+ new SomeSubClass().tag_someMethod(); // this does not match correctly...
+ System.out.println("");
+
+ new SomeBaseClass2<Object>().tag_someBaseMethod();
+ new SomeSubClass2().tag_someMethod();
+ System.out.println("");
+
+ new SomeBaseClass3().tag_someBaseMethod();
+ new SomeSubClass3().tag_someMethod();
+ }
+}
+
--- /dev/null
+public class SomeBaseClass2<Type extends Object> implements SomeInterface {
+ public void tag_someBaseMethod() {
+ System.out.println("some base method2");
+ }
+}
+
--- /dev/null
+public class SomeBaseClass3 {
+ public void tag_someBaseMethod() {
+ System.out.println("some base method3");
+ }
+}
+
+
--- /dev/null
+public interface SomeInterface {}
--- /dev/null
+public class SomeSubClass extends SomeBaseClass<Integer> {
+
+ // this method is not matched correctly...
+ public void tag_someMethod() {
+ System.out.println("some sub method");
+ }
+}
+
--- /dev/null
+public class SomeSubClass2 extends SomeBaseClass2<Integer> {
+
+ // this method matches correctly
+ public void tag_someMethod() {
+ System.out.println("some sub method2");
+ }
+}
+
+
\ No newline at end of file
--- /dev/null
+public class SomeSubClass3 extends SomeBaseClass3 {
+
+ // this method matches correctly
+ public void tag_someMethod() {
+ System.out.println("some sub method3");
+ }
+}
+
public class Ajc162Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
// AspectJ1.6.2
+ public void testGenericDecp_pr241047() { runTest("generic decp"); }
public void testGenericItds_pr242797_1() { runTest("generic itds - 1"); }
// public void testParamAnnosPipelining_pr241847() { runTest("param annos pipelining");}
// public void testParamAnnoInner_pr241861() { runTest("param annotation inner class"); }
<!-- AspectJ v1.6.2 Tests -->
<suite>
+ <ajc-test dir="bugs162/pr241047" title="generic decp">
+ <compile files="SomeAspect.java SomeBaseClass.java SomeSubClass.java SomeSubClass2.java SomeSubClass3.java SomeInterface.java SomeBaseClass2.java SomeBaseClass3.java" options=" -Xlint:ignore -1.5">
+ </compile>
+ <run class="SomeBaseClass">
+ <stdout>
+ <line text="correct advice :-)"/>
+ <line text="some base method"/>
+ <line text="correct advice :-)"/>
+ <line text="some sub method"/>
+ <line text=""/>
+ <line text="correct advice :-)"/>
+ <line text="some base method2"/>
+ <line text="correct advice :-)"/>
+ <line text="some sub method2"/>
+ <line text=""/>
+ <line text="correct advice :-)"/>
+ <line text="some base method3"/>
+ <line text="correct advice :-)"/>
+ <line text="some sub method3"/>
+ </stdout>
+ </run>
+ </ajc-test>
+
<ajc-test dir="bugs162/pr242797/case1" title="generic itds - 1">
<compile files="ClassUtils.java CMEFinder.java Finder.java H2Deployment.java Localized.java LocalizedFinder.java OnetElement.java OnetFinder.java Partitioned.java PartitionedFinder.java" options="-1.5">
</compile>