aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs/AroundAdviceJPs/JoinPointInAroundAdvice.java
diff options
context:
space:
mode:
authoraclement <aclement>2004-08-09 10:26:53 +0000
committeraclement <aclement>2004-08-09 10:26:53 +0000
commit851da68a07bcbfac4414fadc1b9f3bc02fa810a5 (patch)
tree8774e959f018037db9891f447e4f7070c0cc8a71 /tests/bugs/AroundAdviceJPs/JoinPointInAroundAdvice.java
parent299d24a82619057d3746db391afb238c213d56e5 (diff)
downloadaspectj-851da68a07bcbfac4414fadc1b9f3bc02fa810a5.tar.gz
aspectj-851da68a07bcbfac4414fadc1b9f3bc02fa810a5.zip
Fix for Bug 71377: Cannot advise private method call in around advice
Diffstat (limited to 'tests/bugs/AroundAdviceJPs/JoinPointInAroundAdvice.java')
-rw-r--r--tests/bugs/AroundAdviceJPs/JoinPointInAroundAdvice.java44
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/bugs/AroundAdviceJPs/JoinPointInAroundAdvice.java b/tests/bugs/AroundAdviceJPs/JoinPointInAroundAdvice.java
new file mode 100644
index 000000000..db8ba6b24
--- /dev/null
+++ b/tests/bugs/AroundAdviceJPs/JoinPointInAroundAdvice.java
@@ -0,0 +1,44 @@
+import java.util.*;
+
+public aspect JoinPointInAroundAdvice {
+
+ static int i = 0;
+ static int j = 0;
+
+ before () : call(* JoinPointInAroundAdvice.privateMethod(..)) { i++; tjps.add(thisJoinPoint.getSourceLocation());}
+ before () : call(* JoinPointInAroundAdvice.publicMethod(..)) { j++;}
+
+ pointcut execTest () : execution(* JoinPointInAroundAdvice.test());
+
+ before () : execTest() {
+ privateMethod("before");
+ publicMethod("before");
+ }
+
+ void around () : execTest() {
+ privateMethod("around");
+ publicMethod("around");
+ proceed();
+ }
+
+ after () : execTest () {
+ privateMethod("after");
+ publicMethod("after");
+ }
+
+ private static List tjps = new ArrayList();
+
+ private static void privateMethod(String from) { }//System.out.println("? privateMethod() " + from); }
+ public static void publicMethod(String from) { }//System.out.println("? publicMethod() " + from); }
+
+ public static void test () {
+ System.out.println("? test()");
+ }
+
+ public static void main (String[] args) {
+ test();
+ if (i!=j || i!=3) throw new RuntimeException("Missing join point: private="+i+" public="+j);
+ //System.err.println(tjps);
+ }
+}
+