]> source.dussan.org Git - aspectj.git/commitdiff
231187: test and fix. Do the parameterization check after ITDs have applied
authoraclement <aclement>
Thu, 8 May 2008 21:22:29 +0000 (21:22 +0000)
committeraclement <aclement>
Thu, 8 May 2008 21:22:29 +0000 (21:22 +0000)
tests/bugs161/pr231187x/Cement.java [new file with mode: 0644]
tests/bugs161/pr231187x/ConcreteClass.java [new file with mode: 0644]
tests/bugs161/pr231187x/Main.java [new file with mode: 0644]
tests/bugs161/pr231187x/SuperClass.java [new file with mode: 0644]
tests/bugs161/pr231187x/SuperClassAspect.aj [new file with mode: 0644]
tests/bugs161/pr231187x/WetCement.java [new file with mode: 0644]

diff --git a/tests/bugs161/pr231187x/Cement.java b/tests/bugs161/pr231187x/Cement.java
new file mode 100644 (file)
index 0000000..3fd69d0
--- /dev/null
@@ -0,0 +1,5 @@
+package concrete;
+
+public interface Cement {
+   public int getWeight();
+}
diff --git a/tests/bugs161/pr231187x/ConcreteClass.java b/tests/bugs161/pr231187x/ConcreteClass.java
new file mode 100644 (file)
index 0000000..c0eb8af
--- /dev/null
@@ -0,0 +1,19 @@
+package concrete;
+
+import java.util.Vector;
+
+public class ConcreteClass extends SuperClass<WetCement> {
+
+       @Override
+       public Vector<WetCement> getSomeTs() {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public void addSomeTs(Vector<WetCement> newTs) {
+               // TODO Auto-generated method stub
+               someTs.addAll(newTs);
+       }
+
+}
diff --git a/tests/bugs161/pr231187x/Main.java b/tests/bugs161/pr231187x/Main.java
new file mode 100644 (file)
index 0000000..2f98e15
--- /dev/null
@@ -0,0 +1,14 @@
+package concrete;
+
+import java.util.*;
+
+public class Main {
+   public static void main(String[] args) {
+     ConcreteClass cc = new ConcreteClass();
+     WetCement wc = new WetCement();
+     Vector<WetCement> v = new Vector<WetCement>();
+     v.add(wc);
+     cc.addSomeTs(v);
+     System.out.println("ran!");
+   }
+}
\ No newline at end of file
diff --git a/tests/bugs161/pr231187x/SuperClass.java b/tests/bugs161/pr231187x/SuperClass.java
new file mode 100644 (file)
index 0000000..18c1fe6
--- /dev/null
@@ -0,0 +1,8 @@
+package concrete;
+import java.util.Vector;
+
+public abstract class SuperClass<T extends Cement> {
+   Vector<T> someTs = new Vector<T>();
+   public abstract Vector<T> getSomeTs();
+   public abstract void addSomeTs(Vector<T> newTs);  
+}
diff --git a/tests/bugs161/pr231187x/SuperClassAspect.aj b/tests/bugs161/pr231187x/SuperClassAspect.aj
new file mode 100644 (file)
index 0000000..c370744
--- /dev/null
@@ -0,0 +1,12 @@
+package concrete;
+
+import java.util.Vector;
+
+
+public aspect SuperClassAspect {
+   declare parents : WetCement implements Cement;
+
+   after(SuperClass sc, Vector cm) returning: execution(void SuperClass.addSomeTs(Vector)) && target(sc) && args(cm) {
+    //  System.out.println(cm);   
+   }
+}
diff --git a/tests/bugs161/pr231187x/WetCement.java b/tests/bugs161/pr231187x/WetCement.java
new file mode 100644 (file)
index 0000000..dfefde0
--- /dev/null
@@ -0,0 +1,6 @@
+package concrete;
+
+public class WetCement {
+   boolean wet = true;
+   public int getWeight() { return 5; }
+}