src/java.base/share/classes/java/time/YearMonth.java
changeset 57956 e0b8b019d2f5
parent 52078 4a63197816ce
equal deleted inserted replaced
57955:18863bf3501f 57956:e0b8b019d2f5
     1 /*
     1 /*
     2  * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2012, 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
   132         implements Temporal, TemporalAdjuster, Comparable<YearMonth>, Serializable {
   132         implements Temporal, TemporalAdjuster, Comparable<YearMonth>, Serializable {
   133 
   133 
   134     /**
   134     /**
   135      * Serialization version.
   135      * Serialization version.
   136      */
   136      */
       
   137     @java.io.Serial
   137     private static final long serialVersionUID = 4183400860270640070L;
   138     private static final long serialVersionUID = 4183400860270640070L;
   138     /**
   139     /**
   139      * Parser.
   140      * Parser.
   140      */
   141      */
   141     private static final DateTimeFormatter PARSER = new DateTimeFormatterBuilder()
   142     private static final DateTimeFormatter PARSER = new DateTimeFormatterBuilder()
  1220      *  out.writeByte(month);
  1221      *  out.writeByte(month);
  1221      * </pre>
  1222      * </pre>
  1222      *
  1223      *
  1223      * @return the instance of {@code Ser}, not null
  1224      * @return the instance of {@code Ser}, not null
  1224      */
  1225      */
       
  1226     @java.io.Serial
  1225     private Object writeReplace() {
  1227     private Object writeReplace() {
  1226         return new Ser(Ser.YEAR_MONTH_TYPE, this);
  1228         return new Ser(Ser.YEAR_MONTH_TYPE, this);
  1227     }
  1229     }
  1228 
  1230 
  1229     /**
  1231     /**
  1230      * Defend against malicious streams.
  1232      * Defend against malicious streams.
  1231      *
  1233      *
  1232      * @param s the stream to read
  1234      * @param s the stream to read
  1233      * @throws InvalidObjectException always
  1235      * @throws InvalidObjectException always
  1234      */
  1236      */
       
  1237     @java.io.Serial
  1235     private void readObject(ObjectInputStream s) throws InvalidObjectException {
  1238     private void readObject(ObjectInputStream s) throws InvalidObjectException {
  1236         throw new InvalidObjectException("Deserialization via serialization delegate");
  1239         throw new InvalidObjectException("Deserialization via serialization delegate");
  1237     }
  1240     }
  1238 
  1241 
  1239     void writeExternal(DataOutput out) throws IOException {
  1242     void writeExternal(DataOutput out) throws IOException {