author | lana |
Tue, 25 Apr 2017 07:38:50 +0000 | |
changeset 44909 | b53c770dc04f |
parent 40835 | 6ab9ed1abc46 |
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 |
* |
|
40835
6ab9ed1abc46
8162546: change hidden options -Xdebug to --debug, -XshouldStop to --should-stop, and -diags to --diags
vromero
parents:
39812
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 |
} |