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

Serialized Form description of j.l.String is not consistent with the implementation

    XMLWordPrintable

Details

    Backports

      Description

        In the description of the serialized form for the j.l.String class we have:
        "Class String is special cased within the Serialization Stream Protocol. A String instance is written initially into an ObjectOutputStream in the following format:
               TC_STRING (utf String)
        The String is written by method DataOutput.writeUTF. A new handle is generated to refer to all future references to the string instance within the stream."

        But in fact if utf length of the string is bigger than 0xFFFF, then a String instance is written in the following format:
        TC_LONGSTRING (utf String).

        Attachments

          Issue Links

            Activity

              People

                rriggs Roger Riggs
                evotchen Elena Votchennikova (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: