Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GR-60237] Introduce serializable flag to reflection metadata #10215

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

graalvmbot
Copy link
Collaborator

Serialization metadata is now part of reflection metadata. For a type to be registered as serializable, the field "serializable" must be set to true inside of the type reflection registration. For example, the following reachability-metadata.json file:

{
  "reflection": [
    {
      "type": "fully.qualified.ClassName"
    }
  ],
  "serialization": [
    {
      "type": "fully.qualified.ClassName"
    }
  ]
}

can now be expressed with the much simpler:

{
  "reflection": [
    {
      "type": "fully.qualified.ClassName",
      "serializable": true
    }
  ]
}

As a side effect, types registered for serialization have to be explicitly registered for reflection as well. This was already done in the background, so the change has no image size impact.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Dec 3, 2024
@loicottet loicottet self-assigned this Dec 3, 2024
@zakkak
Copy link
Collaborator

zakkak commented Dec 3, 2024

+1 That makes sense and interestingly it's similar to what Quarkus does.

@loicottet are there plans to backport this to GraalVM for JDK 21 as well?

@graalvmbot graalvmbot force-pushed the lottet/GR-60237-serialize-flag branch from 2bf72c6 to 913e953 Compare December 3, 2024 13:26
@graalvmbot graalvmbot force-pushed the lottet/GR-60237-serialize-flag branch from 913e953 to 2f0e65a Compare December 4, 2024 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants