(proxy) Suggest more type-safe overload of Proxy.newProxyInstance

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Duplicate
    • Priority: P4
    • None
    • Affects Version/s: 5.0
    • Component/s: core-libs
    • None

      Proxy.newProxyInstance is a little cumbersome to use because

      1. Most of the time, you are only proxying to one interface, so you need to construct a one-element Class[].

      2. You need to then cast the result.

      Suggest a simple overload which would handle the common cases in a more type-safe way:

      public static <T> T newProxyInstance(ClassLoader, Class<T>, InvocationHandler)

            Assignee:
            Peter Jones (Inactive)
            Reporter:
            Jesse Glick (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: