]> source.dussan.org Git - aspectj.git/commitdiff
318884: incremental: parameterization change on field
authoraclement <aclement>
Mon, 5 Jul 2010 23:02:43 +0000 (23:02 +0000)
committeraclement <aclement>
Mon, 5 Jul 2010 23:02:43 +0000 (23:02 +0000)
tests/multiIncremental/pr318884_6/base/src/A.java [new file with mode: 0644]
tests/multiIncremental/pr318884_6/base/src/B.java [new file with mode: 0644]
tests/multiIncremental/pr318884_6/inc1/src/B.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/incremental/tools/IncrementalCompilationTests.java

diff --git a/tests/multiIncremental/pr318884_6/base/src/A.java b/tests/multiIncremental/pr318884_6/base/src/A.java
new file mode 100644 (file)
index 0000000..4ed2eb7
--- /dev/null
@@ -0,0 +1,8 @@
+import java.util.*;
+
+public class A extends B {
+  public void m() {
+    for (String s: ss) {
+    }
+  }
+}
diff --git a/tests/multiIncremental/pr318884_6/base/src/B.java b/tests/multiIncremental/pr318884_6/base/src/B.java
new file mode 100644 (file)
index 0000000..ff67423
--- /dev/null
@@ -0,0 +1,5 @@
+import java.util.*;
+
+public class B {
+  List<String> ss;
+}
diff --git a/tests/multiIncremental/pr318884_6/inc1/src/B.java b/tests/multiIncremental/pr318884_6/inc1/src/B.java
new file mode 100644 (file)
index 0000000..7e6f926
--- /dev/null
@@ -0,0 +1,5 @@
+import java.util.*;
+
+public class B {
+  List<Integer> ss;
+}
index 15c894ea9d9504df51ef29c473dbf08d66f5010a..7d6e59854c40c2d4d681eb4644fc634464c1c976 100644 (file)
@@ -53,7 +53,7 @@ public class IncrementalCompilationTests extends AbstractMultiProjectIncremental
        }
 
        // changing method return type parameterization
-       public void testModifiedGenericParameterTypeShouldTriggerError_318884_3() throws Exception {
+       public void testModifiedMethodReturnTypeGenericTypeParameterShouldTriggerError_318884_3() throws Exception {
                String p = "pr318884_3";
                initialiseProject(p);
                build(p);
@@ -67,7 +67,7 @@ public class IncrementalCompilationTests extends AbstractMultiProjectIncremental
        }
 
        // changing method parameter type parameterization
-       public void testModifiedGenericParameterTypeShouldTriggerError_318884_4() throws Exception {
+       public void testModifiedMethodParameterGenericTypeParameterShouldTriggerError_318884_4() throws Exception {
                String p = "pr318884_4";
                initialiseProject(p);
                build(p);
@@ -83,7 +83,7 @@ public class IncrementalCompilationTests extends AbstractMultiProjectIncremental
        }
 
        // changing constructor parameter type parameterization
-       public void testModifiedGenericParameterTypeShouldTriggerError_318884_5() throws Exception {
+       public void testModifiedConstructorParameterGenericTypeParameterShouldTriggerError_318884_5() throws Exception {
                String p = "pr318884_5";
                initialiseProject(p);
                build(p);
@@ -95,4 +95,18 @@ public class IncrementalCompilationTests extends AbstractMultiProjectIncremental
                assertEquals(1, getErrorMessages(p).size());
                assertContains("The constructor B(List<String>) is undefined", getErrorMessages(p).get(0));
        }
+
+       // changing field type parameterization
+       public void testModifiedFieldTypeGenericTypeParameterShouldTriggerError_318884_6() throws Exception {
+               String p = "pr318884_6";
+               initialiseProject(p);
+               build(p);
+               checkWasFullBuild();
+               checkCompileWeaveCount(p, 2, 2);
+               alter(p, "inc1");
+               build(p);
+               checkWasntFullBuild();
+               assertEquals(1, getErrorMessages(p).size());
+               assertContains("Type mismatch: cannot convert from element type Integer to String", getErrorMessages(p).get(0));
+       }
 }