-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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-47365, GR-48191] Ability to Express all JVM Types in Reachability Metadata #7476
Comments
This was referenced Mar 6, 2024
fniephaus
modified the milestones:
GraalVM for JDK 25,
GraalVM for JDK 25 (September 16, 2025)
Apr 30, 2024
vjovanov
modified the milestones:
GraalVM for JDK 25 (September 16, 2025),
GraalVM for JDK 24 (March 18, 2025)
Jun 11, 2024
Proxy types are now supported in GraalVM for JDK 23. |
spavlusieva
changed the title
Ability to Express all JVM Types in Reachability Metadata
[GR-47365, GR-48191]Ability to Express all JVM Types in Reachability Metadata
Sep 25, 2024
spavlusieva
changed the title
[GR-47365, GR-48191]Ability to Express all JVM Types in Reachability Metadata
[GR-47365, GR-48191] Ability to Express all JVM Types in Reachability Metadata
Sep 25, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
TL;DR
Expressing reflection over lambda-proxy and Java-proxy types in JSON-based reachability metadata is currently impossible. To compile programs that require those features, users currently have to rewrite the code to avoid reflection on proxies and lambdas.
We intend to modify the syntax of
reflect-config.json
to support all possible types on the JVM. The syntax for regular types would become:for lambda proxies:
and for Java proxies:
Goals
Class.forName
for that type.proxy-config.json
.serialization-config.json
.Non-Goals
Interactions with the Rest of the System
Native Image Agent Support
The native image agent will output only the new format of reachability metadata.
Upon encountering lambda proxies or Java proxy classes, the agent will read the inherited interfaces and output the new format. In the case of lambdas, the agent will not output the
capturingMethod
as it is not possible to determine that value at runtime.The agent will have to track the
forName
calls and output that as a separate entry in the types which will be represented by `"forName": true" in JSON.Removing the need for
proxy-config.json
The current
proxy-config.json
file only specifies the ordered list of interfaces that define the proxy class. This can be subsumed by a simple entry inreflect-config.json
:Since proxy classes fall under the reflection API, the migration of this feature to
reflect-config.json
is natural.Adopting the new Format in
serialization-config.json
The serialization configuration has special sections for lambda proxies (
lambdaCapturingTypes
) and Java-proxy types (proxies
). These sections can now be expressed in the sectiontypes
with the same syntax as inreflect-config.json
.Backwards Compatibility
The value of "name" in
reflect-config.json
will continue to have the implicit meaning that the class can be fetched withClass.forName
.The new syntax will be produced by the agent and described in all documentation. The reachability metadata will be migrated to the new format on the next LTS release (GraalVM for Java 25).
The current format for
"name"
will be supported until the majority of the ecosystem adopts the new format.The text was updated successfully, but these errors were encountered: