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

logging APIs: LogRecord writes custom data before calling defaultWriteObject

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 1.4.0
    • core-libs
    • None
    • beta
    • generic
    • generic
    • Verified

      The java.util.logging.LogRecord class currently defines writeObject and
      readObject methods which write and read custom data (the version number) before
      calling defaultWriteObject and defaultReadObject. Unfortunately, this is a
      practice which will be strongly discouraged by the merlin revision of the
      serialization specification--allowing custom writeObject methods to write data
      before calling defaultWriteObject exposes an ambiguity in the serialization
      protocol; objects which write their data in this fashion cannot be reliably
      parsed if their class is unavailable in the receiving VM (for the gory details,
      see bug 4289039).

      In the case of LogRecord, it appears that the problem could be avoided by
      writing the version number after calling defaultWriteObject, instead of before.

            ghamiltosunw Graham Hamilton (Inactive)
            mwarressunw Michael Warres (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: