aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/bugs1612/pr345172/InterType.java37
-rw-r--r--tests/bugs1612/pr345172/InterType2.java44
-rw-r--r--tests/src/org/aspectj/systemtest/ajc1612/Ajc1612Tests.java8
-rw-r--r--tests/src/org/aspectj/systemtest/ajc1612/ajc1612.xml24
4 files changed, 113 insertions, 0 deletions
diff --git a/tests/bugs1612/pr345172/InterType.java b/tests/bugs1612/pr345172/InterType.java
new file mode 100644
index 000000000..a8f808d8c
--- /dev/null
+++ b/tests/bugs1612/pr345172/InterType.java
@@ -0,0 +1,37 @@
+import static java.lang.annotation.ElementType.*;
+import java.lang.annotation.*;
+
+public aspect InterType {
+
+ @Retention(RetentionPolicy.RUNTIME)
+ @Target({METHOD})
+ public @interface MyAnnotation {
+ }
+
+ public static aspect AroundMethod {
+ Object around() : execution(@MyAnnotation * * (..)) {
+ return proceed();
+ }
+ }
+
+ public interface InterTypeIfc {}
+
+ // (1)
+ @MyAnnotation
+ public void InterTypeIfc.m1(int p1) {}
+
+ // (2)
+ public void InterTypeIfc.m1(int p1, int p2) {}
+
+ // (3)
+// @MyAnnotation
+// public void m1(int p1) {}
+
+ // (4)
+// public void m1(int p1, int p2) {}
+
+
+ public static void main(String []argv) throws Exception {
+ }
+
+}
diff --git a/tests/bugs1612/pr345172/InterType2.java b/tests/bugs1612/pr345172/InterType2.java
new file mode 100644
index 000000000..d442f5ee2
--- /dev/null
+++ b/tests/bugs1612/pr345172/InterType2.java
@@ -0,0 +1,44 @@
+import static java.lang.annotation.ElementType.*;
+import java.lang.annotation.*;
+
+public aspect InterType2 {
+
+ @Retention(RetentionPolicy.RUNTIME)
+ @Target({METHOD})
+ public @interface MyAnnotation {
+ }
+
+ public static aspect AroundMethod {
+ Object around() : execution(@MyAnnotation * * (..)) {
+ System.out.println(thisJoinPointStaticPart);
+ return proceed();
+ }
+ }
+
+ public interface InterTypeIfc {}
+
+ // (1)
+ @MyAnnotation
+ public void InterTypeIfc.m1(int p1) {}
+
+ // (2)
+ public void InterTypeIfc.m1(int p1, int p2) {}
+
+ // (3)
+// @MyAnnotation
+// public void m1(int p1) {}
+
+ // (4)
+// public void m1(int p1, int p2) {}
+
+
+ public static void main(String []argv) throws Exception {
+ new Foo().m1(1);
+ new Foo().m1(1,2);
+ }
+
+ declare parents: Foo implements InterTypeIfc;
+
+ static class Foo {
+ }
+}
diff --git a/tests/src/org/aspectj/systemtest/ajc1612/Ajc1612Tests.java b/tests/src/org/aspectj/systemtest/ajc1612/Ajc1612Tests.java
index 3404939ac..fe57fe8a3 100644
--- a/tests/src/org/aspectj/systemtest/ajc1612/Ajc1612Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc1612/Ajc1612Tests.java
@@ -21,6 +21,14 @@ import org.aspectj.testing.XMLBasedAjcTestCase;
*/
public class Ajc1612Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
+ public void testIncorrectAnnos_345172() {
+ runTest("incorrect annos");
+ }
+
+ public void testIncorrectAnnos_345172_2() {
+ runTest("incorrect annos 2");
+ }
+
public void testSyntheticMethods_327867() {
runTest("synthetic methods");
}
diff --git a/tests/src/org/aspectj/systemtest/ajc1612/ajc1612.xml b/tests/src/org/aspectj/systemtest/ajc1612/ajc1612.xml
index 45b8b9c51..4a9ee26a7 100644
--- a/tests/src/org/aspectj/systemtest/ajc1612/ajc1612.xml
+++ b/tests/src/org/aspectj/systemtest/ajc1612/ajc1612.xml
@@ -10,6 +10,30 @@
<run class="Foo"/>
</ajc-test>
+<ajc-test dir="bugs1612/pr345172" title="incorrect annos">
+<compile files="InterType.java" options="-1.5 -showWeaveInfo">
+<message kind="weave" text="Join point 'method-execution(void InterType$InterTypeIfc.m1(int))' in Type 'InterType' (InterType.java:21) advised by around advice from 'InterType$AroundMethod' (InterType.java:12)"/>
+<!--
+<message kind="weave" text="Join point 'method-execution(void InterType$InterTypeIfc.m1(int, int))' in Type 'InterType' (InterType.java:24) advised by around advice from 'InterType$AroundMethod' (InterType.java:12)"/>
+<message kind="weave" text="Join point 'method-execution(void InterType.m1(int))' in Type 'InterType' (InterType.java:28) advised by around advice from 'InterType$AroundMethod' (InterType.java:12)"/>
+-->
+<message kind="weave" text="Type 'InterType$InterTypeIfc' (InterType.java) has intertyped method from 'InterType' (InterType.java:'void InterType$InterTypeIfc.m1(int)')"/>
+<message kind="weave" text="Type 'InterType$InterTypeIfc' (InterType.java) has intertyped method from 'InterType' (InterType.java:'void InterType$InterTypeIfc.m1(int, int)')"/>
+</compile>
+<run class="InterType"/>
+</ajc-test>
+
+<ajc-test dir="bugs1612/pr345172" title="incorrect annos 2">
+<compile files="InterType2.java" options="-1.5">
+</compile>
+<run class="InterType2">
+<stdout>
+<line text="execution(void InterType2.InterTypeIfc.m1(int))"/>
+</stdout></run>
+</ajc-test>
+
+
+
<ajc-test dir="bugs1612/pr328099" title="signed jar ltw">
<compile files="X.java" classpath="code.jar"/>