]> source.dussan.org Git - aspectj.git/commitdiff
333274: testcode
authoraclement <aclement>
Mon, 24 Jan 2011 22:41:24 +0000 (22:41 +0000)
committeraclement <aclement>
Mon, 24 Jan 2011 22:41:24 +0000 (22:41 +0000)
tests/bugs1611/pr333274/ma/Annotation1.java [new file with mode: 0644]
tests/bugs1611/pr333274/ma/Main.java [new file with mode: 0644]
tests/bugs1611/pr333274/ma/Precedence.java [new file with mode: 0644]
tests/bugs1611/pr333274/ma/aspect1/Aspect1.java [new file with mode: 0644]
tests/bugs1611/pr333274/ma/aspect3/Aspect3.java [new file with mode: 0644]
tests/bugs1611/pr333274/ma2/Annotation1.java [new file with mode: 0644]
tests/bugs1611/pr333274/ma2/Main.java [new file with mode: 0644]
tests/bugs1611/pr333274/ma2/Precedence.java [new file with mode: 0644]
tests/bugs1611/pr333274/ma2/aspect1/Aspect1.java [new file with mode: 0644]
tests/bugs1611/pr333274/ma2/aspect3/Aspect3.java [new file with mode: 0644]

diff --git a/tests/bugs1611/pr333274/ma/Annotation1.java b/tests/bugs1611/pr333274/ma/Annotation1.java
new file mode 100644 (file)
index 0000000..67e06ae
--- /dev/null
@@ -0,0 +1,9 @@
+package ma;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Annotation1 {
+
+}
diff --git a/tests/bugs1611/pr333274/ma/Main.java b/tests/bugs1611/pr333274/ma/Main.java
new file mode 100644 (file)
index 0000000..543e39e
--- /dev/null
@@ -0,0 +1,16 @@
+package ma;
+
+
+public class Main {
+
+        @Annotation1
+        public int retryTranslateAndTimeLimited() {
+            System.out.println("Method call");
+            return 1;
+        }
+
+    public static void main(String[] args) {
+        new Main().retryTranslateAndTimeLimited();
+    }
+
+}
diff --git a/tests/bugs1611/pr333274/ma/Precedence.java b/tests/bugs1611/pr333274/ma/Precedence.java
new file mode 100644 (file)
index 0000000..bc52637
--- /dev/null
@@ -0,0 +1,10 @@
+package ma;
+
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.DeclarePrecedence;
+
+@Aspect
+@DeclarePrecedence("ma.aspect1.Aspect1, ma.aspect3.Aspect3")
+class Precedence {
+
+}
diff --git a/tests/bugs1611/pr333274/ma/aspect1/Aspect1.java b/tests/bugs1611/pr333274/ma/aspect1/Aspect1.java
new file mode 100644 (file)
index 0000000..b76a0ca
--- /dev/null
@@ -0,0 +1,25 @@
+package ma.aspect1;
+
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+
+
+@Aspect
+public class Aspect1 {
+
+    @Around("execution(@ma.Annotation1 * *(..))")
+    public Object inRetryAspect(ProceedingJoinPoint pjp) throws Throwable {
+        new InternalClass();
+        System.out.println(">In Aspect1");
+       pjp.proceed();
+        System.out.println("=In Aspect1");
+        Object o = pjp.proceed();
+        System.out.println("<In Aspect1");
+        return o;
+    }
+
+    private static class InternalClass {
+    }
+
+}
diff --git a/tests/bugs1611/pr333274/ma/aspect3/Aspect3.java b/tests/bugs1611/pr333274/ma/aspect3/Aspect3.java
new file mode 100644 (file)
index 0000000..93c17ce
--- /dev/null
@@ -0,0 +1,22 @@
+package ma.aspect3;
+
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+
+@Aspect
+public class Aspect3 {
+
+    @Around("execution(@ma.Annotation1 * *(..))")
+    public Object inTimeLimiterAspect(ProceedingJoinPoint pjp) throws Throwable {
+               new InnerClass2();
+        System.out.println(">In Aspect3");
+        Object returnedObject = pjp.proceed();
+        System.out.println("<In Aspect3");
+        return returnedObject;
+    }
+
+    private static class InnerClass2 {
+
+    }
+}
diff --git a/tests/bugs1611/pr333274/ma2/Annotation1.java b/tests/bugs1611/pr333274/ma2/Annotation1.java
new file mode 100644 (file)
index 0000000..1c8ab25
--- /dev/null
@@ -0,0 +1,9 @@
+package ma2;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Annotation1 {
+
+}
diff --git a/tests/bugs1611/pr333274/ma2/Main.java b/tests/bugs1611/pr333274/ma2/Main.java
new file mode 100644 (file)
index 0000000..52e93f2
--- /dev/null
@@ -0,0 +1,16 @@
+package ma2;
+
+
+public class Main {
+
+        @Annotation1
+        public int retryTranslateAndTimeLimited() {
+            System.out.println("Method call");
+            return 1;
+        }
+
+    public static void main(String[] args) {
+        new Main().retryTranslateAndTimeLimited();
+    }
+
+}
diff --git a/tests/bugs1611/pr333274/ma2/Precedence.java b/tests/bugs1611/pr333274/ma2/Precedence.java
new file mode 100644 (file)
index 0000000..bdfd156
--- /dev/null
@@ -0,0 +1,10 @@
+package ma2;
+
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.DeclarePrecedence;
+
+@Aspect
+@DeclarePrecedence("ma2.aspect1.Aspect1, ma2.aspect3.Aspect3")
+class Precedence {
+
+}
diff --git a/tests/bugs1611/pr333274/ma2/aspect1/Aspect1.java b/tests/bugs1611/pr333274/ma2/aspect1/Aspect1.java
new file mode 100644 (file)
index 0000000..e035967
--- /dev/null
@@ -0,0 +1,23 @@
+package ma2.aspect1;
+
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+
+
+public aspect Aspect1 {
+
+    Object around(): execution(@ma2.Annotation1 * *(..)) {
+        new InternalClass();
+        System.out.println(">In Aspect1");
+       proceed();
+        System.out.println("=In Aspect1");
+        Object o = proceed();
+        System.out.println("<In Aspect1");
+        return o;
+    }
+
+    private static class InternalClass {
+    }
+
+}
diff --git a/tests/bugs1611/pr333274/ma2/aspect3/Aspect3.java b/tests/bugs1611/pr333274/ma2/aspect3/Aspect3.java
new file mode 100644 (file)
index 0000000..06280ae
--- /dev/null
@@ -0,0 +1,20 @@
+package ma2.aspect3;
+
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+
+public aspect Aspect3 {
+
+    Object around(): execution(@ma2.Annotation1 * *(..)) {
+               new InnerClass2();
+        System.out.println(">In Aspect3");
+        Object returnedObject = proceed();
+        System.out.println("<In Aspect3");
+        return returnedObject;
+    }
+
+    private static class InnerClass2 {
+
+    }
+}