RFR: JDK-6361826: (reflect) provide method for mapping strings to class object for primitive types
Joe Darcy
darcy at openjdk.org
Fri Jun 30 21:21:55 UTC 2023
On Fri, 30 Jun 2023 20:57:54 GMT, Joe Darcy <darcy at openjdk.org> wrote:
> Going over some old issues and found this RFE, posting without any tests or a CSR first to get some feedback on the overall API.
Besides whether or not the method itself is worth adding, I think the main design question if on a name that is not a primitive type the method should return null or throw an exception. The existing forName method have both policies. It seems to me more of a semantic error when using this particular method to give it a non-primitive name so I coded it to throw an exception, but I'd be willing to consider returning null instead.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/14743#issuecomment-1615204830
More information about the core-libs-dev
mailing list