MethodHandles.insertArguments doesn't specify IllegalArgumentException on index mismatch

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 11
    • Affects Version/s: 9
    • Component/s: 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);
        ==================================

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

                Created:
                Updated:
                Resolved: