Exemplo n.º 1
0
 /**
  * Return a method handle to invoke on the callerType, target, and remaining arguments. The method
  * handle must finish the call. This is the first look at the caller type and target.
  */
 private MethodHandle dispatch(MethodType callerType, MethodHandle target) {
   MethodType targetType = target.type();
   if (USE_AS_TYPE_PATH || target.isVarargsCollector()) {
     MethodHandle newTarget = target.asType(callerType);
     targetType = callerType;
     Invokers invokers = targetType.invokers();
     MethodHandle invoker = invokers.erasedInvokerWithDrops;
     if (invoker == null) {
       invokers.erasedInvokerWithDrops = invoker = dropDispatchArguments(invokers.erasedInvoker());
     }
     return invoker.bindTo(newTarget);
   }
   throw new RuntimeException("NYI");
 }