RFR: 8359707: Add classfile modification code to RedefineClassHelper [v4]
Chen Liang
liach at openjdk.org
Wed Jun 25 20:43:18 UTC 2025
On Wed, 25 Jun 2025 18:06:45 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
>> I copied this code for another test in the Valhalla repo and thought it would be a good utility function. It might be better written using the Classfile API.
>> Tested with test.
>
> Coleen Phillimore has updated the pull request incrementally with one additional commit since the last revision:
>
> Use ClassFile API to replace the class name.
test/lib/RedefineClassHelper.java line 99:
> 97: classBuilder.with(ce);
> 98: }
> 99: });
Suggestion:
byte[] newBytes = ClassFile.of().build(newClassDesc, classModel::forEach);
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25857#discussion_r2167585017
More information about the serviceability-dev
mailing list