-
Enhancement
-
Resolution: Unresolved
-
P4
-
None
-
None
-
None
This seems like something that could be detected by testing. It would be good to create tests for detecting accidental changes to serializable fields. This would include additions, removals, and changes to names or types of fields, and possibly other changes.
Some of these changes are compatible according to JOSS Chapter 5. The main focus here is to detect accidental changes, even if those changes are compatible.
An issue to be decided is, which classes' serialized forms need to be checked in this way. It could be all serializable classes in the JDK, or only those in java.base, or including or excluding selected modules. For example, many Swing classes are serializable, but release-to-release compatibility isn't guaranteed. It therefore might not be worth including such classes in the test. See the warning at the bottom of the class specification of JComponent:
https://docs.oracle.com/en/java/javase/17/docs/api/java.desktop/javax/swing/JComponent.html
- relates to
-
JDK-8309882 LinkedHashMap adds an errant serializable field
- Resolved
-
JDK-8266571 Sequenced Collections
- Resolved