src/java.sql/share/classes/java/sql/Time.java
changeset 48065 c4f2b6749c86
parent 47216 71c04702a3d5
equal deleted inserted replaced
48064:390794d000e6 48065:c4f2b6749c86
    25 
    25 
    26 package java.sql;
    26 package java.sql;
    27 
    27 
    28 import java.time.Instant;
    28 import java.time.Instant;
    29 import java.time.LocalTime;
    29 import java.time.LocalTime;
    30 import jdk.internal.misc.SharedSecrets;
       
    31 import jdk.internal.misc.JavaLangAccess;
       
    32 
    30 
    33 /**
    31 /**
    34  * <P>A thin wrapper around the <code>java.util.Date</code> class that allows the JDBC
    32  * <P>A thin wrapper around the <code>java.util.Date</code> class that allows the JDBC
    35  * API to identify this as an SQL <code>TIME</code> value. The <code>Time</code>
    33  * API to identify this as an SQL <code>TIME</code> value. The <code>Time</code>
    36  * class adds formatting and
    34  * class adds formatting and
    40  * value of January 1, 1970 and should not be accessed.
    38  * value of January 1, 1970 and should not be accessed.
    41  *
    39  *
    42  * @since 1.1
    40  * @since 1.1
    43  */
    41  */
    44 public class Time extends java.util.Date {
    42 public class Time extends java.util.Date {
    45 
       
    46     private static final JavaLangAccess jla = SharedSecrets.getJavaLangAccess();
       
    47 
    43 
    48     /**
    44     /**
    49      * Constructs a <code>Time</code> object initialized with the
    45      * Constructs a <code>Time</code> object initialized with the
    50      * given values for the hour, minute, and second.
    46      * given values for the hour, minute, and second.
    51      * The driver sets the date components to January 1, 1970.
    47      * The driver sets the date components to January 1, 1970.
   132         buf[2] = ':';
   128         buf[2] = ':';
   133         Date.formatDecimalInt(minute, buf, 3, 2);
   129         Date.formatDecimalInt(minute, buf, 3, 2);
   134         buf[5] = ':';
   130         buf[5] = ':';
   135         Date.formatDecimalInt(second, buf, 6, 2);
   131         Date.formatDecimalInt(second, buf, 6, 2);
   136 
   132 
   137         return jla.newStringUnsafe(buf);
   133         return new String(buf);
   138     }
   134     }
   139 
   135 
   140     // Override all the date operations inherited from java.util.Date;
   136     // Override all the date operations inherited from java.util.Date;
   141 
   137 
   142    /**
   138    /**