Duplicate :
|
|
Relates :
|
|
Relates :
|
Please see the minimized test below to reproduce the issue. Minimized test: =============== $ cat Test.java import java.lang.invoke.*; import static java.lang.invoke.MethodType.*; import static java.lang.invoke.MethodHandles.*; public class Test { public static void main(String[] args) throws Exception { MethodHandle mh = lookup().findVirtual(String.class, "endsWith", methodType(boolean.class, String.class)); MethodType ret = mh.asCollector(Object[].class, 10).type(); } } Minimized test output: ======================== $ javac Test.java $ java -showversion -verify Test java version "1.7.0-ea" Java(TM) SE Runtime Environment (build 1.7.0-ea-b139) Java HotSpot(TM) Server VM (build 21.0-b09, mixed mode) Exception in thread "main" java.lang.UnsupportedOperationException: NYI at java.lang.invoke.ToGeneric.buildAdapterFromBytecodes(ToGeneric.java:314) at java.lang.invoke.ToGeneric.<init>(ToGeneric.java:139) at java.lang.invoke.ToGeneric.of(ToGeneric.java:253) at java.lang.invoke.ToGeneric.make(ToGeneric.java:245) at java.lang.invoke.MethodHandleImpl.convertArguments(MethodHandleImpl.java:693) at java.lang.invoke.MethodHandleImpl.collectArguments(MethodHandleImpl.java:747) at java.lang.invoke.MethodHandles.collectArguments(MethodHandles.java:1596) at java.lang.invoke.MethodHandle.asCollector(MethodHandle.java:791) at Test.main(Test.java:10)
|