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

Public access to the generic signature of a Method

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • 25
    • core-libs
    • None

      When generating bytecode based on existing `java.lang.reflect.Method`, there is no way to (easily) retrieve its generic signature.

      For example, when generating a compatible method with the Classfile API, one may need to create a `MethodSignature`, which is very hard to do when extracting individual components (type parameters, exceptions, generic parameters & return type). There could be a simple solution, like `MethodSignature.parseFrom(method.getGenericSignature())`, but `getGenericSignature()` is private in `Method`.

      It would be helpful to provide public API to access the generic signature of a `Method` as `MethodSignature` and/or `String`.

            Unassigned Unassigned
            ngubarkov Nikita Gubarkov
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: