JDK-8335290 : Rename ClassFile::transform to ClassFile::transformClass
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.lang.classfile
  • Affected Version: 24
  • Priority: P4
  • Status: In Progress
  • Resolution: Unresolved
  • Submitted: 2024-06-28
  • Updated: 2024-06-28
Related Reports
CSR :  
Description
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's 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.
Comments
A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/19952 Date: 2024-06-28 22:01:33 +0000
28-06-2024