RFR: 8359707: Add classfile modification code to RedefineClassHelper [v6]

David Holmes dholmes at openjdk.org
Fri Jun 27 04:23:40 UTC 2025


On Fri, 27 Jun 2025 04:19:49 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Yes, I wanted to use the ClassRemapper but all the tests that used RedefineClassHelper would have had to add @modules.  We can change it later when ClassRemapper becomes available without adding modules.
>
>> the lambda just copies everything over as-is.
> ..
>> But be aware this code does not change the class name use anywhere in the code, descriptors, handles, annotation, etc..., just the class name itself.
> 
> @coleenp don't we need to class name to be changed everywhere it appears in the classfile? Or do we know these classes are trivial enough that there is only a single occurrence of the name (and everything else is symbolic via the constant pool) ?

And `replaceAllStrings` is incorrectly named in that case.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/25857#discussion_r2170733258


More information about the serviceability-dev mailing list