]> source.dussan.org Git - aspectj.git/commitdiff
pr194314: broken LV table, testcode
authoraclement <aclement>
Mon, 12 Nov 2007 22:19:59 +0000 (22:19 +0000)
committeraclement <aclement>
Mon, 12 Nov 2007 22:19:59 +0000 (22:19 +0000)
tests/bugs154/pr194314/test/IService.java [new file with mode: 0755]
tests/bugs154/pr194314/test/Main.java [new file with mode: 0755]
tests/bugs154/pr194314/test/Service.java [new file with mode: 0755]
tests/bugs154/pr194314/test/ServiceInterceptor.java [new file with mode: 0755]

diff --git a/tests/bugs154/pr194314/test/IService.java b/tests/bugs154/pr194314/test/IService.java
new file mode 100755 (executable)
index 0000000..0c9bb77
--- /dev/null
@@ -0,0 +1,6 @@
+package test;\r
+\r
+\r
+public interface IService {\r
+    void method(long l) throws Exception;\r
+}\r
diff --git a/tests/bugs154/pr194314/test/Main.java b/tests/bugs154/pr194314/test/Main.java
new file mode 100755 (executable)
index 0000000..d1e6993
--- /dev/null
@@ -0,0 +1,9 @@
+package test;\r
+\r
+public class Main {\r
+\r
+    public static void main(String[] args) throws Exception {\r
+        IService service = new Service();\r
+        service.method(42L);\r
+    }\r
+}\r
diff --git a/tests/bugs154/pr194314/test/Service.java b/tests/bugs154/pr194314/test/Service.java
new file mode 100755 (executable)
index 0000000..0a409c6
--- /dev/null
@@ -0,0 +1,8 @@
+package test;\r
+\r
+public class Service implements IService {\r
+\r
+    public void method(long l) throws Exception {\r
+        System.err.println("Original impl of service method, arg " + l);\r
+    }\r
+}\r
diff --git a/tests/bugs154/pr194314/test/ServiceInterceptor.java b/tests/bugs154/pr194314/test/ServiceInterceptor.java
new file mode 100755 (executable)
index 0000000..491fa50
--- /dev/null
@@ -0,0 +1,26 @@
+package test;\r
+\r
+import org.aspectj.lang.ProceedingJoinPoint;\r
+import org.aspectj.lang.annotation.Around;\r
+import org.aspectj.lang.annotation.Aspect;\r
+\r
+ @Aspect public class ServiceInterceptor {\r
+//public aspect ServiceInterceptor {\r
+       \r
+//     void around(): execution(void test.Service.method(long)) {\r
+//        Object[] args = thisJoinPoint.getArgs();\r
+//        long id = (Long) args[0];\r
+//        System.out.println("in advice, arg = " + id + " (before proceed)");\r
+//        proceed();\r
+//        System.out.println("in advice (after proceed)");\r
+//    }\r
+       \r
+    @Around("execution(void test.Service.method(long))")\r
+    public void method(ProceedingJoinPoint pjp) throws Throwable {\r
+        Object[] args = pjp.getArgs();\r
+        long id = (Long) args[0];\r
+        System.out.println("in advice, arg = " + id + " (before proceed)");\r
+        pjp.proceed(pjp.getArgs());\r
+        System.out.println("in advice (after proceed)");\r
+    }\r
+}\r