changeset 8466:1bf8f2062be3

8158571: Additional method handle validation Reviewed-by: jrose, ahgross, mchung
author mhaupt
date Wed, 13 Jul 2016 21:20:43 +0100
parents d2343d3a1892
children 66396db9dd85
files src/share/classes/java/lang/invoke/MethodHandles.java
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/lang/invoke/MethodHandles.java	Wed Jul 13 21:05:33 2016 +0100
+++ b/src/share/classes/java/lang/invoke/MethodHandles.java	Wed Jul 13 21:20:43 2016 +0100
@@ -2183,7 +2183,7 @@
         int filterValues = filterType.parameterCount();
         if (filterValues == 0
                 ? (rtype != void.class)
-                : (rtype != filterType.parameterType(0)))
+                : (rtype != filterType.parameterType(0) || filterValues != 1))
             throw newIllegalArgumentException("target and filter types do not match", target, filter);
         // result = fold( lambda(retval, arg...) { filter(retval) },
         //                lambda(        arg...) { target(arg...) } )