Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8288730

Add type parameter to Lookup::accessClass and Lookup::ensureInitialized

XMLWordPrintable

    • 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.


            liach Chen Liang
            webbuggrp Webbug Group
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: