aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs1810/500035/Code4.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/bugs1810/500035/Code4.java')
-rw-r--r--tests/bugs1810/500035/Code4.java35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/bugs1810/500035/Code4.java b/tests/bugs1810/500035/Code4.java
new file mode 100644
index 000000000..176ce2011
--- /dev/null
+++ b/tests/bugs1810/500035/Code4.java
@@ -0,0 +1,35 @@
+import org.aspectj.lang.annotation.*;
+import org.aspectj.lang.*;
+
+public aspect Code4 {
+
+ void around(Foo targeto, String s): call(* Foo.run(String)) && args(s) && target(targeto) {
+ System.out.println("first: binding target, just passing everything through");
+ proceed(targeto, s);
+ }
+
+ public static void main(String []argv) {
+ new Foo(0).execute();
+ }
+}
+
+class Foo {
+ int i;
+ public Foo(int i) {
+ this.i = i;
+ }
+
+ public void execute() {
+ Foo f1 = new Foo(1);
+ Foo f2 = new Foo(2);
+ f1.run("abc");
+ }
+
+ public void run(String s) {
+ System.out.println("Executing run("+s+") on "+this.toString());
+ }
+
+ public String toString() {
+ return ("Foo(i="+i+")");
+ }
+}