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

Coleen Phillimore coleenp at openjdk.org
Wed Jun 18 11:52:18 UTC 2025


On Wed, 18 Jun 2025 11:41:09 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> test/lib/RedefineClassHelper.java line 104:
>> 
>>> 102:      */
>>> 103: 
>>> 104:     public static byte[] replaceAllStrings(ClassLoader loader, String oldString, String newString) throws Exception {
>> 
>> Nit: I'd suggest to rename parameters:
>>   `oldString`  => `oldClassName`
>>   `newString` => `newClassName`
>> 
>> Alternatively, it is possible to pass bytecodes buffer instead of class loader and keep `oldString` and `newString` as before.
>
> I wanted this code to also read bytecodes off the disk and not the caller do that either.  The code for getBytecodes or very similar is duplicated all over the tests also.

I can add a byte buffer version though.

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

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


More information about the hotspot-runtime-dev mailing list