From d10618d25a9e995ffeb8080b3b9468ad241a163c Mon Sep 17 00:00:00 2001 From: Andy Clement Date: Fri, 2 Dec 2016 10:32:17 -0800 Subject: 259416: preliminary work --- tests/bugs1810/259416/Caveats | 0 tests/bugs1810/259416/ColouredAnnotation.class | Bin 0 -> 315 bytes tests/bugs1810/259416/ColouredAnnotation.java | 6 +++ tests/bugs1810/259416/Creating | 0 tests/bugs1810/259416/Downloading | 0 tests/bugs1810/259416/Filler.java | 5 +++ tests/bugs1810/259416/RGB.class | Bin 0 -> 898 bytes tests/bugs1810/259416/RGB.java | 3 ++ tests/bugs1810/259416/Tapping | 0 tests/bugs1810/259416/Test1.java | 13 ++++++ tests/bugs1810/259416/Test2.java | 13 ++++++ tests/bugs1810/259416/Test3.java | 13 ++++++ tests/bugs1810/259416/Test4.java | 13 ++++++ .../aspectj/systemtest/ajc1810/Ajc1810Tests.java | 36 +++++++++++++++++ .../src/org/aspectj/systemtest/ajc1810/ajc1810.xml | 45 +++++++++++++++++++++ 15 files changed, 147 insertions(+) create mode 100644 tests/bugs1810/259416/Caveats create mode 100644 tests/bugs1810/259416/ColouredAnnotation.class create mode 100644 tests/bugs1810/259416/ColouredAnnotation.java create mode 100644 tests/bugs1810/259416/Creating create mode 100644 tests/bugs1810/259416/Downloading create mode 100644 tests/bugs1810/259416/Filler.java create mode 100644 tests/bugs1810/259416/RGB.class create mode 100644 tests/bugs1810/259416/RGB.java create mode 100644 tests/bugs1810/259416/Tapping create mode 100644 tests/bugs1810/259416/Test1.java create mode 100644 tests/bugs1810/259416/Test2.java create mode 100644 tests/bugs1810/259416/Test3.java create mode 100644 tests/bugs1810/259416/Test4.java (limited to 'tests') diff --git a/tests/bugs1810/259416/Caveats b/tests/bugs1810/259416/Caveats new file mode 100644 index 000000000..e69de29bb diff --git a/tests/bugs1810/259416/ColouredAnnotation.class b/tests/bugs1810/259416/ColouredAnnotation.class new file mode 100644 index 000000000..ff8b19572 Binary files /dev/null and b/tests/bugs1810/259416/ColouredAnnotation.class differ diff --git a/tests/bugs1810/259416/ColouredAnnotation.java b/tests/bugs1810/259416/ColouredAnnotation.java new file mode 100644 index 000000000..1886a2f03 --- /dev/null +++ b/tests/bugs1810/259416/ColouredAnnotation.java @@ -0,0 +1,6 @@ +import java.lang.annotation.*; + +@Retention(RetentionPolicy.RUNTIME) +public @interface ColouredAnnotation { + RGB value(); +} diff --git a/tests/bugs1810/259416/Creating b/tests/bugs1810/259416/Creating new file mode 100644 index 000000000..e69de29bb diff --git a/tests/bugs1810/259416/Downloading b/tests/bugs1810/259416/Downloading new file mode 100644 index 000000000..e69de29bb diff --git a/tests/bugs1810/259416/Filler.java b/tests/bugs1810/259416/Filler.java new file mode 100644 index 000000000..dc5592b41 --- /dev/null +++ b/tests/bugs1810/259416/Filler.java @@ -0,0 +1,5 @@ +import java.lang.annotation.*; + +@Retention(RetentionPolicy.RUNTIME) +public @interface Filler { +} diff --git a/tests/bugs1810/259416/RGB.class b/tests/bugs1810/259416/RGB.class new file mode 100644 index 000000000..737e3b6bb Binary files /dev/null and b/tests/bugs1810/259416/RGB.class differ diff --git a/tests/bugs1810/259416/RGB.java b/tests/bugs1810/259416/RGB.java new file mode 100644 index 000000000..04d4e9474 --- /dev/null +++ b/tests/bugs1810/259416/RGB.java @@ -0,0 +1,3 @@ +public enum RGB { + RED, GREEN, BLUE; +} diff --git a/tests/bugs1810/259416/Tapping b/tests/bugs1810/259416/Tapping new file mode 100644 index 000000000..e69de29bb diff --git a/tests/bugs1810/259416/Test1.java b/tests/bugs1810/259416/Test1.java new file mode 100644 index 000000000..e4961f039 --- /dev/null +++ b/tests/bugs1810/259416/Test1.java @@ -0,0 +1,13 @@ +public class Test1 { + public static void main(String[] argv) { + coloured("abc"); + } + public static void coloured(@ColouredAnnotation(RGB.RED) String param1) {} +} + +aspect X { + // execution(@ColouredAnnotation * colouredMethod(..)) && @annotation(ColouredAnnotation(colour)); + before(ColouredAnnotation ca): execution(* *(@ColouredAnnotation (*))) && @args(ca (*)) { + System.out.println("Annotation from parameter on method "+thisJoinPoint+" is "+ca); + } +} diff --git a/tests/bugs1810/259416/Test2.java b/tests/bugs1810/259416/Test2.java new file mode 100644 index 000000000..a2a026dbc --- /dev/null +++ b/tests/bugs1810/259416/Test2.java @@ -0,0 +1,13 @@ +public class Test2 { + public static void main(String[] argv) { + coloured("abc"); + } + public static void coloured(@ColouredAnnotation(RGB.GREEN) String param1) {} +} + +aspect X { + // execution(@ColouredAnnotation * colouredMethod(..)) && @annotation(ColouredAnnotation(colour)); + before(ColouredAnnotation ca): execution(* *(..)) && @args(ca (*)) { + System.out.println("Annotation from parameter on method "+thisJoinPoint+" is "+ca); + } +} diff --git a/tests/bugs1810/259416/Test3.java b/tests/bugs1810/259416/Test3.java new file mode 100644 index 000000000..49744de78 --- /dev/null +++ b/tests/bugs1810/259416/Test3.java @@ -0,0 +1,13 @@ +public class Test3 { + public static void main(String[] argv) { + coloured(1,"abc"); + } + public static void coloured(int param1, @ColouredAnnotation(RGB.RED) String param2) {} +} + +aspect X { + // execution(@ColouredAnnotation * colouredMethod(..)) && @annotation(ColouredAnnotation(colour)); + before(ColouredAnnotation ca): execution(* *(..)) && @args(*, ca (*)) { + System.out.println("Annotation from parameter on method "+thisJoinPoint+" is "+ca); + } +} diff --git a/tests/bugs1810/259416/Test4.java b/tests/bugs1810/259416/Test4.java new file mode 100644 index 000000000..92324f883 --- /dev/null +++ b/tests/bugs1810/259416/Test4.java @@ -0,0 +1,13 @@ +public class Test4 { + public static void main(String[] argv) { + coloured(1,"abc"); + } + public static void coloured(int param1, @Filler @ColouredAnnotation(RGB.GREEN) String param2) {} +} + +aspect X { + // execution(@ColouredAnnotation * colouredMethod(..)) && @annotation(ColouredAnnotation(colour)); + before(ColouredAnnotation ca): execution(* *(..)) && @args(*, ca (*)) { + System.out.println("Annotation from parameter on method "+thisJoinPoint+" is "+ca); + } +} diff --git a/tests/src/org/aspectj/systemtest/ajc1810/Ajc1810Tests.java b/tests/src/org/aspectj/systemtest/ajc1810/Ajc1810Tests.java index 3cae1378c..36232a91d 100644 --- a/tests/src/org/aspectj/systemtest/ajc1810/Ajc1810Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc1810/Ajc1810Tests.java @@ -24,6 +24,42 @@ import junit.framework.Test; */ public class Ajc1810Tests extends org.aspectj.testing.XMLBasedAjcTestCase { + // Basic with execution(* *(@Foo (*))) && @args(ca (*)) + public void testParamAnnoBinding_259416_1() { + runTest("param anno binding"); + } + + // Basic with execution(* *(..)) && args(ca (*)) + public void testParamAnnoBinding_259416_2() { + runTest("param anno binding 2"); + } + + // Basic with execution(* *(..)) && args(*,ca (*)) + public void testParamAnnoBinding_259416_3() { + runTest("param anno binding 3"); + } + + // Basic with execution(* *(..)) && args(*,ca (*)) where target has two parameter annotations and we match the 2nd one + public void testParamAnnoBinding_259416_4() { + runTest("param anno binding 4"); + } + + // execution(* *(..)) && args(f *,ca (*)) + + // args(ca1 (*),ca2 (*)) + + // args(ca(*)) + + // args(ca1 (f)) + + // args(ca1 ba1 (*)) + + // args(ca1 ba1 (f1 f2)) + + // args(ca1 (*), .., ca2 (*)) + + + public void testBinding_500035() { runTest("ataspectj binding"); } diff --git a/tests/src/org/aspectj/systemtest/ajc1810/ajc1810.xml b/tests/src/org/aspectj/systemtest/ajc1810/ajc1810.xml index 7485c1c20..75edcbc5e 100644 --- a/tests/src/org/aspectj/systemtest/ajc1810/ajc1810.xml +++ b/tests/src/org/aspectj/systemtest/ajc1810/ajc1810.xml @@ -2,6 +2,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3