Integrated: 8335290: Rename ClassFile::transform to ClassFile::transformClass

Chen Liang liach at openjdk.org
Wed Jul 3 05:06:22 UTC 2024


On Fri, 28 Jun 2024 22:01:33 GMT, Chen Liang <liach at openjdk.org> wrote:

> `ClassFile::transform` was initially `ClassModel::transform`, which transforms the receiver class model to a new class byte array. This functionality was in parallel with `ClassBuilder::transform`, which accepts a `ClassModel` and a `ClassTransform` and forwards the results to the receiver builder.
> 
> After the `ClassFile` context object introduction, `ClassModel::transform` becomes `ClassFile::transform`; now, its role is more similar to `ClassBuilder::transformMethod`, `ClassBuilder::transformField`, or `MethodBuilder::transformCode` (transforming subtypes), and it is confusing with `ClassFileBuilder::transform` (which accepts the same model type as the built type). We should rename `ClassFile::transform` to `ClassFile::transformClass` to make this method's role more clear.
> 
> This is separate from #19928 as this has much more user impact.

This pull request has now been integrated.

Changeset: 0db9bc57
Author:    Chen Liang <liach at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/0db9bc57de07f8f1d0bf657621cb1b8fd7b01211
Stats:     176 lines in 58 files changed: 2 ins; 5 del; 169 mod

8335290: Rename ClassFile::transform to ClassFile::transformClass

Reviewed-by: asotona

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

PR: https://git.openjdk.org/jdk/pull/19952


More information about the core-libs-dev mailing list