RFR: 8367938: Test Serialization Compatibility of Class Objects
Brent Christian
bchristi at openjdk.org
Tue Dec 2 23:50:08 UTC 2025
On Mon, 1 Dec 2025 20:30:30 GMT, Roger Riggs <rriggs at openjdk.org> wrote:
> ArchivedClassesTest is added to compare archived serialized class objects against current classes.
> Note: these are the serialized class objects themselves, for example `java.lang.String.class`, not instances of the class, for example "Hello".
> The archived classes reference was built against the latest released version: 25.0.1+8.
>
> The test fails if the serialized class reference archive is missing from the repository
> or if there are any incompatible changes to the serialized bytes.
> Normal output from the test includes:
> - The version of the serialized class archive
> - Listing (if any) of incompatible classes
> - Listing of classes with compatible changes
> - Listing of classes in the archive that are not in the current version
> - Listing of classes in the current version not found in the archive
>
> The change of java.nio.ByteOrder from a class to enum is reported as an approved incompatible change.
A couple general comments:
It seems useful for the test to also detect if new classes need to be added to the archive.
Can a class have more than one "earlier version"? Could/should more than one earlier version be tested?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/28586#issuecomment-3604417085
More information about the core-libs-dev
mailing list