From 21d98b094385d277919b71f685bc50c75784d58b Mon Sep 17 00:00:00 2001 From: aclement Date: Mon, 15 Mar 2010 21:04:41 +0000 Subject: [PATCH] 298504: test and fix: incremental build when invalid declare @type --- .../multiIncremental/pr298504/base/src/Asp.java | 3 +++ tests/multiIncremental/pr298504/base/src/C.java | 2 ++ .../multiIncremental/pr298504/inc1/src/Asp.java | 3 +++ .../tools/MultiProjectIncrementalTests.java | 17 +++++++++++++++++ 4 files changed, 25 insertions(+) create mode 100644 tests/multiIncremental/pr298504/base/src/Asp.java create mode 100644 tests/multiIncremental/pr298504/base/src/C.java create mode 100644 tests/multiIncremental/pr298504/inc1/src/Asp.java 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"; -- 2.39.5