test/tools/javac/6563143/OverridesEqualsButNotHashCodeTest.java

Thu, 21 Feb 2013 14:43:51 -0800

author
rfield
date
Thu, 21 Feb 2013 14:43:51 -0800
changeset 1601
cd7340a84bb8
parent 1588
2620c953e9fe
child 1607
bd49e0304281
permissions
-rw-r--r--

8008405: Now that metafactory is in place, add javac lambda serialization tests
Summary: Tests part of original langtools serialization review.
Reviewed-by: mcimadamore

     1 /*
     2  * @test /nodynamiccopyright/
     3  * @bug 6563143
     4  * @summary javac should issue a warning for overriding equals without hashCode
     5  * @compile/ref=OverridesEqualsButNotHashCodeTest.out -Xlint:overrides -XDrawDiagnostics OverridesEqualsButNotHashCodeTest.java
     6  */
     8 @SuppressWarnings("overrides")
     9 public class OverridesEqualsButNotHashCodeTest {
    10     @Override
    11     public boolean equals(Object o) {
    12         return o == this;
    13     }
    14 }
    16 class Other {
    17     @Override
    18     public boolean equals(Object o) {
    19         return o == this;
    20     }
    21 }

mercurial