10
|
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 |
*
|
6150
|
7 |
* @compile/fail/ref=InterfaceMemberClassModifiers.out -XDdiags=%b:%l:%_%m InterfaceMemberClassModifiers.java
|
10
|
8 |
*/
|
|
9 |
|
|
10 |
public interface InterfaceMemberClassModifiers {
|
|
11 |
|
|
12 |
Object nullWriter = null;
|
|
13 |
|
|
14 |
class SomeClass1 implements InterfaceMemberClassModifiers { // OK
|
|
15 |
public Object getOut() {
|
|
16 |
return nullWriter;
|
|
17 |
}
|
|
18 |
}
|
|
19 |
|
|
20 |
public class SomeClass2 implements InterfaceMemberClassModifiers { // OK
|
|
21 |
public Object getOut() {
|
|
22 |
return nullWriter;
|
|
23 |
}
|
|
24 |
}
|
|
25 |
|
|
26 |
// Compiler used to crash on these! (after reporting error)
|
|
27 |
|
|
28 |
protected class SomeClass3 implements InterfaceMemberClassModifiers { // illegal
|
|
29 |
public Object getOut() {
|
|
30 |
return nullWriter;
|
|
31 |
}
|
|
32 |
}
|
|
33 |
|
|
34 |
private class SomeClass4 implements InterfaceMemberClassModifiers { // illegal
|
|
35 |
public Object getOut() {
|
|
36 |
return nullWriter;
|
|
37 |
}
|
|
38 |
}
|
|
39 |
|
|
40 |
}
|