< prev index next >

src/java.base/share/classes/java/util/Calendar.java

Print this page

        

@@ -1003,10 +1003,11 @@
      * @since 1.1.6
      */
     private int             serialVersionOnStream = currentSerialVersion;
 
     // Proclaim serialization compatibility with JDK 1.1
+    @java.io.Serial
     static final long       serialVersionUID = -1807547505821590642L;
 
     // Mask values for calendar fields
     @SuppressWarnings("PointlessBitwiseExpression")
     static final int ERA_MASK           = (1 << ERA);

@@ -3524,10 +3525,11 @@
      * shipped. To be compatible with JDK 1.1, we will always have to write out
      * the field values and state flags.  However, <code>nextStamp</code> can be
      * removed from the serialization stream; this will probably happen in the
      * near future.
      */
+    @java.io.Serial
     private synchronized void writeObject(ObjectOutputStream stream)
          throws IOException
     {
         // Try to compute the time correctly, for the future (stream
         // version 2) in which we don't write out fields[] or isSet[].

@@ -3578,10 +3580,11 @@
     }
 
     /**
      * Reconstitutes this object from a stream (i.e., deserialize it).
      */
+    @java.io.Serial
     private void readObject(ObjectInputStream stream)
          throws IOException, ClassNotFoundException
     {
         final ObjectInputStream input = stream;
         input.defaultReadObject();
< prev index next >