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

(spec) serialization doc should mention writeReplace/readResolve inheritance and overrideability

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • 1.4.0
    • core-libs

      A little-known "feature" of serialization's writeReplace/readResolve
      functionality is that a subclass of a serialization class that defines
      writeReplace and/or readResolve can in effect negate the superclass'
      intended replacement behavior by defining its own writeReplace/readResolve
      method which returns a reference to "this".

      In light of this, designers of serializable classes which use writeReplace or
      readResolve must be prepared for the possibility that the class may be
      serialized without replacement, despite the presence of a writeReplace
      or readResolve method.

            Unassigned Unassigned
            mwarressunw Michael Warres (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: