]> source.dussan.org Git - aspectj.git/commitdiff
318884: incremental: parameterization change on method/ctor
authoraclement <aclement>
Mon, 5 Jul 2010 22:52:07 +0000 (22:52 +0000)
committeraclement <aclement>
Mon, 5 Jul 2010 22:52:07 +0000 (22:52 +0000)
tests/multiIncremental/pr318884_3/base/src/A.java [new file with mode: 0644]
tests/multiIncremental/pr318884_3/base/src/B.java [new file with mode: 0644]
tests/multiIncremental/pr318884_3/inc1/src/B.java [new file with mode: 0644]
tests/multiIncremental/pr318884_4/base/src/A.java [new file with mode: 0644]
tests/multiIncremental/pr318884_4/base/src/B.java [new file with mode: 0644]
tests/multiIncremental/pr318884_4/inc1/src/B.java [new file with mode: 0644]
tests/multiIncremental/pr318884_5/base/src/A.java [new file with mode: 0644]
tests/multiIncremental/pr318884_5/base/src/B.java [new file with mode: 0644]
tests/multiIncremental/pr318884_5/inc1/src/B.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/incremental/tools/IncrementalCompilationTests.java

diff --git a/tests/multiIncremental/pr318884_3/base/src/A.java b/tests/multiIncremental/pr318884_3/base/src/A.java
new file mode 100644 (file)
index 0000000..d11d167
--- /dev/null
@@ -0,0 +1,7 @@
+import java.util.*;
+
+public class A extends B {
+  public List<String> foo() {
+    return null;
+  }
+}
diff --git a/tests/multiIncremental/pr318884_3/base/src/B.java b/tests/multiIncremental/pr318884_3/base/src/B.java
new file mode 100644 (file)
index 0000000..6ccf181
--- /dev/null
@@ -0,0 +1,7 @@
+import java.util.*;
+
+public class B {
+  public List<String> foo() {
+    return null;
+  }
+}
diff --git a/tests/multiIncremental/pr318884_3/inc1/src/B.java b/tests/multiIncremental/pr318884_3/inc1/src/B.java
new file mode 100644 (file)
index 0000000..e96d963
--- /dev/null
@@ -0,0 +1,7 @@
+import java.util.*;
+
+public class B {
+  public List<Integer> foo() {
+    return null;
+  }
+}
diff --git a/tests/multiIncremental/pr318884_4/base/src/A.java b/tests/multiIncremental/pr318884_4/base/src/A.java
new file mode 100644 (file)
index 0000000..292362f
--- /dev/null
@@ -0,0 +1,6 @@
+import java.util.*;
+
+public class A extends B {
+  public void foo(List<String> ls) {
+  }
+}
diff --git a/tests/multiIncremental/pr318884_4/base/src/B.java b/tests/multiIncremental/pr318884_4/base/src/B.java
new file mode 100644 (file)
index 0000000..94fbe37
--- /dev/null
@@ -0,0 +1,6 @@
+import java.util.*;
+
+public class B {
+  public void foo(List<String> ls) {
+  }
+}
diff --git a/tests/multiIncremental/pr318884_4/inc1/src/B.java b/tests/multiIncremental/pr318884_4/inc1/src/B.java
new file mode 100644 (file)
index 0000000..c30445f
--- /dev/null
@@ -0,0 +1,6 @@
+import java.util.*;
+
+public class B {
+  public void foo(List<Integer> ln) {
+  }
+}
diff --git a/tests/multiIncremental/pr318884_5/base/src/A.java b/tests/multiIncremental/pr318884_5/base/src/A.java
new file mode 100644 (file)
index 0000000..ea48867
--- /dev/null
@@ -0,0 +1,7 @@
+import java.util.*;
+
+public class A extends B {
+  A(List<String> ls) {
+    super(ls);
+  }
+}
diff --git a/tests/multiIncremental/pr318884_5/base/src/B.java b/tests/multiIncremental/pr318884_5/base/src/B.java
new file mode 100644 (file)
index 0000000..4114654
--- /dev/null
@@ -0,0 +1,5 @@
+import java.util.*;
+
+public class B {
+  B(List<String> ls) {}
+}
diff --git a/tests/multiIncremental/pr318884_5/inc1/src/B.java b/tests/multiIncremental/pr318884_5/inc1/src/B.java
new file mode 100644 (file)
index 0000000..becd8b6
--- /dev/null
@@ -0,0 +1,6 @@
+import java.util.*;
+
+public class B {
+  B(List<Integer> ln) {
+  }
+}
index 38e6b48b44e45608a26007514fdff644f7aa5cfd..15c894ea9d9504df51ef29c473dbf08d66f5010a 100644 (file)
@@ -51,4 +51,48 @@ public class IncrementalCompilationTests extends AbstractMultiProjectIncremental
                assertEquals(1, getErrorMessages(p).size());
                assertContains("B.java:4:0::0 Unhandled exception type Exception", getErrorMessages(p).get(0));
        }
+
+       // changing method return type parameterization
+       public void testModifiedGenericParameterTypeShouldTriggerError_318884_3() throws Exception {
+               String p = "pr318884_3";
+               initialiseProject(p);
+               build(p);
+               checkWasFullBuild();
+               checkCompileWeaveCount(p, 2, 2);
+               alter(p, "inc1");
+               build(p);
+               checkWasntFullBuild();
+               assertEquals(1, getErrorMessages(p).size());
+               assertContains("The return type is incompatible with B.foo()", getErrorMessages(p).get(0));
+       }
+
+       // changing method parameter type parameterization
+       public void testModifiedGenericParameterTypeShouldTriggerError_318884_4() throws Exception {
+               String p = "pr318884_4";
+               initialiseProject(p);
+               build(p);
+               checkWasFullBuild();
+               checkCompileWeaveCount(p, 2, 2);
+               alter(p, "inc1");
+               build(p);
+               checkWasntFullBuild();
+               assertEquals(1, getErrorMessages(p).size());
+               assertContains(
+                               "Name clash: The method foo(List<String>) of type A has the same erasure as foo(List<Integer>) of type B but does not override it",
+                               getErrorMessages(p).get(0));
+       }
+
+       // changing constructor parameter type parameterization
+       public void testModifiedGenericParameterTypeShouldTriggerError_318884_5() throws Exception {
+               String p = "pr318884_5";
+               initialiseProject(p);
+               build(p);
+               checkWasFullBuild();
+               checkCompileWeaveCount(p, 2, 2);
+               alter(p, "inc1");
+               build(p);
+               checkWasntFullBuild();
+               assertEquals(1, getErrorMessages(p).size());
+               assertContains("The constructor B(List<String>) is undefined", getErrorMessages(p).get(0));
+       }
 }