changeset 11814:605340e78242 jdk8u102-b09

Merge
author asaha
date Mon, 23 May 2016 20:48:12 -0700
parents a8ff60ed6f33 e76eb0ed270b
children 2dbcee9f5b45
files .hgtags
diffstat 2 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Thu May 19 03:55:17 2016 -0700
+++ b/.hgtags	Mon May 23 20:48:12 2016 -0700
@@ -597,6 +597,7 @@
 a15cdf2e91e7c2d71510280b31ae11048fb2f31e jdk8u101-b06
 fdc0b30af431e17ffaed24ef5d545ae4cf7ddf6d jdk8u101-b07
 4dc4099e933a6f4584b51305b26b5798f042699b jdk8u101-b08
+5e7489ac05f0001e234e6d1c8730b465e74c9626 jdk8u101-b09
 39baa472e20c13c0eb1243eb5dce589e82f78143 jdk8u76-b00
 6ea3aea950d19d803475b3f4d704a2942e71b302 jdk8u76-b01
 4de4cffb5988cd68959ce4bbd14c6d4547078c91 jdk8u76-b02
--- a/src/share/classes/java/lang/invoke/MethodHandles.java	Thu May 19 03:55:17 2016 -0700
+++ b/src/share/classes/java/lang/invoke/MethodHandles.java	Mon May 23 20:48:12 2016 -0700
@@ -28,6 +28,7 @@
 import java.lang.reflect.*;
 import java.util.BitSet;
 import java.util.List;
+import java.util.ArrayList;
 import java.util.Arrays;
 
 import sun.invoke.util.ValueConversions;
@@ -2445,6 +2446,7 @@
      */
     public static
     MethodHandle dropArguments(MethodHandle target, int pos, List<Class<?>> valueTypes) {
+        valueTypes = copyTypes(valueTypes);
         MethodType oldType = target.type();  // get NPE
         int dropped = dropArgumentChecks(oldType, pos, valueTypes);
         MethodType newType = oldType.insertParameterTypes(pos, valueTypes);
@@ -2459,6 +2461,11 @@
         return result;
     }
 
+    private static List<Class<?>> copyTypes(List<Class<?>> types) {
+        Object[] a = types.toArray();
+        return Arrays.asList(Arrays.copyOf(a, a.length, Class[].class));
+    }
+
     private static int dropArgumentChecks(MethodType oldType, int pos, List<Class<?>> valueTypes) {
         int dropped = valueTypes.size();
         MethodType.checkSlotCount(dropped);