8138578: MethodHandles.Lookup.findSpecial() Javadoc fails to consider static methods
authormhaupt
Mon, 08 Feb 2016 17:37:46 +0100
changeset 35716 07ecc6d51751
parent 35715 006017186296
child 35717 6d49715a72e5
child 35995 a4f500294ab3
8138578: MethodHandles.Lookup.findSpecial() Javadoc fails to consider static methods Reviewed-by: psandoz, vlivanov, mhaupt Contributed-by: Shilpi Rastogi <shilpi.rastogi@oracle.com>
jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java
--- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java	Mon Feb 08 09:56:26 2016 -0500
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java	Mon Feb 08 17:37:46 2016 +0100
@@ -1043,7 +1043,8 @@
          * @param specialCaller the proposed calling class to perform the {@code invokespecial}
          * @return the desired method handle
          * @throws NoSuchMethodException if the method does not exist
-         * @throws IllegalAccessException if access checking fails
+         * @throws IllegalAccessException if access checking fails,
+         *                                or if the method is {@code static},
          *                                or if the method's variable arity modifier bit
          *                                is set and {@code asVarargsCollector} fails
          * @exception SecurityException if a security manager is present and it
@@ -1275,7 +1276,8 @@
          * @param m the reflected method
          * @param specialCaller the class nominally calling the method
          * @return a method handle which can invoke the reflected method
-         * @throws IllegalAccessException if access checking fails
+         * @throws IllegalAccessException if access checking fails,
+         *                                or if the method is {@code static},
          *                                or if the method's variable arity modifier bit
          *                                is set and {@code asVarargsCollector} fails
          * @throws NullPointerException if any argument is null