test/tools/javac/6521805/T6521805a.java

Fri, 28 Jan 2011 12:01:07 +0000

author
mcimadamore
date
Fri, 28 Jan 2011 12:01:07 +0000
changeset 844
2088e674f0e0
parent 384
ed31953ca025
child 2525
2eb010b6cb22
permissions
-rw-r--r--

6910550: javac 1.5.0_17 fails with incorrect error message
Summary: multiple clashing members declared in same class should be added to the class' scope in order to avoid downstream spurious diagnostics
Reviewed-by: jjg

     1 /*
     2  * @test /nodynamiccopyright/
     3  * @bug 6521805
     4  * @summary Regression: JDK5/JDK6 javac allows write access to outer class reference
     5  * @author mcimadamore
     6  *
     7  * @compile/fail/ref=T6521805a_1.out T6521805a.java -XDrawDiagnostics
     8  * @compile/ref=T6521805a_2.out T6521805a.java -XDwarnOnSyntheticConflicts -XDrawDiagnostics
     9  */
    11 class T6521805a {
    13     static class Outer {
    14         T6521805a this$0 = null;
    15     }
    17     public class Inner extends Outer {
    18         public void foo() {
    19             this$0 = new T6521805a();
    20         }
    21     }
    22 }

mercurial