author | prr |
Fri, 25 May 2018 12:12:24 -0700 | |
changeset 50347 | b2f046ae8eb6 |
parent 49518 | d0ff431a596e |
permissions | -rw-r--r-- |
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 |
* |
|
49518
d0ff431a596e
8198314: javac hidden options violate standard syntax for options
vromero
parents:
47216
diff
changeset
|
7 |
* @compile/fail/ref=InterfaceMemberClassModifiers.out --diags=layout=%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 |
} |