Other usages of Classfile API

- liangchenblue at gmail.com
Wed Mar 15 19:17:55 UTC 2023


Since Classfile API is already seeing increased usage within JDK for
its convenience, I wonder about the feasibility of a few potential
usages:

1. In other JDK projects that change bytecode format, such as
Valhalla. I guess the Classfile API within these projects will just
adapt to the custom additions due to how it's distributed. Do we plan
to switch the bytecode generation in Valhalla to Classfile too? It
seems its constant API, which doesn't consider value or primitive
classes, needs an update in the first place.

2. External tools, like asmtools. Don't know if Classfile API can
simplify its logic or not, and whether it can use Classfile API in the
first place.

3. Reflection API for Annotations. The reflection API currently pulls
annotation attribute bytes directly from the class bytes in the VM,
and Classfile API might be able to handle the bytes to annotation
conversion better.


More information about the classfile-api-dev mailing list