JDK-8339214 : Remove misleading CodeBuilder.loadConstant(Opcode, ConstantDesc)
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang.classfile
  • Affected Version: 24
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2024-08-29
  • Updated: 2024-09-05
  • Resolved: 2024-09-03
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 b14Fixed
Related Reports
CSR :  
Description
The API `CodeBuilder.loadConstant(Opcode, ConstantDesc)` seems like a relic from the old `constantInstruction(Opcode, ConstantDesc)` back when there were no factories for specific individual instructions. It makes little sense to specify the type of Opcode when the `loadConstant(ConstantDesc)` automatically handles it. Worse, this is actually confusing combined with the shortcut API. Users who really wish to specify opcode should use the individual factories to create Instruction instances instead.
Comments
Changeset: ad40a122 Branch: master Author: Chen Liang <liach@openjdk.org> Date: 2024-09-03 13:44:48 +0000 URL: https://git.openjdk.org/jdk/commit/ad40a122d632d65052b71125c0dfd58c54e3a521
03-09-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/20779 Date: 2024-08-29 20:14:57 +0000
29-08-2024