From 00c400c7b67c4d5cec0bc3bc3e187fe73972fa26 Mon Sep 17 00:00:00 2001 From: aclement Date: Mon, 5 Jul 2010 22:52:07 +0000 Subject: [PATCH] 318884: incremental: parameterization change on method/ctor --- .../pr318884_3/base/src/A.java | 7 +++ .../pr318884_3/base/src/B.java | 7 +++ .../pr318884_3/inc1/src/B.java | 7 +++ .../pr318884_4/base/src/A.java | 6 +++ .../pr318884_4/base/src/B.java | 6 +++ .../pr318884_4/inc1/src/B.java | 6 +++ .../pr318884_5/base/src/A.java | 7 +++ .../pr318884_5/base/src/B.java | 5 +++ .../pr318884_5/inc1/src/B.java | 6 +++ .../tools/IncrementalCompilationTests.java | 44 +++++++++++++++++++ 10 files changed, 101 insertions(+) create mode 100644 tests/multiIncremental/pr318884_3/base/src/A.java create mode 100644 tests/multiIncremental/pr318884_3/base/src/B.java create mode 100644 tests/multiIncremental/pr318884_3/inc1/src/B.java create mode 100644 tests/multiIncremental/pr318884_4/base/src/A.java create mode 100644 tests/multiIncremental/pr318884_4/base/src/B.java create mode 100644 tests/multiIncremental/pr318884_4/inc1/src/B.java create mode 100644 tests/multiIncremental/pr318884_5/base/src/A.java create mode 100644 tests/multiIncremental/pr318884_5/base/src/B.java create mode 100644 tests/multiIncremental/pr318884_5/inc1/src/B.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 index 000000000..d11d1677d --- /dev/null +++ b/tests/multiIncremental/pr318884_3/base/src/A.java @@ -0,0 +1,7 @@ +import java.util.*; + +public class A extends B { + public List 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 index 000000000..6ccf181da --- /dev/null +++ b/tests/multiIncremental/pr318884_3/base/src/B.java @@ -0,0 +1,7 @@ +import java.util.*; + +public class B { + public List 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 index 000000000..e96d963da --- /dev/null +++ b/tests/multiIncremental/pr318884_3/inc1/src/B.java @@ -0,0 +1,7 @@ +import java.util.*; + +public class B { + public List 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 index 000000000..292362ff6 --- /dev/null +++ b/tests/multiIncremental/pr318884_4/base/src/A.java @@ -0,0 +1,6 @@ +import java.util.*; + +public class A extends B { + public void foo(List 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 index 000000000..94fbe3738 --- /dev/null +++ b/tests/multiIncremental/pr318884_4/base/src/B.java @@ -0,0 +1,6 @@ +import java.util.*; + +public class B { + public void foo(List 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 index 000000000..c30445f97 --- /dev/null +++ b/tests/multiIncremental/pr318884_4/inc1/src/B.java @@ -0,0 +1,6 @@ +import java.util.*; + +public class B { + public void foo(List 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 index 000000000..ea488672a --- /dev/null +++ b/tests/multiIncremental/pr318884_5/base/src/A.java @@ -0,0 +1,7 @@ +import java.util.*; + +public class A extends B { + A(List 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 index 000000000..4114654fe --- /dev/null +++ b/tests/multiIncremental/pr318884_5/base/src/B.java @@ -0,0 +1,5 @@ +import java.util.*; + +public class B { + B(List 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 index 000000000..becd8b6d3 --- /dev/null +++ b/tests/multiIncremental/pr318884_5/inc1/src/B.java @@ -0,0 +1,6 @@ +import java.util.*; + +public class B { + B(List ln) { + } +} diff --git a/tests/src/org/aspectj/systemtest/incremental/tools/IncrementalCompilationTests.java b/tests/src/org/aspectj/systemtest/incremental/tools/IncrementalCompilationTests.java index 38e6b48b4..15c894ea9 100644 --- a/tests/src/org/aspectj/systemtest/incremental/tools/IncrementalCompilationTests.java +++ b/tests/src/org/aspectj/systemtest/incremental/tools/IncrementalCompilationTests.java @@ -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) of type A has the same erasure as foo(List) 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) is undefined", getErrorMessages(p).get(0)); + } } -- 2.39.5