[condy] Fixing typos in doc of MethodHandle.invokeWithArguments

Paul Sandoz paul.sandoz at oracle.com
Tue Jul 18 20:57:40 UTC 2017


Hi,

See patch below.

Thanks,
Paul.

diff -r e63ee1f02d46 src/java.base/share/classes/java/lang/invoke/MethodHandle.java
--- a/src/java.base/share/classes/java/lang/invoke/MethodHandle.java    Fri Jul 14 00:01:08 2017 +0200
+++ b/src/java.base/share/classes/java/lang/invoke/MethodHandle.java    Tue Jul 18 13:53:43 2017 -0700
@@ -615,7 +615,7 @@
      *         {@code WrongMethodTypeException}. </li>
      *     <li>Replace the logical arguments gathered into the array of
      *         type {@code A[]} with the array itself, thus shortening
-     *         the argument list to length {@code N}. This final argument
+     *         the argument list to length {@code M}. This final argument
      *         retains the static type {@code A[]}.</li>
      *     <li>Adjust the type {@code TN} by changing the {@code N}th
      *         parameter type from {@code Object} to {@code A[]}.
@@ -636,18 +636,17 @@
      * In this way, <em>jumbo argument lists</em> which would spread into more
      * than 254 slots can still be processed uniformly.
      * <p>
-     * Unlike the generic invocation mode, which can "recycle" an array
-     * argument, passing it directly to the target method, this invocation
-     * mode <em>always</em> creates a new array parameter, even if
-     * the original array passed to
-     * {@link invokeWithArguments(Object[]) invokeWithArguments} would have
+     * Unlike the {@link #invoke(Object...) generic} invocation mode, which can
+     * "recycle" an array argument, passing it directly to the target method,
+     * this invocation mode <em>always</em> creates a new array parameter, even
+     * if the original array passed to {@code invokeWithArguments} would have
      * been acceptable as a direct argument to the target method.
      * Even if the number {@code M} of actual arguments is the arity {@code N},
      * and the last argument is dynamically a suitable array of type {@code A[]},
      * it will still be boxed into a new one-element array, since the call
      * site statically types the argument as {@code Object}, not an array type.
-     * This not a special rule for this method, but rather a regular effect of
-     * the {@linkplain #asVarargsCollector rules for variable-arity invocation}.
+     * This is not a special rule for this method, but rather a regular effect
+     * of the {@linkplain #asVarargsCollector rules for variable-arity invocation}.
      * <p>
      * Because of the action of the {@code asType} step, the following argument
      * conversions are applied as necessary:



More information about the amber-dev mailing list