-
Enhancement
-
Resolution: Unresolved
-
P4
-
24
-
None
Sometimes, an arbitrary user building handler wishes its output be processed by a library transform without going through an intermediate CompoundElement. For example, in ASM, there are trace visitors, and users might want to use trace transforms that log every entry generated for debugging. This request on the list https://mail.openjdk.org/pipermail/classfile-api-dev/2025-April/000698.html is also another proof of the demand.
We already have CodeBuilder::transforming but it was not expanded to other builders due to their extra required arguments. However, on second thought now, they can just reuse the required args of their base builders - this is how it happens in ASM, for a wrapping ClassVisitor, it returns a wrapped MethodVisitor. For a wrapping ClassTransform, it transforms the call to withMethod to change the required args to the base builder as well.
We might retrofit the signature of CodeBuilder::transforming for these new APIs.
We already have CodeBuilder::transforming but it was not expanded to other builders due to their extra required arguments. However, on second thought now, they can just reuse the required args of their base builders - this is how it happens in ASM, for a wrapping ClassVisitor, it returns a wrapped MethodVisitor. For a wrapping ClassTransform, it transforms the call to withMethod to change the required args to the base builder as well.
We might retrofit the signature of CodeBuilder::transforming for these new APIs.
- csr for
-
JDK-8355666 Allow transforms to run on elements generated by a builder
-
- Closed
-
- links to
-
Review(master) openjdk/jdk/24908