From 5b14ac997e0b4ea0a77b8342c41c99f785b338c6 Mon Sep 17 00:00:00 2001 From: lancea 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 --- src/share/classes/java/sql/Timestamp.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/share/classes/java/sql/Timestamp.java b/src/share/classes/java/sql/Timestamp.java index 848606bcf..14f648b26 100644 --- a/src/share/classes/java/sql/Timestamp.java +++ b/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; } -- GitLab