The Java Class File API
summary
Many third party libraries like ASM BCEL and Javassist exist but Java 24 now provides a standard Class File API since Java 24 that parses and builds class files via immutable class models and replayable builders. Examples show dumping constant-pool strings, inserting a logging call at method entry via the transformations helpers, and adding automatic memoization of recursive methods by rewriting a method into a cached impl plus wrapper. Demos use the instrumentation agent for load‑time rewriting and speed fib(60) from unusable to instant.
AI-written summary · about
chapters (9)
- 0:00Java class file API intro
- 4:59Why use the API
- 9:16Bytecode basics
- 15:18Building a class file
- 22:09Adding logging calls
- 30:17Runtime transformation with agents
- 33:04Bytecode memoization
- 47:18Immutable trees usability
- 48:43Q&A
related talks
52mA Classfile API for the JDK
44mOW2 ASM and JEP 457: Class-File API
32mUnveiling the Hidden Layers of Java Class Files Beyond Bytecode
55mMaking Java More Dynamic
45mDeep Dive into the .class File and the Class Loader
55mMaking Java more dynamic
51mJava 24 - Better Language, Better APIs, Better Runtime
53mWell there's your problem! Your engine's missing! A look under Java's hood
