src/java.base/share/classes/java/util/Date.java
changeset 57956 e0b8b019d2f5
parent 52772 beb2b88a118e
child 58242 94bb65cb37d3
equal deleted inserted replaced
57955:18863bf3501f 57956:e0b8b019d2f5
     1 /*
     1 /*
     2  * Copyright (c) 1994, 2018, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
   152 
   152 
   153     /* use serialVersionUID from modified java.util.Date for
   153     /* use serialVersionUID from modified java.util.Date for
   154      * interoperability with JDK1.1. The Date was modified to write
   154      * interoperability with JDK1.1. The Date was modified to write
   155      * and read only the UTC time.
   155      * and read only the UTC time.
   156      */
   156      */
       
   157     @java.io.Serial
   157     private static final long serialVersionUID = 7523967970034938905L;
   158     private static final long serialVersionUID = 7523967970034938905L;
   158 
   159 
   159     /**
   160     /**
   160      * Allocates a {@code Date} object and initializes it so that
   161      * Allocates a {@code Date} object and initializes it so that
   161      * it represents the time at which it was allocated, measured to the
   162      * it represents the time at which it was allocated, measured to the
  1316      *
  1317      *
  1317      * @serialData The value returned by {@code getTime()}
  1318      * @serialData The value returned by {@code getTime()}
  1318      *             is emitted (long).  This represents the offset from
  1319      *             is emitted (long).  This represents the offset from
  1319      *             January 1, 1970, 00:00:00 GMT in milliseconds.
  1320      *             January 1, 1970, 00:00:00 GMT in milliseconds.
  1320      */
  1321      */
       
  1322     @java.io.Serial
  1321     private void writeObject(ObjectOutputStream s)
  1323     private void writeObject(ObjectOutputStream s)
  1322          throws IOException
  1324          throws IOException
  1323     {
  1325     {
  1324         s.defaultWriteObject();
  1326         s.defaultWriteObject();
  1325         s.writeLong(getTimeImpl());
  1327         s.writeLong(getTimeImpl());
  1326     }
  1328     }
  1327 
  1329 
  1328     /**
  1330     /**
  1329      * Reconstitute this object from a stream (i.e., deserialize it).
  1331      * Reconstitute this object from a stream (i.e., deserialize it).
  1330      */
  1332      */
       
  1333     @java.io.Serial
  1331     private void readObject(ObjectInputStream s)
  1334     private void readObject(ObjectInputStream s)
  1332          throws IOException, ClassNotFoundException
  1335          throws IOException, ClassNotFoundException
  1333     {
  1336     {
  1334         s.defaultReadObject();
  1337         s.defaultReadObject();
  1335         fastTime = s.readLong();
  1338         fastTime = s.readLong();