-
Enhancement
-
Resolution: Fixed
-
P4
-
19
-
b16
-
generic
-
generic
A DESCRIPTION OF THE PROBLEM :
Currently, any call to `Lookup::accessClass` and `Lookup::ensureInitialized` results in the type of `targetClass` to be erased to `Class<?>`, even though it’s passed through unchanged when it’s accessible to the caller.
I propose to change the signature to `public <T> Class<T> accessClass(Class<T> targetClass)`, so that callers don’t have to perform an unchecked cast at the call site.
Currently, any call to `Lookup::accessClass` and `Lookup::ensureInitialized` results in the type of `targetClass` to be erased to `Class<?>`, even though it’s passed through unchanged when it’s accessible to the caller.
I propose to change the signature to `public <T> Class<T> accessClass(Class<T> targetClass)`, so that callers don’t have to perform an unchecked cast at the call site.
- csr for
-
JDK-8304011 Add type parameter to Lookup::accessClass and Lookup::ensureInitialized
-
- Closed
-