United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-8001109 : arity mismatch on a call to spreader method handle should elicit IllegalArgumentException

Details
Type:
Bug
Submit Date:
2012-10-18
Status:
Closed
Updated Date:
2014-07-15
Project Name:
JDK
Resolved Date:
2013-10-05
Component:
core-libs
OS:
Sub-Component:
java.lang.invoke
CPU:
Priority:
P4
Resolution:
Fixed
Affected Versions:
7,8-pool
Fixed Versions:

Related Reports
Backport:
Backport:
Backport:
Backport:
Backport:
Relates:
Relates:
Relates:
Relates:

Sub Tasks

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
URL:   http://hg.openjdk.java.net/jdk8/jdk8/jdk/rev/d391e062b983
User:  lana
Date:  2013-10-11 18:24:46 +0000

                                     
2013-10-11
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/d391e062b983
User:  jrose
Date:  2013-10-05 12:34:17 +0000

                                     
2013-10-05
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



Hardware and Software, Engineered to Work Together