< prev index next >

src/java.base/share/classes/java/time/Duration.java

Print this page

        

@@ -138,10 +138,11 @@
      */
     public static final Duration ZERO = new Duration(0, 0);
     /**
      * Serialization version.
      */
+    @java.io.Serial
     private static final long serialVersionUID = 3078945930695997490L;
     /**
      * Constant for nanos per second.
      */
     private static final BigInteger BI_NANOS_PER_SECOND = BigInteger.valueOf(NANOS_PER_SECOND);

@@ -1527,20 +1528,22 @@
      *  out.writeInt(nanos);
      * </pre>
      *
      * @return the instance of {@code Ser}, not null
      */
+    @java.io.Serial
     private Object writeReplace() {
         return new Ser(Ser.DURATION_TYPE, this);
     }
 
     /**
      * Defend against malicious streams.
      *
      * @param s the stream to read
      * @throws InvalidObjectException always
      */
+    @java.io.Serial
     private void readObject(ObjectInputStream s) throws InvalidObjectException {
         throw new InvalidObjectException("Deserialization via serialization delegate");
     }
 
     void writeExternal(DataOutput out) throws IOException {
< prev index next >