aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraclement <aclement>2010-03-15 21:04:41 +0000
committeraclement <aclement>2010-03-15 21:04:41 +0000
commit21d98b094385d277919b71f685bc50c75784d58b (patch)
tree7b61b24c48bb8e8b9922b8c3fa75b2ddf0127919
parent85d90a601b1da2b59bd4920cddf8b8e001c39780 (diff)
downloadaspectj-21d98b094385d277919b71f685bc50c75784d58b.tar.gz
aspectj-21d98b094385d277919b71f685bc50c75784d58b.zip
298504: test and fix: incremental build when invalid declare @type
-rw-r--r--tests/multiIncremental/pr298504/base/src/Asp.java3
-rw-r--r--tests/multiIncremental/pr298504/base/src/C.java2
-rw-r--r--tests/multiIncremental/pr298504/inc1/src/Asp.java3
-rw-r--r--tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java17
4 files changed, 25 insertions, 0 deletions
diff --git a/tests/multiIncremental/pr298504/base/src/Asp.java b/tests/multiIncremental/pr298504/base/src/Asp.java
new file mode 100644
index 000000000..c2ad124ae
--- /dev/null
+++ b/tests/multiIncremental/pr298504/base/src/Asp.java
@@ -0,0 +1,3 @@
+aspect Asp {
+ declare @type: C: @ManagedResource;
+}
diff --git a/tests/multiIncremental/pr298504/base/src/C.java b/tests/multiIncremental/pr298504/base/src/C.java
new file mode 100644
index 000000000..d4053967a
--- /dev/null
+++ b/tests/multiIncremental/pr298504/base/src/C.java
@@ -0,0 +1,2 @@
+public class C {
+}
diff --git a/tests/multiIncremental/pr298504/inc1/src/Asp.java b/tests/multiIncremental/pr298504/inc1/src/Asp.java
new file mode 100644
index 000000000..c2ad124ae
--- /dev/null
+++ b/tests/multiIncremental/pr298504/inc1/src/Asp.java
@@ -0,0 +1,3 @@
+aspect Asp {
+ declare @type: C: @ManagedResource;
+}
diff --git a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
index b0b82e6f5..cd81d05fc 100644
--- a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
+++ b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
@@ -836,6 +836,23 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa
assertEquals("Unexpected compiler error", 0, l.size());
}
+ public void testDeclareAnnotationNPE_298504() {
+ AjdeInteractionTestbed.VERBOSE = true;
+ String p = "pr298504";
+ initialiseProject(p);
+ build(p);
+ List l = getErrorMessages(p);
+ assertTrue(l.toString().indexOf("ManagedResource cannot be resolved to a type") != -1);
+ // checkWasFullBuild();
+ alter(p, "inc1");
+ build(p);
+ // checkWasntFullBuild();
+ l = getCompilerErrorMessages(p);
+ assertTrue(l.toString().indexOf("NullPointerException") == -1);
+ l = getErrorMessages(p);
+ assertTrue(l.toString().indexOf("ManagedResource cannot be resolved to a type") != -1);
+ }
+
public void testIncrementalAnnoStyle_pr286341() {
AjdeInteractionTestbed.VERBOSE = true;
String base = "pr286341_base";