summaryrefslogtreecommitdiffstats
path: root/tests/features151/ataround/A7.java
diff options
context:
space:
mode:
authoraclement <aclement>2006-02-02 11:31:58 +0000
committeraclement <aclement>2006-02-02 11:31:58 +0000
commit5f10ab1ee6592619b75d8f157f937d620f92d698 (patch)
tree0328e782bd99901e63a52c1ad6d757ed6655ba07 /tests/features151/ataround/A7.java
parent7a96a40ab7d5418309c4742bdb0225cd0dfb88ff (diff)
downloadaspectj-5f10ab1ee6592619b75d8f157f937d620f92d698.tar.gz
aspectj-5f10ab1ee6592619b75d8f157f937d620f92d698.zip
@AJ around tests for 126167
Diffstat (limited to 'tests/features151/ataround/A7.java')
-rw-r--r--tests/features151/ataround/A7.java37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/features151/ataround/A7.java b/tests/features151/ataround/A7.java
new file mode 100644
index 000000000..0a207434f
--- /dev/null
+++ b/tests/features151/ataround/A7.java
@@ -0,0 +1,37 @@
+// Bind the this on a call and change it with proceed... makes no difference
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.*;
+
+@Aspect
+public class A7 {
+ M newM = new M("2");
+
+ @Around("call(void M.method(String)) && args(p) && this(t)")
+ public void a( ProceedingJoinPoint pjp, M t,String p) throws Throwable {
+ System.err.println("advice from ataj aspect");
+ pjp.proceed(new Object[]{newM,"faked"});
+ }
+
+ public static void main(String []argv) {
+ M.main(argv);
+ }
+}
+
+class M {
+
+ String prefix;
+
+ public M(String prefix) { this.prefix = prefix; }
+
+ public static void main( String[] args ) {
+ M m = new M("1");
+ m.methodCaller("real");
+ }
+
+ public void methodCaller(String param) {
+ method(param);
+ }
+
+ public void method(String s) { System.err.println(prefix+s); }
+
+}