8138578: MethodHandles.Lookup.findSpecial() Javadoc fails to consider static methods
Reviewed-by: psandoz, vlivanov, mhaupt
Contributed-by: Shilpi Rastogi <shilpi.rastogi@oracle.com>
--- 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