JDK-8335642 : Hide Transform implementation for Class-File API
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.lang.classfile
  • Affected Version: 24
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2024-07-03
  • Updated: 2024-07-15
  • Resolved: 2024-07-15
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 24
24 masterFixed
Related Reports
Blocks :  
CSR :  
Description
A few improperly exposed ClassFile transformation APIs can be hidden:
1. `ClassFileTransform$ResolvedTransform` and `ClassFileTransform::resolve`: This is supposed to allow users to optimize their transform by passing chained builders. However, users don't have access to chained builders to implement these, and the resolved transform is error-prone in actual usage as well, as there's nothing to ensure the start and end handlers are run.
2. `ClassFileBuilder` exposes meaningless `canWriteDirect` (only useful to attributes, which are the only ones that write CP indices) and method `transform`'s return type is not chained, and its name is a bit confusing.
Comments
Changeset: a253e0ff Branch: master Author: Chen Liang <liach@openjdk.org> Date: 2024-07-15 12:11:53 +0000 URL: https://git.openjdk.org/jdk/commit/a253e0ff4b88541d01596b0e73ede4b96a258fca
15-07-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/20102 Date: 2024-07-09 18:47:35 +0000
09-07-2024