test/tools/javac/6521805/T6521805d.java

changeset 0
959103a6100f
child 2525
2eb010b6cb22
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/test/tools/javac/6521805/T6521805d.java	Wed Apr 27 01:34:52 2016 +0800
     1.3 @@ -0,0 +1,27 @@
     1.4 +/*
     1.5 + * @test /nodynamiccopyright/
     1.6 + * @bug 6521805
     1.7 + * @summary Regression: JDK5/JDK6 javac allows write access to outer class reference
     1.8 + * @author mcimadamore
     1.9 + *
    1.10 + * @compile/fail/ref=T6521805d.out T6521805d.java -XDrawDiagnostics
    1.11 + */
    1.12 +
    1.13 +class T6521805 {
    1.14 +
    1.15 +    static class Inner extends T6521805.Outer {
    1.16 +
    1.17 +        Inner(T6521805 t) {
    1.18 +            t.super();
    1.19 +        }
    1.20 +
    1.21 +        T6521805 this$0 = null;
    1.22 +
    1.23 +        public void foo() {
    1.24 +            this$0 = new T6521805();
    1.25 +        }
    1.26 +    }
    1.27 +
    1.28 +    class Outer {}
    1.29 +
    1.30 +}

mercurial