RFR: JDK-6361826: (reflect) provide method for mapping strings to class object for primitive types [v3]
Mandy Chung
mchung at openjdk.org
Fri Jul 14 17:35:17 UTC 2023
On Fri, 14 Jul 2023 02:54:59 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.
>
> Joe Darcy has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision:
>
> - Use new API in serialization; add tests.
> - Merge branch 'master' into JDK-6361826
> - Update API proposal.
> - Merge branch 'master' into JDK-6361826
> - JDK-6361826: (reflect) provide method for mapping strings to class object for primitive types
src/java.base/share/classes/java/lang/Class.java line 441:
> 439: * an attempt will be made to locate a user-defined class in the unnamed package
> 440: * whose name is {@code I} instead.
> 441: * To obtain a {@code Class} object for a named primitive type, use
The example above of a primitive type is `I` (the descriptor string) versus `forPrimitiveType` takes the primitive type name. It may need some clarification.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14743#discussion_r1263944106
More information about the core-libs-dev
mailing list