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

arity mismatch on a call to spreader method handle should elicit IllegalArgumentException

    XMLWordPrintable

    Details

      Backports

        Description

        When an array is passed to a method handle transformed by MethodHandle.asSpreader, the array must have exactly the number of arguments expected by the original method handle. If the array length is wrong, the result should be the same as if the wrong number of arguments were passed to the original method handle.

        This is a gray area in the JSR 292 spec.

        (Note: The first version of this bug report read WrongMethodTypeException instead of IllegalArgumentException. The JSR 292 EG has agreed that IAE is more appropriate for this error.)

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                jrose John Rose
                Reporter:
                jrose John Rose
                Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: