javac fails jacks 8.3-runtime-1, the sympton of which is exposed by the following test:
/**
* @test %W% %E%
* @bug 4717593
* @summary Hiding of fields not fully supported
*
* @compile WhichImplicitThis5.java
* @run main WhichImplicitThis5
*/
public class WhichImplicitThis5 {
static int init;
public int i = ++init;
class One extends WhichImplicitThis5 {
private Object i; // hide enclosing i
}
class Two extends One {
// has no i member
Two() {
WhichImplicitThis5.this.super();
}
int j = i; // i from enclosing scope
int k = ((WhichImplicitThis5) this).i; // get hidden i
Object l = super.i;
}
public static void main(String[] args) {
Two t = new WhichImplicitThis5().new Two();
if (t.j != 1 || t.k != 2 || t.l != null)
throw new Error();
}
}
/**
* @test %W% %E%
* @bug 4717593
* @summary Hiding of fields not fully supported
*
* @compile WhichImplicitThis5.java
* @run main WhichImplicitThis5
*/
public class WhichImplicitThis5 {
static int init;
public int i = ++init;
class One extends WhichImplicitThis5 {
private Object i; // hide enclosing i
}
class Two extends One {
// has no i member
Two() {
WhichImplicitThis5.this.super();
}
int j = i; // i from enclosing scope
int k = ((WhichImplicitThis5) this).i; // get hidden i
Object l = super.i;
}
public static void main(String[] args) {
Two t = new WhichImplicitThis5().new Two();
if (t.j != 1 || t.k != 2 || t.l != null)
throw new Error();
}
}