src/java.base/share/classes/java/lang/invoke/LambdaMetafactory.java
changeset 47985 80a058c0f993
parent 47216 71c04702a3d5
child 48921 576e024f10b6
--- a/src/java.base/share/classes/java/lang/invoke/LambdaMetafactory.java	Wed Nov 29 21:23:57 2017 +0100
+++ b/src/java.base/share/classes/java/lang/invoke/LambdaMetafactory.java	Wed Nov 29 12:39:59 2017 -0800
@@ -263,8 +263,12 @@
      * methods from {@code Object}.
      *
      * @param caller Represents a lookup context with the accessibility
-     *               privileges of the caller.  When used with {@code invokedynamic},
-     *               this is stacked automatically by the VM.
+     *               privileges of the caller.  Specifically, the lookup context
+     *               must have
+     *               <a href="MethodHandles.Lookup.html#privacc">private access</a>
+     *               privileges.
+     *               When used with {@code invokedynamic}, this is stacked
+     *               automatically by the VM.
      * @param invokedName The name of the method to implement.  When used with
      *                    {@code invokedynamic}, this is provided by the
      *                    {@code NameAndType} of the {@code InvokeDynamic}
@@ -294,7 +298,8 @@
      *         instances of the interface named by {@code invokedType}
      * @throws LambdaConversionException If any of the linkage invariants
      *                                   described {@link LambdaMetafactory above}
-     *                                   are violated
+     *                                   are violated, or the lookup context
+     *                                   does not have private access privileges.
      */
     public static CallSite metafactory(MethodHandles.Lookup caller,
                                        String invokedName,
@@ -404,8 +409,12 @@
      * </ul>
      *
      * @param caller Represents a lookup context with the accessibility
-     *               privileges of the caller.  When used with {@code invokedynamic},
-     *               this is stacked automatically by the VM.
+     *               privileges of the caller.  Specifically, the lookup context
+     *               must have
+     *               <a href="MethodHandles.Lookup.html#privacc">private access</a>
+     *               privileges.
+     *               When used with {@code invokedynamic}, this is stacked
+     *               automatically by the VM.
      * @param invokedName The name of the method to implement.  When used with
      *                    {@code invokedynamic}, this is provided by the
      *                    {@code NameAndType} of the {@code InvokeDynamic}
@@ -429,7 +438,8 @@
      *         instances of the interface named by {@code invokedType}
      * @throws LambdaConversionException If any of the linkage invariants
      *                                   described {@link LambdaMetafactory above}
-     *                                   are violated
+     *                                   are violated, or the lookup context
+     *                                   does not have private access privileges.
      */
     public static CallSite altMetafactory(MethodHandles.Lookup caller,
                                           String invokedName,