1 /*
2 * @test /nodynamiccopyright/
3 * @bug 8334248
4 * @summary Invalid error for early construction local class constructor method reference
5 * @build InitializationWarningTester
6 * @run main InitializationWarningTester EarlyIndirectOuterCapture
7 */
8
9 public class EarlyIndirectOuterCapture {
10
11 EarlyIndirectOuterCapture() {
12 this(null);
13 }
14
15 EarlyIndirectOuterCapture(InnerSuperclass inner) { }
16
17 class InnerSuperclass { }
18
19 static class InnerOuter extends EarlyIndirectOuterCapture { // accessible
20 class InnerInnerOuter extends EarlyIndirectOuterCapture { // not accessible
21 InnerInnerOuter() {
22 super(new InnerSuperclass() { }); // should this be accepted?, InnerSuperclass is not an inner class of InnerInnerOuter
23 }
24
25 InnerInnerOuter(boolean b) {
26 super(InnerOuter.this.new InnerSuperclass() { }); // ok, explicit
27 }
28 }
29 }
30 }