test/langtools/tools/javac/defaultMethods/Neg13.java
author darcy
Fri, 02 Feb 2018 10:29:25 -0800
changeset 48723 6cb86bf0b51e
parent 47216 71c04702a3d5
permissions -rw-r--r--
8196623: Update JavaBaseTest.java to be version agnostic Reviewed-by: vromero
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
19934
1d8232b1aa18 8005222: Fixed bugs should have tests with bugid in @bug tag
jfranck
parents: 14547
diff changeset
     1
/* @test /nodynamiccopyright/
1d8232b1aa18 8005222: Fixed bugs should have tests with bugid in @bug tag
jfranck
parents: 14547
diff changeset
     2
 * @bug 7192246
14443
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
     3
 * @summary check that default method overriding object members are flagged as error
14547
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents: 14443
diff changeset
     4
 * @compile/fail/ref=Neg13.out -XDrawDiagnostics Neg13.java
14443
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
     5
 */
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
     6
interface Neg13 {
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
     7
    default protected Object clone() { return null; } //protected not allowed here
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
     8
    default boolean equals(Object obj) { return false; }
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
     9
    default protected void finalize() { } //protected not allowed here
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
    10
    default Class<?> getClass() { return null; }
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
    11
    default int hashCode() { return 0; }
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
    12
    default void notify() { }
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
    13
    default void notifyAll() { }
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
    14
    default String toString() { return null; }
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
    15
    default void wait() { }
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
    16
    default void wait(long timeout) { }
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
    17
    default void wait(long timeout, int nanos) { }
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
    18
}