Maurizio Cimadamore d4be9a13c8 7192246: Add type-checking support for default methods
Add type-checking support for default methods as per Featherweight-Defender document

Reviewed-by: jjg, dlsmith
2012-11-04 10:59:42 +00:00

19 lines
755 B
Java

/*
* @test /nodynamiccopyright/
* @summary check that default method overriding object members are flagged as error
* @compile/fail/ref=Neg13.out -XDallowDefaultMethods -XDrawDiagnostics Neg13.java
*/
interface Neg13 {
default protected Object clone() { return null; } //protected not allowed here
default boolean equals(Object obj) { return false; }
default protected void finalize() { } //protected not allowed here
default Class<?> getClass() { return null; }
default int hashCode() { return 0; }
default void notify() { }
default void notifyAll() { }
default String toString() { return null; }
default void wait() { }
default void wait(long timeout) { }
default void wait(long timeout, int nanos) { }
}