Invokes the method handle, allowing any caller type descriptor, and optionally performing conversions on arguments and return values.
If the call site's symbolic type descriptor exactly matches this method handle's {@link #type type}, the call proceeds as if by {@link #invokeExact invokeExact}.
Otherwise, the call proceeds as if this method handle were first adjusted by calling {@link #asType asType} to adjust this method handleto the required type, and then the call proceeds as if by {@link #invokeExact invokeExact} on the adjusted method handle.
There is no guarantee that the {@code asType} call is actually made.If the JVM can predict the results of making the call, it may perform adaptations directly on the caller's arguments, and call the target method handle according to its own exact type.
The resolved type descriptor at the call site of {@code invoke} mustbe a valid argument to the receivers {@code asType} method.In particular, the caller must specify the same argument arity as the callee's type, if the callee is not a {@linkplain #asVarargsCollector variable arity collector}.
When this method is observed via the Core Reflection API, it will appear as a single native method, taking an object array and returning an object. If this native method is invoked directly via {@link java.lang.reflect.Method#invoke java.lang.reflect.Method.invoke}, via JNI, or indirectly via {@link java.lang.invoke.MethodHandles.Lookup#unreflect Lookup.unreflect}, it will throw an {@code UnsupportedOperationException}.
@param args the signature-polymorphic parameter list, statically represented using varargs
@return the signature-polymorphic result, statically represented using {@code Object}
@throws WrongMethodTypeException if the target's type cannot be adjusted to the caller's symbolic type descriptor
@throws ClassCastException if the target's type can be adjusted to the caller, but a reference cast fails
@throws Throwable anything thrown by the underlying method propagates unchanged through the method handle call