JDK-8356548 : Use ClassFile API instead of ASM to transform classes in tests
  • Type: Sub-task
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 25
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2025-05-08
  • Updated: 2025-09-03
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 26
26Unresolved
Description
One of the goals of ClassFile API is to avoid updating the copy of ASM to support future class file formats. 

However, some tests in hotspot turn out to parse latest class files to transform them to inject desired bytecode patterns. This forces us to keep maintaining the ASM library, which will be costly with the upcoming project Valhalla.

To avoid maintaining ASM down the road, we can either:
1. Migrate the transformation to ClassFile API
2. Set source and release version in javac flags to produce stable bytecode

I recommend migrating to ClassFile API; javac has a deprecation policy, that in the future, old source and target versions will no longer be supported, and we would still need another port at that time.
Comments
A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/25124 Date: 2025-05-08 14:57:05 +0000
08-05-2025