8016698: Cleanup overrides warning in sun/tools/ClassDeclaration.java
authorkhazra
Wed, 19 Jun 2013 14:13:41 -0700
changeset 18293 5d768c1bf246
parent 18292 3d40978f5ff8
child 18294 364814dc7391
8016698: Cleanup overrides warning in sun/tools/ClassDeclaration.java Summary: Override Object.hashCode() Reviewed-by: alanb, chegar
jdk/src/share/classes/sun/tools/java/ClassDeclaration.java
--- a/jdk/src/share/classes/sun/tools/java/ClassDeclaration.java	Wed Jun 19 14:02:38 2013 -0700
+++ b/jdk/src/share/classes/sun/tools/java/ClassDeclaration.java	Wed Jun 19 14:13:41 2013 -0700
@@ -230,12 +230,17 @@
      * Equality
      */
     public boolean equals(Object obj) {
-        if ((obj != null) && (obj instanceof ClassDeclaration)) {
+        if (obj instanceof ClassDeclaration) {
             return type.equals(((ClassDeclaration)obj).type);
         }
         return false;
     }
 
+    @Override
+    public int hashCode() {
+        return type.hashCode();
+    }
+
     /**
      * toString
      */