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

MethodHandles::permuteArguments throws NPE when duplicating dropped arguments

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 16
    • Fix Version/s: 17
    • Component/s: core-libs
    • Labels:

      Description

      The following code:

          MethodHandle mh = MethodHandles.empty(MethodType.methodType(void.class, int.class, int.class));
          MethodHandles.permuteArguments(mh, MethodType.methodType(void.class, int.class), 0, 0);

      Throws:

      Exception in thread "main" java.lang.NullPointerException: Cannot invoke "java.lang.invoke.LambdaForm$Name.isParam()" because "name" is null
      at java.base/java.lang.invoke.LambdaFormBuffer.endEdit(LambdaFormBuffer.java:304)
      at java.base/java.lang.invoke.LambdaFormEditor.dupArgumentForm(LambdaFormEditor.java:585)
      at java.base/java.lang.invoke.MethodHandles.permuteArguments(MethodHandles.java:4649)
      at main.Main.main(Main.java:11)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jvernee Jorn Vernee
              Reporter:
              jvernee Jorn Vernee
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: