8342865: Use type parameter for Class::getPrimitiveClass

Reviewed-by: darcy
This commit is contained in:
Chen Liang 2024-10-26 14:45:04 +00:00
parent 9e451aa365
commit 40e07a7ea3
10 changed files with 13 additions and 22 deletions

View file

@ -3278,10 +3278,10 @@ public final class Class<T> implements java.io.Serializable,
private native ProtectionDomain getProtectionDomain0();
/*
* Return the Virtual Machine's Class object for the named
* primitive type.
* Returns the Class object for the named primitive type. Type parameter T
* avoids redundant casts for trusted code.
*/
static native Class<?> getPrimitiveClass(String name);
static native <T> Class<T> getPrimitiveClass(String name);
/*
* Check if client is allowed to access members. If access is denied,