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

Serialization spec should be extended for writeReplace and readResolve lookup

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • 17
    • core-libs

      A DESCRIPTION OF THE PROBLEM :
      Currently the serialization specification (and possibly also the Javadoc of java.io.Serializable) seems to be incomplete regarding how `writeReplace` and `readResolve` methods are looked up, see:
      - https://docs.oracle.com/en/java/javase/17/docs/specs/serialization/output.html#the-writereplace-method
      - https://docs.oracle.com/en/java/javase/17/docs/specs/serialization/input.html#the-readresolve-method

      In particular it is not mentioned that:
      - inherited methods are considered (and maybe that packages are not considered the same if loaded by separate class loaders (JDK-4765255))
      - `default` methods of interfaces are not considered

      Some of this is also mentioned in JDK-8274335, but it looks like the intention of that issue was not to update any specification.


            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: