From bd00110f8f65f2d3dfcbb40cf49835a8cb279897 Mon Sep 17 00:00:00 2001 From: aclement Date: Mon, 12 Nov 2007 22:19:59 +0000 Subject: [PATCH] pr194314: broken LV table, testcode --- tests/bugs154/pr194314/test/IService.java | 6 +++++ tests/bugs154/pr194314/test/Main.java | 9 +++++++ tests/bugs154/pr194314/test/Service.java | 8 ++++++ .../pr194314/test/ServiceInterceptor.java | 26 +++++++++++++++++++ 4 files changed, 49 insertions(+) create mode 100755 tests/bugs154/pr194314/test/IService.java create mode 100755 tests/bugs154/pr194314/test/Main.java create mode 100755 tests/bugs154/pr194314/test/Service.java create mode 100755 tests/bugs154/pr194314/test/ServiceInterceptor.java diff --git a/tests/bugs154/pr194314/test/IService.java b/tests/bugs154/pr194314/test/IService.java new file mode 100755 index 000000000..0c9bb7757 --- /dev/null +++ b/tests/bugs154/pr194314/test/IService.java @@ -0,0 +1,6 @@ +package test; + + +public interface IService { + void method(long l) throws Exception; +} diff --git a/tests/bugs154/pr194314/test/Main.java b/tests/bugs154/pr194314/test/Main.java new file mode 100755 index 000000000..d1e699369 --- /dev/null +++ b/tests/bugs154/pr194314/test/Main.java @@ -0,0 +1,9 @@ +package test; + +public class Main { + + public static void main(String[] args) throws Exception { + IService service = new Service(); + service.method(42L); + } +} diff --git a/tests/bugs154/pr194314/test/Service.java b/tests/bugs154/pr194314/test/Service.java new file mode 100755 index 000000000..0a409c60a --- /dev/null +++ b/tests/bugs154/pr194314/test/Service.java @@ -0,0 +1,8 @@ +package test; + +public class Service implements IService { + + public void method(long l) throws Exception { + System.err.println("Original impl of service method, arg " + l); + } +} diff --git a/tests/bugs154/pr194314/test/ServiceInterceptor.java b/tests/bugs154/pr194314/test/ServiceInterceptor.java new file mode 100755 index 000000000..491fa5027 --- /dev/null +++ b/tests/bugs154/pr194314/test/ServiceInterceptor.java @@ -0,0 +1,26 @@ +package test; + +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; + + @Aspect public class ServiceInterceptor { +//public aspect ServiceInterceptor { + +// void around(): execution(void test.Service.method(long)) { +// Object[] args = thisJoinPoint.getArgs(); +// long id = (Long) args[0]; +// System.out.println("in advice, arg = " + id + " (before proceed)"); +// proceed(); +// System.out.println("in advice (after proceed)"); +// } + + @Around("execution(void test.Service.method(long))") + public void method(ProceedingJoinPoint pjp) throws Throwable { + Object[] args = pjp.getArgs(); + long id = (Long) args[0]; + System.out.println("in advice, arg = " + id + " (before proceed)"); + pjp.proceed(pjp.getArgs()); + System.out.println("in advice (after proceed)"); + } +} -- 2.39.5