See 15.9.5.1 for why it is explicitly allowed in the context of this test
/*
* @test @(#)SuperNew3.java 1.2 02/08/26
* @bug 4432312 4721003
* @summary compiler crash with assertion failure (inner classes)
* @author gafter
*
* @compile SuperNew3.java
*/
public class SuperNew3 {
SuperNew3() {}
SuperNew3(Object o) {}
void foo() {
class One extends SuperNew3 {}
class Two extends SuperNew3 {
Two() {
super(new One() {
{ new One(); }
});
}
}
}
}
/*
* @test @(#)SuperNew3.java 1.2 02/08/26
* @bug 4432312 4721003
* @summary compiler crash with assertion failure (inner classes)
* @author gafter
*
* @compile SuperNew3.java
*/
public class SuperNew3 {
SuperNew3() {}
SuperNew3(Object o) {}
void foo() {
class One extends SuperNew3 {}
class Two extends SuperNew3 {
Two() {
super(new One() {
{ new One(); }
});
}
}
}
}