< prev index next >

src/java.base/share/classes/java/util/Date.java

Print this page

        

@@ -152,10 +152,11 @@
 
     /* use serialVersionUID from modified java.util.Date for
      * interoperability with JDK1.1. The Date was modified to write
      * and read only the UTC time.
      */
+    @java.io.Serial
     private static final long serialVersionUID = 7523967970034938905L;
 
     /**
      * Allocates a {@code Date} object and initializes it so that
      * it represents the time at which it was allocated, measured to the

@@ -1316,20 +1317,22 @@
      *
      * @serialData The value returned by {@code getTime()}
      *             is emitted (long).  This represents the offset from
      *             January 1, 1970, 00:00:00 GMT in milliseconds.
      */
+    @java.io.Serial
     private void writeObject(ObjectOutputStream s)
          throws IOException
     {
         s.defaultWriteObject();
         s.writeLong(getTimeImpl());
     }
 
     /**
      * Reconstitute this object from a stream (i.e., deserialize it).
      */
+    @java.io.Serial
     private void readObject(ObjectInputStream s)
          throws IOException, ClassNotFoundException
     {
         s.defaultReadObject();
         fastTime = s.readLong();
< prev index next >