<i18n dev> RFR: 8342865: Use type parameter for Class::getPrimitiveClass

Joe Darcy darcy at openjdk.org
Wed Oct 23 23:59:04 UTC 2024


On Wed, 23 Oct 2024 03:06:39 GMT, Chen Liang <liach at openjdk.org> wrote:

> Discovered this small cleanup while looking at wrapper class code.

src/java.base/share/classes/java/lang/Class.java line 3284:

> 3282:      * primitive type.
> 3283:      */
> 3284:     static native <T> Class<T> getPrimitiveClass(String name);

I checked the code in java.base and this method is only called by the wrapper classes (and void), as expected.

I think the refactoring is good, but would like to see a comment here along the lines of "Use of type variable is acceptable since only used within java.lang," etc.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/21653#discussion_r1813996652


More information about the i18n-dev mailing list