From e49c2412cb922d1b99fd40832783773336331804 Mon Sep 17 00:00:00 2001 From: Shilpi Rastogi Date: Mon, 8 Feb 2016 17:37:46 +0100 Subject: [PATCH] 8138578: MethodHandles.Lookup.findSpecial() Javadoc fails to consider static methods Reviewed-by: psandoz, vlivanov, mhaupt --- .../share/classes/java/lang/invoke/MethodHandles.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java index 4925829a985..45908f1ea23 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java @@ -1043,7 +1043,8 @@ assertEquals(""+l, (String) MH_this.invokeExact(subl)); // Listie method * @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 @@ return mh1; * @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