Why Java Is Introducing a New Classfile API to Replace ASM
The Java community proposes a new Classfile API to parse, generate, and transform class files, aiming to replace ASM within the JDK and eventually become a public, high‑performance, immutable‑object‑based solution that keeps pace with rapid JVM and language evolution.
Java community is drafting a Classfile API proposal to provide an API for parsing, generating, and transforming Java class files, initially as an internal replacement for ASM in the JDK and later as a public API.
The proposal notes that class file generation, parsing, and inspection are ubiquitous in the Java ecosystem; many tools and libraries need to handle class files, and frameworks often perform on‑the‑fly bytecode instrumentation, transformation, and generation. The JDK should offer an accurate, complete, up‑to‑date, high‑performance API for reading, writing, and converting class files.
The API aims to replace ASM as a runtime dependency without unacceptable performance loss, and eventually replace the internal "classreader" library used by the compiler and JDK tools. It is expected that many applications and frameworks will adopt this library to effectively replace ASM, cglib, or other bytecode libraries.
Design goals include representing all class‑file entities (such as methods and fields) with immutable objects and providing user‑driven navigation. The motivation includes tighter JDK integration, reducing version mismatches between frameworks and the running JDK, keeping up with rapid JVM evolution, and reflecting language improvements since ASM was first written.
For more details, see the proposal: https://bugs.openjdk.org/browse/JDK-8280389
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Programmer DD
A tinkering programmer and author of "Spring Cloud Microservices in Action"
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
