jdk/src/share/classes/java/sql/Timestamp.java
changeset 7974 676d13726d90
parent 6540 a4ae668f6125
child 9035 1255eb81cc2f
equal deleted inserted replaced
7973:dffe8439eb20 7974:676d13726d90
   471      *          and a value greater than <code>0</code> if this
   471      *          and a value greater than <code>0</code> if this
   472      *          <code>Timestamp</code> object is after the given argument.
   472      *          <code>Timestamp</code> object is after the given argument.
   473      * @since   1.4
   473      * @since   1.4
   474      */
   474      */
   475     public int compareTo(Timestamp ts) {
   475     public int compareTo(Timestamp ts) {
   476         int i = super.compareTo(ts);
   476         long thisTime = this.getTime();
       
   477         long anotherTime = ts.getTime();
       
   478         int i = (thisTime<anotherTime ? -1 :(thisTime==anotherTime?0 :1));
   477         if (i == 0) {
   479         if (i == 0) {
   478             if (nanos > ts.nanos) {
   480             if (nanos > ts.nanos) {
   479                     return 1;
   481                     return 1;
   480             } else if (nanos < ts.nanos) {
   482             } else if (nanos < ts.nanos) {
   481                 return -1;
   483                 return -1;