-
Epic
-
Resolution: Unresolved
-
Medium
-
None
-
None
-
No runtime reflection
mdsal-binding-runtime-api coupled with GeneratedType should be able provide us with authoritative information about class layout we are expected to encounter at runtime.
For historical reasons there is a ton for fiddling with java.lang.Class and its shape via BindingReflections. Gradually migrate all reliance on Reflection and instead perform inferences on GeneratedType, which really gives us the same information that is input mdsal-binding-java-api-generator.
Whenever the class shape does not match at runtime, just throw a LinkageError, as at this point we expect BindingRuntimeContext (and more importantly BindingRuntimeTypes) to have a proper self-contained view of the classes present at runtime.
This is a prerequisite to being able to execute Binding Spec in images in AOT environments.