src/java.base/share/classes/java/time/chrono/ChronoPeriodImpl.java
changeset 57956 e0b8b019d2f5
parent 52078 4a63197816ce
child 58520 e036ee8bae56
equal deleted inserted replaced
57955:18863bf3501f 57956:e0b8b019d2f5
     1 /*
     1 /*
     2  * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2013, 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
    96     // this class is only used by JDK chronology implementations and makes assumptions based on that fact
    96     // this class is only used by JDK chronology implementations and makes assumptions based on that fact
    97 
    97 
    98     /**
    98     /**
    99      * Serialization version.
    99      * Serialization version.
   100      */
   100      */
       
   101     @java.io.Serial
   101     private static final long serialVersionUID = 57387258289L;
   102     private static final long serialVersionUID = 57387258289L;
   102 
   103 
   103     /**
   104     /**
   104      * The set of supported units.
   105      * The set of supported units.
   105      */
   106      */
   364      *  out.writeInt(days);
   365      *  out.writeInt(days);
   365      * </pre>
   366      * </pre>
   366      *
   367      *
   367      * @return the instance of {@code Ser}, not null
   368      * @return the instance of {@code Ser}, not null
   368      */
   369      */
       
   370     @java.io.Serial
   369     protected Object writeReplace() {
   371     protected Object writeReplace() {
   370         return new Ser(Ser.CHRONO_PERIOD_TYPE, this);
   372         return new Ser(Ser.CHRONO_PERIOD_TYPE, this);
   371     }
   373     }
   372 
   374 
   373     /**
   375     /**
   374      * Defend against malicious streams.
   376      * Defend against malicious streams.
   375      *
   377      *
   376      * @param s the stream to read
   378      * @param s the stream to read
   377      * @throws InvalidObjectException always
   379      * @throws InvalidObjectException always
   378      */
   380      */
       
   381     @java.io.Serial
   379     private void readObject(ObjectInputStream s) throws ObjectStreamException {
   382     private void readObject(ObjectInputStream s) throws ObjectStreamException {
   380         throw new InvalidObjectException("Deserialization via serialization delegate");
   383         throw new InvalidObjectException("Deserialization via serialization delegate");
   381     }
   384     }
   382 
   385 
   383     void writeExternal(DataOutput out) throws IOException {
   386     void writeExternal(DataOutput out) throws IOException {