src/java.base/share/classes/java/time/Instant.java
changeset 57956 e0b8b019d2f5
parent 54206 003cc64366da
equal deleted inserted replaced
57955:18863bf3501f 57956:e0b8b019d2f5
   243     public static final Instant MAX = Instant.ofEpochSecond(MAX_SECOND, 999_999_999);
   243     public static final Instant MAX = Instant.ofEpochSecond(MAX_SECOND, 999_999_999);
   244 
   244 
   245     /**
   245     /**
   246      * Serialization version.
   246      * Serialization version.
   247      */
   247      */
       
   248     @java.io.Serial
   248     private static final long serialVersionUID = -665713676816604388L;
   249     private static final long serialVersionUID = -665713676816604388L;
   249 
   250 
   250     /**
   251     /**
   251      * The number of seconds from the epoch of 1970-01-01T00:00:00Z.
   252      * The number of seconds from the epoch of 1970-01-01T00:00:00Z.
   252      */
   253      */
  1340      *  out.writeInt(nanos);
  1341      *  out.writeInt(nanos);
  1341      * </pre>
  1342      * </pre>
  1342      *
  1343      *
  1343      * @return the instance of {@code Ser}, not null
  1344      * @return the instance of {@code Ser}, not null
  1344      */
  1345      */
       
  1346     @java.io.Serial
  1345     private Object writeReplace() {
  1347     private Object writeReplace() {
  1346         return new Ser(Ser.INSTANT_TYPE, this);
  1348         return new Ser(Ser.INSTANT_TYPE, this);
  1347     }
  1349     }
  1348 
  1350 
  1349     /**
  1351     /**
  1350      * Defend against malicious streams.
  1352      * Defend against malicious streams.
  1351      *
  1353      *
  1352      * @param s the stream to read
  1354      * @param s the stream to read
  1353      * @throws InvalidObjectException always
  1355      * @throws InvalidObjectException always
  1354      */
  1356      */
       
  1357     @java.io.Serial
  1355     private void readObject(ObjectInputStream s) throws InvalidObjectException {
  1358     private void readObject(ObjectInputStream s) throws InvalidObjectException {
  1356         throw new InvalidObjectException("Deserialization via serialization delegate");
  1359         throw new InvalidObjectException("Deserialization via serialization delegate");
  1357     }
  1360     }
  1358 
  1361 
  1359     void writeExternal(DataOutput out) throws IOException {
  1362     void writeExternal(DataOutput out) throws IOException {