test/tools/javac/6563143/OverridesEqualsButNotHashCodeTest.java

Thu, 21 Feb 2013 15:26:46 +0000

author
mcimadamore
date
Thu, 21 Feb 2013 15:26:46 +0000
changeset 1599
9f0ec00514b6
parent 1588
2620c953e9fe
child 1607
bd49e0304281
permissions
-rw-r--r--

8007461: Regression: bad overload resolution when inner class and outer class have method with same name
Summary: Fix regression in varargs method resolution introduced by bad refactoring
Reviewed-by: jjg

     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