< prev index next >

src/java.base/share/classes/java/math/BigInteger.java

Print this page

        

@@ -4602,10 +4602,11 @@
         }
         return fn;
     }
 
     /** use serialVersionUID from JDK 1.1. for interoperability */
+    @java.io.Serial
     private static final long serialVersionUID = -8287574255936472291L;
 
     /**
      * Serializable fields for BigInteger.
      *

@@ -4620,10 +4621,11 @@
      * @serialField firstNonzeroByteNum int
      *              appears in the serialized form for backward compatibility
      * @serialField lowestSetBit int
      *              appears in the serialized form for backward compatibility
      */
+    @java.io.Serial
     private static final ObjectStreamField[] serialPersistentFields = {
         new ObjectStreamField("signum", Integer.TYPE),
         new ObjectStreamField("magnitude", byte[].class),
         new ObjectStreamField("bitCount", Integer.TYPE),
         new ObjectStreamField("bitLength", Integer.TYPE),

@@ -4641,10 +4643,11 @@
      * bitLengthPlusOne and lowestSetBitPlusTwo, to 0 rather than some other
      * marker value. Therefore, no explicit action to set these fields needs to
      * be taken in readObject because those fields already have a 0 value by
      * default since defaultReadObject is not being used.
      */
+    @java.io.Serial
     private void readObject(java.io.ObjectInputStream s)
         throws java.io.IOException, ClassNotFoundException {
         // prepare to read the alternate persistent fields
         ObjectInputStream.GetField fields = s.readFields();
 

@@ -4707,10 +4710,11 @@
      * {@code bitCount}, {@code bitLength}, {@code lowestSetBit}, and
      * {@code firstNonzeroByteNum}, respectively.  These values are compatible
      * with older implementations, but will be ignored by current
      * implementations.
      */
+    @java.io.Serial
     private void writeObject(ObjectOutputStream s) throws IOException {
         // set the values of the Serializable fields
         ObjectOutputStream.PutField fields = s.putFields();
         fields.put("signum", signum);
         fields.put("magnitude", magSerializedForm());
< prev index next >