-
Enhancement
-
Resolution: Fixed
-
P4
-
None
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
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
- csr for
-
JDK-8323708 Adjust Classfile API's type arg model to better represent the embodied type
- Closed
- links to
-
Commit openjdk/jdk/c60474b1
-
Review(master) openjdk/jdk/16517