JDK-8323707 : Adjust Classfile API's type arg model to better represent the embodied type
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.lang.classfile
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2024-01-14
  • Updated: 2024-07-11
  • Resolved: 2024-05-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 23
23 b22Fixed
Related Reports
CSR :  
Description
Currently, Class-File API represents type arguments with a record of an enum (unbounded, default, super, extends) and a type bound. The bound is absent when it's unbounded and present otherwise.

This model causes some inconvenience in usage, mainly that users know the bound will be present in the non-unbounded case, yet they need to unwrap the optional with "risky" code. I propose to remodel type arg into an unbounded and a bounded subinterfaces, so that the bounded subinterface can be a simple product type, easier for users to access the bound type.

Relevant mailing list thread: https://mail.openjdk.org/pipermail/classfile-api-dev/2023-November/000418.html
Comments
A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/16517 Date: 2023-11-06 07:30:41 +0000
11-07-2024

Changeset: c60474b1 Author: Chen Liang <liach@openjdk.org> Committer: Adam Sotona <asotona@openjdk.org> Date: 2024-05-03 11:08:33 +0000 URL: https://git.openjdk.org/jdk/commit/c60474b1229b67265acbd709f6ba081303329be4
03-05-2024