2007-12-01 00:00:00 +00:00
|
|
|
/*
|
|
|
|
* @test /nodynamiccopyright/
|
|
|
|
* @bug 4294065 4785453
|
|
|
|
* @summary Verify that invalid access modifiers on interface members don't cause crash.
|
|
|
|
* @author maddox
|
|
|
|
*
|
2018-04-04 03:58:52 +00:00
|
|
|
* @compile/fail/ref=InterfaceMemberClassModifiers.out --diags=layout=%b:%l:%_%m InterfaceMemberClassModifiers.java
|
2007-12-01 00:00:00 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
public interface InterfaceMemberClassModifiers {
|
|
|
|
|
|
|
|
Object nullWriter = null;
|
|
|
|
|
|
|
|
class SomeClass1 implements InterfaceMemberClassModifiers { // OK
|
|
|
|
public Object getOut() {
|
|
|
|
return nullWriter;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public class SomeClass2 implements InterfaceMemberClassModifiers { // OK
|
|
|
|
public Object getOut() {
|
|
|
|
return nullWriter;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Compiler used to crash on these! (after reporting error)
|
|
|
|
|
|
|
|
protected class SomeClass3 implements InterfaceMemberClassModifiers { // illegal
|
|
|
|
public Object getOut() {
|
|
|
|
return nullWriter;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private class SomeClass4 implements InterfaceMemberClassModifiers { // illegal
|
|
|
|
public Object getOut() {
|
|
|
|
return nullWriter;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|