Fri, 24 Apr 2020 03:58:51 +0100
Merge
duke@1 | 1 | /* |
duke@1 | 2 | * @test /nodynamiccopyright/ |
duke@1 | 3 | * @bug 5003235 |
duke@1 | 4 | * @summary Private inner class accessible from subclasses |
duke@1 | 5 | * @author Peter von der Ah\u00e9 |
jjg@611 | 6 | * @compile/fail/ref=T5003235a.out -XDdiags=%b:%l:%_%m T5003235a.java |
duke@1 | 7 | */ |
duke@1 | 8 | |
duke@1 | 9 | class Super { |
duke@1 | 10 | Inner i; |
duke@1 | 11 | private class Inner { |
duke@1 | 12 | void defaultM() {} |
duke@1 | 13 | protected void protectedM() {} |
duke@1 | 14 | public void publicM() {} |
duke@1 | 15 | private void privateM() {} |
duke@1 | 16 | } |
duke@1 | 17 | } |
duke@1 | 18 | |
duke@1 | 19 | class Sub extends Super { |
duke@1 | 20 | void foo() { |
duke@1 | 21 | i.defaultM(); |
duke@1 | 22 | i.protectedM(); |
duke@1 | 23 | i.publicM(); |
duke@1 | 24 | i.privateM(); |
duke@1 | 25 | } |
duke@1 | 26 | } |