-
Bug
-
Resolution: Unresolved
-
P2
-
25
The serialized form of several `java.time` class objects is incompatible between JDK 25 and previous releases due to a change in the type of the month and day fields.
The serialized form of LocalDate instances is not affected; the serialized form uses an externalized form in which the stream format is independent of the field types.
The purpose of the change was to enable packing fields more tightly in anticipation of converting to value classes in the Valhalla project.
The changed field types result in the serialized form of the classes being incompatible between JDK 25 and previous versions. The change was made inJDK-8334742. The affected class are LocalDate, YearMonth, MonthDay, and HirjahDate.
When de-serializing, an exception is thrown:
`java.io.InvalidClassException: java.time.LocalDate; incompatible types for field day
at java.base/java.io.ObjectStreamClass.matchFields(ObjectStreamClass.java:2077)
`
The serialized form of LocalDate instances is not affected; the serialized form uses an externalized form in which the stream format is independent of the field types.
The purpose of the change was to enable packing fields more tightly in anticipation of converting to value classes in the Valhalla project.
The changed field types result in the serialized form of the classes being incompatible between JDK 25 and previous versions. The change was made in
When de-serializing, an exception is thrown:
`java.io.InvalidClassException: java.time.LocalDate; incompatible types for field day
at java.base/java.io.ObjectStreamClass.matchFields(ObjectStreamClass.java:2077)
`
- caused by
-
JDK-8334742 Change java.time month/day field types to 'byte'
-
- Resolved
-
There are no Sub-Tasks for this issue.