8177275: IllegalArgumentException when MH would have too many parameters is not specified for several methods

Updated spec and added tests

Reviewed-by: psandoz
This commit is contained in:
Vivek Theeyarath 2018-07-02 23:33:40 -07:00
parent 6cd1f27fcf
commit ac99e1d447
2 changed files with 126 additions and 2 deletions

View file

@ -71,6 +71,9 @@ import static java.lang.invoke.MethodType.methodType;
* <li>Combinator methods, which combine or transform pre-existing method handles into new ones.
* <li>Other factory methods to create method handles that emulate other common JVM operations or control flow patterns.
* </ul>
* A lookup, combinator, or factory method will fail and throw an
* {@code IllegalArgumentException} if the created method handle's type
* would have <a href="MethodHandle.html#maxarity">too many parameters</a>.
*
* @author John Rose, JSR 292 EG
* @since 1.7
@ -386,8 +389,9 @@ public class MethodHandles {
* constant is not subject to security manager checks.
* <li>If the looked-up method has a
* <a href="MethodHandle.html#maxarity">very large arity</a>,
* the method handle creation may fail, due to the method handle
* type having too many parameters.
* the method handle creation may fail with an
* {@code IllegalArgumentException}, due to the method handle type having
* <a href="MethodHandle.html#maxarity">too many parameters.</a>
* </ul>
*
* <h1><a id="access"></a>Access checking</h1>