JDK-8335939 : Hide element writing across the ClassFile API
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.lang.classfile
  • Affected Version: 24
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2024-07-09
  • Updated: 2024-07-29
  • Resolved: 2024-07-23
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 b08Fixed
Related Reports
Blocks :  
CSR :  
Relates :  
Description
One of the most glaring anomalies of the ClassFile API is the exposure of WritableAttribute without the reading counterparts. These writing hooks are almost never used by the clients, and their exposure imposes a massive maintenance burden and a blunt to understanding the best practices of the ClassFile API.

We must restrict the appearance of BufWriter to AttributeMapper only, just like its ClassReader counterpart; all other appearances and unrelated APIs will all be withdrawn to implementation.

Removals include:
- LocalVariable.writeTo
- LocalVariableType.writeTo
- WritableElement
- BufWriter.writeList/writeBytes/writeTo/copyTo
- ClassReader.compare
Comments
Changeset: a2a236f9 Branch: master Author: Chen Liang <liach@openjdk.org> Date: 2024-07-23 12:11:47 +0000 URL: https://git.openjdk.org/jdk/commit/a2a236f9041083e4b8f11e068da0031dd5f52c2b
23-07-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/20205 Date: 2024-07-16 23:50:17 +0000
16-07-2024