JDK-6361826 : (reflect) provide method for mapping strings to class object for primitive types
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.lang:reflect
  • Affected Version: 5.0
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2005-12-12
  • Updated: 2024-10-17
  • Resolved: 2023-07-14
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 22
22 b07Fixed
Related Reports
CSR :  
Relates :  
Relates :  
Relates :  
Description
For certain reflective programming tasks, it would be helpful to have a 

string -> java.lang.Class

mapping which returned the Class objects for the primitive types.  For example "int" -> int.class.

Comments
A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/14743 Date: 2023-06-30 20:57:54 +0000
17-10-2024

Changeset: 19691fab Author: Joe Darcy <darcy@openjdk.org> Date: 2023-07-14 20:18:23 +0000 URL: https://git.openjdk.org/jdk/commit/19691fab48657174a4e9768d33da2fdd532271c9
14-07-2023

Note that Class.forName(String) explicitly does *not* work for this use case.
27-06-2023

EVALUATION Will consider for a future release.
12-12-2005