Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8180807

java.io.Serializable class-level readObject description error

    Details

      Backports

        Description

        The class-level description for java.io.Serialization contains:

        "The readObject method is responsible for reading from the stream and restoring the classes fields. It may call in.defaultReadObject to invoke the default mechanism for restoring the object's non-static and non-transient fields. The defaultReadObject method uses information in the stream to assign the fields of the object saved in the stream with the correspondingly named fields in the current object. This handles the case when the class has evolved to add new fields. The method does not need to concern itself with the state belonging to its superclasses or subclasses. State is saved by writing the individual fields to the ObjectOutputStream using the writeObject method or by using the methods for primitive data types supported by DataOutput."

        The last sentence should be: "State is restored by reading data from the ObjectInputStream for the individual fields and making assignments to the appropriate fields of the object. Reading primitive data types is supported by DataInput."

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  mli Hamlin Li
                  Reporter:
                  mli Hamlin Li
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: