summaryrefslogtreecommitdiffstats
path: root/tests/bugs164
diff options
context:
space:
mode:
authoraclement <aclement>2009-01-29 03:59:59 +0000
committeraclement <aclement>2009-01-29 03:59:59 +0000
commitfedb620ccb3b5e2235e70be07153aaceaf3b5cf4 (patch)
tree117bc8f2cabe7e23cb18217855b9fcbde52a5f9f /tests/bugs164
parentb5045f23917acb21677dc31a251e629d558e7b99 (diff)
downloadaspectj-fedb620ccb3b5e2235e70be07153aaceaf3b5cf4.tar.gz
aspectj-fedb620ccb3b5e2235e70be07153aaceaf3b5cf4.zip
194314: testcode
Diffstat (limited to 'tests/bugs164')
-rw-r--r--tests/bugs164/pr194314/IService.java4
-rw-r--r--tests/bugs164/pr194314/ITDOne.java18
-rw-r--r--tests/bugs164/pr194314/ITDTwo.java15
-rw-r--r--tests/bugs164/pr194314/Main.java8
-rw-r--r--tests/bugs164/pr194314/Service.java7
-rw-r--r--tests/bugs164/pr194314/ServiceInterceptor.java17
-rw-r--r--tests/bugs164/pr194314/ServiceInterceptorCodeStyle.java15
7 files changed, 84 insertions, 0 deletions
diff --git a/tests/bugs164/pr194314/IService.java b/tests/bugs164/pr194314/IService.java
new file mode 100644
index 000000000..ed383d0e6
--- /dev/null
+++ b/tests/bugs164/pr194314/IService.java
@@ -0,0 +1,4 @@
+
+public interface IService {
+ void method(long l) throws Exception;
+}
diff --git a/tests/bugs164/pr194314/ITDOne.java b/tests/bugs164/pr194314/ITDOne.java
new file mode 100644
index 000000000..2a568ba8a
--- /dev/null
+++ b/tests/bugs164/pr194314/ITDOne.java
@@ -0,0 +1,18 @@
+interface I {
+
+}
+
+class C implements I {
+
+ public void m() {
+ foo(null,1,null);
+ fooStatic(6,1,null);
+ }
+}
+
+aspect X {
+ void around(): call(* foo(..)) {}
+ public void I.foo(String s,int i,String[] ss) {}
+ void around(): call(* fooStatic(..)) {}
+ public static void C.fooStatic(long l,int i,String[] ss) {}
+}
diff --git a/tests/bugs164/pr194314/ITDTwo.java b/tests/bugs164/pr194314/ITDTwo.java
new file mode 100644
index 000000000..b533d8d9e
--- /dev/null
+++ b/tests/bugs164/pr194314/ITDTwo.java
@@ -0,0 +1,15 @@
+interface I {
+
+}
+
+class C implements I {
+
+ public void m() {
+ foo(null,1,null);
+ }
+}
+
+aspect X {
+ void around(): call(* foo(..)) {}
+ public void I.foo(String s,int i,String[] ss) {}
+}
diff --git a/tests/bugs164/pr194314/Main.java b/tests/bugs164/pr194314/Main.java
new file mode 100644
index 000000000..f90107620
--- /dev/null
+++ b/tests/bugs164/pr194314/Main.java
@@ -0,0 +1,8 @@
+
+public class Main {
+
+ public static void main(String[] args) throws Exception {
+ IService service = new Service();
+ service.method(42L);
+ }
+}
diff --git a/tests/bugs164/pr194314/Service.java b/tests/bugs164/pr194314/Service.java
new file mode 100644
index 000000000..f3302fa40
--- /dev/null
+++ b/tests/bugs164/pr194314/Service.java
@@ -0,0 +1,7 @@
+
+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/bugs164/pr194314/ServiceInterceptor.java b/tests/bugs164/pr194314/ServiceInterceptor.java
new file mode 100644
index 000000000..9ce6e8e6d
--- /dev/null
+++ b/tests/bugs164/pr194314/ServiceInterceptor.java
@@ -0,0 +1,17 @@
+
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+
+@Aspect
+public class ServiceInterceptor {
+
+ @Around("execution(void 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)");
+ }
+}
diff --git a/tests/bugs164/pr194314/ServiceInterceptorCodeStyle.java b/tests/bugs164/pr194314/ServiceInterceptorCodeStyle.java
new file mode 100644
index 000000000..b08047d6b
--- /dev/null
+++ b/tests/bugs164/pr194314/ServiceInterceptorCodeStyle.java
@@ -0,0 +1,15 @@
+
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+
+public aspect ServiceInterceptorCodeStyle {
+
+ void around(): execution(void 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)");
+ }
+}