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

Add non‑varargs overloads taking more parameters for `MethodType.methodType(…)`

XMLWordPrintable

      A DESCRIPTION OF THE PROBLEM :
      Currently, creating a `MethodType` that takes more than 1 parameter requires calling the varargs overload `MethodType.methodType(Class, Class, Class...)`, requiring an additional array allocation by the caller (at least until JDK-8164891 is implemented for varargs bridges).

      There already are overloads for 0 and 1 parameter respectively.

      I propose adding additional overloads for up to 10 parameters (matching the `List.of(…)`, `Map.of(…)`, and `Set.of(…)` overloads).


            redestad Claes Redestad
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: