Tue, 21 May 2013 13:50:56 +0100
8005207: test has 2 @bug tags
Reviewed-by: mcimadamore
1 /*
2 * @test /nodynamiccopyright/
3 * @bug 4294065 4785453
4 * @summary Verify that invalid access modifiers on interface members don't cause crash.
5 * @author maddox
6 *
7 * @compile/fail/ref=InterfaceMemberClassModifiers.out -XDdiags=%b:%l:%_%m InterfaceMemberClassModifiers.java
8 */
10 public interface InterfaceMemberClassModifiers {
12 Object nullWriter = null;
14 class SomeClass1 implements InterfaceMemberClassModifiers { // OK
15 public Object getOut() {
16 return nullWriter;
17 }
18 }
20 public class SomeClass2 implements InterfaceMemberClassModifiers { // OK
21 public Object getOut() {
22 return nullWriter;
23 }
24 }
26 // Compiler used to crash on these! (after reporting error)
28 protected class SomeClass3 implements InterfaceMemberClassModifiers { // illegal
29 public Object getOut() {
30 return nullWriter;
31 }
32 }
34 private class SomeClass4 implements InterfaceMemberClassModifiers { // illegal
35 public Object getOut() {
36 return nullWriter;
37 }
38 }
40 }