summaryrefslogtreecommitdiffstats
path: root/tests/pureJava/InnerAccess.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/pureJava/InnerAccess.java')
-rw-r--r--tests/pureJava/InnerAccess.java60
1 files changed, 60 insertions, 0 deletions
diff --git a/tests/pureJava/InnerAccess.java b/tests/pureJava/InnerAccess.java
new file mode 100644
index 000000000..3bf40b3a6
--- /dev/null
+++ b/tests/pureJava/InnerAccess.java
@@ -0,0 +1,60 @@
+import org.aspectj.testing.Tester;
+
+import java.util.*;
+
+public class InnerAccess {
+ public static void main(String[] args) {
+ Tester.checkEqual(new C().getCount(), 3);
+ }
+}
+
+
+class C {
+ protected int i = 2;
+ private String s = "hi";
+
+ Runnable r = new Runnable() {
+ public void run() {
+ s += "s";
+ }
+ };
+
+ public int getCount() {
+ return new Object() {
+ public int m() {
+ r.run();
+ return s.length();
+ }
+ }.m();
+ }
+}
+
+class DI extends D.Inner {
+}
+
+
+class D implements Map.Entry {
+ public Object getKey() { return null; }
+ public Object getValue() { return null; }
+ public Object setValue(Object o) { return o; }
+
+ static class Inner {}
+}
+
+
+class Outer {
+ class Middle {
+ class Inner {
+ void m() {
+ Inner.this.m1();
+ Middle.this.m1();
+ Outer.this.m1();
+ }
+
+ void m1() {}
+ }
+ void m1() {}
+ }
+ void m1() {}
+}
+