JDK-8001109 : arity mismatch on a call to spreader method handle should elicit IllegalArgumentException
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang.invoke
  • Affected Version: 7,8-pool
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2012-10-18
  • Updated: 2017-05-17
  • Resolved: 2013-10-05
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availabitlity Release.

To download the current JDK release, click here.
JDK 7 JDK 8
7u65Resolved 8 b112Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
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.)
Comments
Based on 7u71 VM nighlty SQE OK to take the 7u backport to CPU14_03
2014-04-14

This fix removed the code guarded by RAISE_RANDOM_EXCEPTIONS but the test for JDK-7141637 wasn't fixed.
2013-11-26

webrev: http://cr.openjdk.java.net/~jrose/8001109/webrev.00
2013-09-13

http://hg.openjdk.java.net/mlvm/mlvm/jdk/file/tip/meth.patch
2012-10-18