diff -r 3a2ebbad5911 -r 12f99d1f23d9 test/tools/javac/DefiniteAssignment/T8039026.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/DefiniteAssignment/T8039026.java Wed Apr 30 23:29:43 2014 +0100 @@ -0,0 +1,21 @@ +/* + * @test /nodynamiccopyright/ + * @bug 8039026 + * @summary Definitely unassigned field can be accessed + * @compile/fail/ref=T8039026.out -XDrawDiagnostics T8039026.java + */ + +public class T8039026 { + final int x,y,z; + final int a = this.y; // <- error + { + int b = true ? this.x : 0; // <- error + System.out.println(this.x); // <- error + this.y = 1; + } + T8039026() { + this.x = 1; // <- no error! + this.y = 1; // <- error + this.z = this.x; // <- no error + } +}