summaryrefslogtreecommitdiffstats
path: root/tests/pureJava/NestedInners.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/pureJava/NestedInners.java')
-rw-r--r--tests/pureJava/NestedInners.java33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/pureJava/NestedInners.java b/tests/pureJava/NestedInners.java
new file mode 100644
index 000000000..ed07573bf
--- /dev/null
+++ b/tests/pureJava/NestedInners.java
@@ -0,0 +1,33 @@
+import org.aspectj.testing.Tester;
+
+public class NestedInners {
+ public static void main(String[] args) {
+ Runnable r = new Outer().m("arg:");
+ r.run();
+ Tester.check("arg:varg:0");
+ Tester.check("deep-arg:varg:1");
+ r.run();
+ Tester.check("arg:varg:2");
+ Tester.check("deep-arg:varg:3");
+ }
+}
+
+
+class Outer {
+ public Runnable m(final String sarg) {
+ final String svar = "v"+sarg;
+
+ return new Runnable() {
+ int counter = 0;
+
+ public void run() {
+ Tester.note(sarg + svar+counter++);
+ new Runnable() {
+ public void run() {
+ Tester.note("deep-" + sarg + svar+counter++);
+ }
+ }.run();
+ }
+ };
+ }
+}