From: aclement Date: Sat, 26 Apr 2008 18:38:31 +0000 (+0000) Subject: rest of fix for 228980 - annotations bundled in with Nots X-Git-Tag: Root_refactoring~17 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=95fd0b5d754806866d836e56e15b9ecb8a3fa1ee;p=aspectj.git rest of fix for 228980 - annotations bundled in with Nots --- 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 @@ + + + + + + + + + + + - - -