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.
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.
- relates to
-
JDK-4289039 cannot skip over writeObject()-generated data
-
- Closed
-