7000693: java.sql.Timestamp compareTo() issues using low values
authorlancea
Tue, 11 Jan 2011 12:36:43 -0500
changeset 7974 676d13726d90
parent 7973 dffe8439eb20
child 7975 f0de2d05f34c
7000693: java.sql.Timestamp compareTo() issues using low values Reviewed-by: okutsu
jdk/src/share/classes/java/sql/Timestamp.java
--- a/jdk/src/share/classes/java/sql/Timestamp.java	Mon Jan 10 17:06:10 2011 -0800
+++ b/jdk/src/share/classes/java/sql/Timestamp.java	Tue Jan 11 12:36:43 2011 -0500
@@ -473,7 +473,9 @@
      * @since   1.4
      */
     public int compareTo(Timestamp ts) {
-        int i = super.compareTo(ts);
+        long thisTime = this.getTime();
+        long anotherTime = ts.getTime();
+        int i = (thisTime<anotherTime ? -1 :(thisTime==anotherTime?0 :1));
         if (i == 0) {
             if (nanos > ts.nanos) {
                     return 1;