8016698: Cleanup overrides warning in sun/tools/ClassDeclaration.java
Summary: Override Object.hashCode()
Reviewed-by: alanb, chegar
--- 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
*/