summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraclement <aclement>2008-04-26 18:38:31 +0000
committeraclement <aclement>2008-04-26 18:38:31 +0000
commit95fd0b5d754806866d836e56e15b9ecb8a3fa1ee (patch)
treebdeef1aeda9d4d77775172ca1143accfacc4535d
parent896000fba2b8c82c611ff36d58e70ab72f50c3d5 (diff)
downloadaspectj-95fd0b5d754806866d836e56e15b9ecb8a3fa1ee.tar.gz
aspectj-95fd0b5d754806866d836e56e15b9ecb8a3fa1ee.zip
rest of fix for 228980 - annotations bundled in with Nots
-rw-r--r--tests/features160/parameterAnnotationMatching/Test.java4
-rw-r--r--tests/features160/parameterAnnotationMatching/Test2.java25
-rw-r--r--tests/src/org/aspectj/systemtest/ajc160/ParameterAnnotationMatchingTests.java1
-rw-r--r--tests/src/org/aspectj/systemtest/ajc160/parameterAnnotations.xml17
4 files changed, 39 insertions, 8 deletions
diff --git a/tests/features160/parameterAnnotationMatching/Test.java b/tests/features160/parameterAnnotationMatching/Test.java
index 2a5aa2480..fb46dbfb0 100644
--- a/tests/features160/parameterAnnotationMatching/Test.java
+++ b/tests/features160/parameterAnnotationMatching/Test.java
@@ -8,7 +8,7 @@ public aspect Test {
declare warning : execution(* *(!(Object+), ..)) : "mOne: value parameter";
// Wrong (matches f1 and f2, should match only f1): a Not type pattern containing @A and negatedPattern Object+ is built
-//broke declare warning : execution(* *(@A (!(Object+)), ..)) : "mTwo: @A annotated value parameter";
+ declare warning : execution(* *(@A (!(Object+)), ..)) : "mTwo: @A annotated value parameter";
// OK (matches f1):
declare warning : execution(* *(@A (*), ..)) && execution(* *(!(Object+), ..)): "mThree: @A annotated value parameter.";
@@ -23,7 +23,7 @@ public aspect Test {
declare warning : execution(* *(@A (*), ..)) && execution(* *(Object+, ..)): "mSix: @A annotated reference parameter.";
// Wrong (matches f1 and f2, should match only f2):
-//broke declare warning : execution(* *(!@A (!(Object+)), ..)) : "mSeven: Non-@A annotated value parameter!";
+ declare warning : execution(* *(!@A (!(Object+)), ..)) : "mSeven: Non-@A annotated value parameter!";
// Wrong (matches f1 and f2, should match only f2):
declare warning : execution(* *(!@A (*), ..)) && execution(* *(!(Object+), ..)): "mEight: Non-@A annotated value parameter.";
diff --git a/tests/features160/parameterAnnotationMatching/Test2.java b/tests/features160/parameterAnnotationMatching/Test2.java
new file mode 100644
index 000000000..13fd815fb
--- /dev/null
+++ b/tests/features160/parameterAnnotationMatching/Test2.java
@@ -0,0 +1,25 @@
+ import java.lang.annotation.*;
+ import java.lang.annotation.Target;
+
+ public aspect Test2 {
+
+ declare warning : execution(* *(@A (!(Object+)), ..)) : "mOne"; // f1
+ declare warning : execution(* *(@A !String, ..)) : "mTwo"; // f3/f4
+
+ void f1(@A int i) {} // 9
+
+ void f2(int i) {} // 11
+
+ void f3(@A P i) {}
+
+ void f4(P i) {}
+
+ void f5(Integer i) {}
+
+ void f6(@A Integer i) {}
+
+ @Retention(RetentionPolicy.RUNTIME)
+ private static @interface A { }
+
+ @A static class P {}
+ } \ No newline at end of file
diff --git a/tests/src/org/aspectj/systemtest/ajc160/ParameterAnnotationMatchingTests.java b/tests/src/org/aspectj/systemtest/ajc160/ParameterAnnotationMatchingTests.java
index 4e6677879..166ad09eb 100644
--- a/tests/src/org/aspectj/systemtest/ajc160/ParameterAnnotationMatchingTests.java
+++ b/tests/src/org/aspectj/systemtest/ajc160/ParameterAnnotationMatchingTests.java
@@ -77,6 +77,7 @@ import org.aspectj.testing.XMLBasedAjcTestCase;
public class ParameterAnnotationMatchingTests extends XMLBasedAjcTestCase {
public void testDeow() { runTest("deow"); }
+ public void testDeow2() { runTest("deow2"); }
public void testNoWarningForWrongType() { runTest("no xlint for wrong target");}
public void testVariousCombinations() { runTest("various combinations"); }
public void testVariousCombinationsCtors() { runTest("various combinations - ctors"); }
diff --git a/tests/src/org/aspectj/systemtest/ajc160/parameterAnnotations.xml b/tests/src/org/aspectj/systemtest/ajc160/parameterAnnotations.xml
index 47d8598b3..1f06e2d82 100644
--- a/tests/src/org/aspectj/systemtest/ajc160/parameterAnnotations.xml
+++ b/tests/src/org/aspectj/systemtest/ajc160/parameterAnnotations.xml
@@ -3,25 +3,30 @@
<!-- AspectJ v1.6.0 Parameter Annotation Matching Tests -->
<suite>
+ <ajc-test dir="features160/parameterAnnotationMatching" title="deow2">
+ <compile options="-1.5" files="Test2.java">
+ <message kind="warning" line="9" text="mOne"/>
+ <message kind="warning" line="13" text="mTwo"/>
+ <message kind="warning" line="15" text="mTwo"/>
+ </compile>
+ </ajc-test>
<ajc-test dir="features160/parameterAnnotationMatching" title="deow">
<compile options="-1.5" files="Test.java">
<message kind="warning" line="43" text="mOne"/>
<message kind="warning" line="45" text="mOne"/>
+ <message kind="warning" line="43" text="mTwo"/>
<message kind="warning" line="43" text="mThree"/>
<message kind="warning" line="47" text="mFour"/>
<message kind="warning" line="49" text="mFour"/>
<message kind="warning" line="47" text="mFive"/>
<message kind="warning" line="47" text="mSix"/>
+ <message kind="warning" line="45" text="mSeven"/>
+ <message kind="warning" line="45" text="mEight"/>
<message kind="warning" line="45" text="mNine"/>
+ <message kind="warning" line="49" text="mTen"/>
<message kind="warning" line="49" text="mEleven"/>
<message kind="warning" line="49" text="mTwelve"/>
- <message kind="warning" line="49" text="mTen"/>
- <message kind="warning" line="45" text="mEight"/>
- <!--
- <message kind="warning" line="43" text="mTwo"/>
- <message kind="warning" line="45" text="mSeven"/>
- -->
</compile>
</ajc-test>