Adopt new GraalVM reachability metadata format #33847
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
theme: aot
An issue related to Ahead-of-time processing
type: enhancement
A general enhancement
Milestone
As of Spring Framework 7.0, we should completely adopt the new GraalVM reachability metadata format. This format has been simplified and now has a dedicated JSON schema.
There are a few notable behavior changes.
The registration of resources has changed, this is already described in a separate issue, see #31340.
The metadata conditions have changed from "typeReachable" from "typeReached". Previously, "typeReachable" would imply that a type is reachable through static analysis. This depends too much on the capabilities of the static analysis and can be hard to predict. Instead, "typeReached" means that the type "A type is reached at run time, right before the class-initialization routine starts for that type (class or interface), or any of the type’s subtypes are reached." This changes the metadata format but shouldn't change much for our support. This would only affect projects and apps that use a condition with a type that is not strictly initialized, like an interface.
The metadata for proxy generation is now part of the reflection metadata. This doesn't change our
RuntimeHints
API but we should adapt our JSON serialization format accordingly.Several convenience reflection flags have been removed.
"allDeclaredConstructors", "allPublicConstructors", "allDeclaredMethods", "allPublicMethods"
enable reflective invocation of constructors and methods, and are still supported."queryAllPublicConstructors", "queryAllDeclaredConstructors", "queryAllPublicMethods", "queryAllDeclaredMethods", "allPublicClasses", "allDeclaredClasses"
enable reflective introspection and have been removed since this is now done automatically as soon as a reflection metadata entry is added for the declaring type. As a result, several parts of ourRuntimeHints
will be made useless; we should decide whether we want to deprecate it or just ignore its results during the JSON metadata generation.We can test the new reachability behavior by using a VM option:
The text was updated successfully, but these errors were encountered: