--- /dev/null
+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 {
+ }
+
+}
--- /dev/null
+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 {
+ }
+}
*/
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");
}
<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"/>