]> 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:13:45 +0000 (21:13 +0000)
committeraclement <aclement>
Thu, 8 May 2008 21:13:45 +0000 (21:13 +0000)
tests/bugs161/pr231187/Cement.java [new file with mode: 0644]
tests/bugs161/pr231187/ConcreteClass.java [new file with mode: 0644]
tests/bugs161/pr231187/Main.java [new file with mode: 0644]
tests/bugs161/pr231187/SuperClass.java [new file with mode: 0644]
tests/bugs161/pr231187/SuperClassAspect.aj [new file with mode: 0644]
tests/bugs161/pr231187/WetCement.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc161/Ajc161Tests.java
tests/src/org/aspectj/systemtest/ajc161/ajc161.xml

diff --git a/tests/bugs161/pr231187/Cement.java b/tests/bugs161/pr231187/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/pr231187/ConcreteClass.java b/tests/bugs161/pr231187/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/pr231187/Main.java b/tests/bugs161/pr231187/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/pr231187/SuperClass.java b/tests/bugs161/pr231187/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/pr231187/SuperClassAspect.aj b/tests/bugs161/pr231187/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/pr231187/WetCement.java b/tests/bugs161/pr231187/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; }
+}
index 7f0f6fd49878efd81bc1eeb0c022abafd7b7437c..f9346d8b334e7ef31b9dcedb724c0fe8c6661418 100644 (file)
@@ -19,6 +19,8 @@ import org.aspectj.testing.XMLBasedAjcTestCase;
 public class Ajc161Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
        
        // AspectJ1.6.1
+    public void testGenericsBoundsDecp_pr231187() { runTest("generics bounds decp"); }
+    public void testGenericsBoundsDecp_pr231187_2() { runTest("generics bounds decp - 2"); }
        public void testLtwInheritedCflow_pr230134() { runTest("ltw inherited cflow"); }
     public void testAroundAdviceOnFieldSet_pr229910() { runTest("around advice on field set"); }
     public void testPipelineCompilationGenericReturnType_pr226567() { runTest("pipeline compilation and generic return type"); }
index f864b64b24c10e17537732e41671880c6e5418b8..b05dc4eee46318d17d69d9fe175991c4fa2d3aaa 100644 (file)
@@ -3,6 +3,21 @@
 <!-- AspectJ v1.6.1 Tests -->
 <suite>
 
+    <ajc-test dir="bugs161/pr231187" title="generics bounds decp">
+        <compile files="Cement.java ConcreteClass.java SuperClass.java SuperClassAspect.aj WetCement.java Main.java" options="-1.5"/>
+        <run class="concrete.Main">
+          <stdout>
+            <line text="ran!"/>
+          </stdout>
+        </run>
+    </ajc-test> 
+    
+    <ajc-test dir="bugs161/pr231187" title="generics bounds decp - 2">
+        <compile files="Cement.java ConcreteClass.java SuperClass.java WetCement.java" options="-1.5">
+          <message kind="error" text="The type WetCement is not a valid substitute for the bounded parameter"/>
+        </compile>
+    </ajc-test> 
+    
     <ajc-test dir="bugs161/pr230134" title="ltw inherited cflow">
       <compile files="HW.java"/>
       <compile files="SimpleTracing.java Tracing.java HelloWorldTracing.java" outjar="foo.jar"/>