]> source.dussan.org Git - aspectj.git/commitdiff
272825: test and fix: super method call with generic itds
authoraclement <aclement>
Thu, 30 Apr 2009 20:29:38 +0000 (20:29 +0000)
committeraclement <aclement>
Thu, 30 Apr 2009 20:29:38 +0000 (20:29 +0000)
tests/bugs165/pr272825/Concrete.java [new file with mode: 0644]
tests/bugs165/pr272825/GenericSuper.java [new file with mode: 0644]
tests/bugs165/pr272825/ITDOfMethod.aj [new file with mode: 0644]
tests/bugs165/pr272825/Main.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc165/Ajc165Tests.java
tests/src/org/aspectj/systemtest/ajc165/ajc165.xml

diff --git a/tests/bugs165/pr272825/Concrete.java b/tests/bugs165/pr272825/Concrete.java
new file mode 100644 (file)
index 0000000..5ae8a52
--- /dev/null
@@ -0,0 +1,9 @@
+public class Concrete extends GenericSuper<Integer>{
+
+       @Override
+       public void doSomethingElseWith(Integer t) {
+               System.out.println("In normal method");
+               super.doSomethingElseWith(t);
+       }
+       
+}
diff --git a/tests/bugs165/pr272825/GenericSuper.java b/tests/bugs165/pr272825/GenericSuper.java
new file mode 100644 (file)
index 0000000..fef8ff2
--- /dev/null
@@ -0,0 +1,13 @@
+public class GenericSuper<T> {
+
+       public void doSomethingWith(T t) {
+               System.out.println("with");
+               System.out.println(t.toString());
+       }
+       
+       public void doSomethingElseWith(T t) {
+               System.out.println("else");
+               System.out.println(t);
+       }
+       
+}
diff --git a/tests/bugs165/pr272825/ITDOfMethod.aj b/tests/bugs165/pr272825/ITDOfMethod.aj
new file mode 100644 (file)
index 0000000..77988aa
--- /dev/null
@@ -0,0 +1,8 @@
+public aspect ITDOfMethod {
+
+       public void Concrete.doSomethingWith(Integer i) {
+               System.out.println("In ITD method");
+               super.doSomethingWith(i);
+       }
+       
+}
diff --git a/tests/bugs165/pr272825/Main.java b/tests/bugs165/pr272825/Main.java
new file mode 100644 (file)
index 0000000..9fb8cf0
--- /dev/null
@@ -0,0 +1,9 @@
+public class Main {
+       
+       public static void main(String args[]) {
+               Concrete c = new Concrete();
+               c.doSomethingElseWith(1);
+               c.doSomethingWith(2);
+       }
+       
+}
index e405210f1d550f28053d068588dfc59f00fa29e8..dcb857f8d7efa030b53eb1e32a1a8c316a619c20 100644 (file)
@@ -57,6 +57,10 @@ public class Ajc165Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
                runTest("around call npe");
        }
 
+       public void testGenericITD_pr272825() {
+               runTest("generic ITD");
+       }
+       
        // ---
 
        public static Test suite() {
index 723a4e0ce60fd23b7b41ef6ac33e16c9aa4d6a4d..c15e75830222c7673ca806da07b690977be41737 100644 (file)
      <run class="p.TestPointcutAnnotationAspect"/>
    </ajc-test>
 
+   <ajc-test dir="bugs165/pr272825" title="generic ITD">
+     <compile files="Concrete.java GenericSuper.java ITDOfMethod.aj Main.java" options="-1.5"/>
+     <run class="Main">
+       <stdout>
+         <line text="In normal method"/>
+         <line text="else"/>
+         <line text="1"/>
+         <line text="In ITD method"/>
+         <line text="with"/>
+         <line text="2"/>
+       </stdout>
+     </run>
+   </ajc-test>
+
 </suite>
\ No newline at end of file