From 1c94406e2a1dbe6aafabef7265fe297b5d90d331 Mon Sep 17 00:00:00 2001 From: Lance Andersen Date: Mon, 18 Apr 2011 12:07:29 -0400 Subject: [PATCH] 7037085: Add hashCode() to Timestamp to address Findbugs warning Reviewed-by: darcy, alanb, emcmanus --- jdk/src/share/classes/java/sql/Timestamp.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/jdk/src/share/classes/java/sql/Timestamp.java b/jdk/src/share/classes/java/sql/Timestamp.java index 848606bcfbc..14f648b2678 100644 --- a/jdk/src/share/classes/java/sql/Timestamp.java +++ b/jdk/src/share/classes/java/sql/Timestamp.java @@ -54,7 +54,7 @@ import java.util.StringTokenizer; * As a result, the Timestamp.equals(Object) * method is not symmetric with respect to the * java.util.Date.equals(Object) - * method. Also, the hashcode method uses the underlying + * method. Also, the hashCode method uses the underlying * java.util.Date * implementation and therefore does not include nanos in its computation. *

@@ -515,6 +515,18 @@ public class Timestamp extends java.util.Date { } } + /** + * {@inheritDoc} + * + * The {@code hashCode} method uses the underlying {@code java.util.Date} + * implementation and therefore does not include nanos in its computation. + * + */ + @Override + public int hashCode() { + return super.hashCode(); + } + static final long serialVersionUID = 2745179027874758501L; }