From 3c17034b986d77f6675c6415bb336c7ceb53f24a Mon Sep 17 00:00:00 2001 From: khazra Date: Wed, 19 Jun 2013 14:13:41 -0700 Subject: [PATCH] 8016698: Cleanup overrides warning in sun/tools/ClassDeclaration.java Summary: Override Object.hashCode() Reviewed-by: alanb, chegar --- src/share/classes/sun/tools/java/ClassDeclaration.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/share/classes/sun/tools/java/ClassDeclaration.java b/src/share/classes/sun/tools/java/ClassDeclaration.java index c13d1e287..7bc48414d 100644 --- a/src/share/classes/sun/tools/java/ClassDeclaration.java +++ b/src/share/classes/sun/tools/java/ClassDeclaration.java @@ -230,12 +230,17 @@ class ClassDeclaration implements Constants { * 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 */ -- GitLab