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

MethodHandles.insertArguments doesn't specify IllegalArgumentException on index mismatch

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 11
    • 9
    • core-libs
    • None

        MethodHandles.insertArguments(MethodHandle target, int pos, Object... values) throws IllegalArgumentException if pos is an illegal index to the target's parameters array, or if there is too many values to insert, but Javadoc doesn't specify that.

        For example, all the calls below throw IAE
        ==================================
        MethodHandle mh = empty(methodType(void.class));
        insertArguments(mh, -1);
        insertArguments(mh, 1);
        insertArguments(mh, 0, 1);
        ==================================

              vtheeyarath Vivek Theeyarath (Inactive)
              slukyanov Stanislav Lukyanov (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: