ClassHierarchyResolver using Reflection information
-
liangchenblue at gmail.com
Thu Mar 16 16:04:39 UTC 2023
For context, in 8294961
https://github.com/openjdk/jdk/pull/10991/files#r1133086265 I wondered
about whether to use a hierarchy resolver for LambdaMetafactory, that
I think resolution may encounter problems as the default resolver may
not be able to resolve user-supplied interfaces.
In addition, many of the class file generation usages I've seen
include firing events via an event bus, calling patched external addon
code (as seen in Minecraft modding), in which Reflection-based
hierarchy resolution would work better than reading bytecode files.
Thus, I've prepared a patch creating ClassHierarchyResolver
https://github.com/openjdk/jdk/commit/0c888ba1e2953cf946012244446f4f8c05ba5d77
to ease up resolution with reflection, when a ClassLoader (for older
APIs) or a MethodHandle.Lookup (for modern APIs) is available.
Does this appear feasible?
Chen
More information about the classfile-api-dev
mailing list