valhalla
valhalla copied to clipboard
8340409: [lworld] Simple serialization and deserialization of core migrated classes
Serialization and deerialization of value classes. For java.base value classes migrated from identity classes:
- Must be annotated with jdk.internal.MigratedValueClass (in tests too)
- Must have a constructor or static factory method:
- annotated with jdk.internal.value.DeserializeConstrucctor
- constructor parameters must match order and types of serializable fields of the class
- Value class must not have superclass with fields; only Object or abstract w/o fields
- Uses same technique as for Records to extract and concat values from stream to invoke constructor
- Migrated value classes are serialized using the same format/fields as the identity class
Non-migrated value classes throw InvalidClassException
Along the way, refactored code to break out different modes of deserialization: full custom deserialization with custom data, default deserialization only, externalizable, no local class, record, and then added mode to deserialize a value class.
Updates to value class tests and added a combo test to check many combinations of value and identity classes with different parameters.
Progress
- [x] Change must not contain extraneous whitespace
Issue
- JDK-8340409: [lworld] Simple serialization and deserialization of core migrated classes (Bug - P4)
Reviewing
Using git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/valhalla.git pull/1248/head:pull/1248
$ git checkout pull/1248
Update a local copy of the PR:
$ git checkout pull/1248
$ git pull https://git.openjdk.org/valhalla.git pull/1248/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 1248
View PR using the GUI difftool:
$ git pr show -t 1248
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/valhalla/pull/1248.diff
Webrev
:wave: Welcome back rriggs! A progress list of the required criteria for merging this PR into lworld will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.
@RogerRiggs This change now passes all automated pre-integration checks.
ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.
After integration, the commit message for the final commit will be:
8340409: [lworld] Simple serialization and deserialization of core migrated classes
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.
At the time when this comment was updated there had been no new commits pushed to the lworld branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential automatic rebasing, please check the documentation for the /integrate command for further details.
➡️ To integrate this PR with the above commit message to the lworld branch, type /integrate in a new comment.
Webrevs
@RogerRiggs this pull request can not be integrated into lworld due to one or more merge conflicts. To resolve these merge conflicts and update this pull request you can run the following commands in the local repository for your personal fork:
git checkout 8340409-simple-value-deserialize
git fetch https://git.openjdk.org/valhalla.git lworld
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge lworld"
git push
Are there any more review comments; I'd like to get this integrated.
/integrate
Going to push as commit e02c628f867d564bd3ddf644ec2fcc465c75b8f3.
Since your change was applied there has been 1 commit pushed to the lworld branch:
- 72472c42e03676b45a556254132c91ab3c2b974b: 8342276: [lworld] Apply LIBRARY.properties to stabiliize --enable-preview for tests
Your commit was automatically rebased without conflicts.
@RogerRiggs Pushed as commit e02c628f867d564bd3ddf644ec2fcc465c75b8f3.
:bulb: You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.