...
- Exact invocation: The
invokeExact
method requires the caller and callee method types to have identical components. This method is public, safe, and signature-polymorphic. - Generic invocation: The generic
invoke
method allows the caller and callee method types to differ, as long as the callee can be viewed under the caller type, using theasType
method. As a consequence, this mode offers on-the-fly argument and return conversions. This method is public, safe, and signature-polymorphic. - Varargs invocation: The overloaded
invokeWithArguments
method allow an arbitrary varargs array or list of untyped arguments to be applied to a callee, and the call succeeds as long as the callee can be viewed under an implied caller type determined as if byMethodType.genericType
. This method is public. - Basic invocation: The
invokeBasic
method requires that the caller and callee method types have corresponding components, but uses "basic type" matching, which allows any reference to match any other reference. Because there is no runtime check for this condition, nor for reference compatibility, this method is non-public and matching types, this method must be used carefully. It is used by trusted code to implement the other invocation modes. It is This method is non-public and signature-polymorphic. The JVM implementation treats it very specially. - Invokedynamic invocation: The
invokedynamic
instruction implicitly performs an exact invocation on the target of its resolved call site. (Unlike the other modes, the callee is not visible as a receiver on the JVM expression stack.) Because the system ensures that all call site targets have pre-checked callee method types, the system may use basic invocation as an implementation option.
...
Overview
Content Tools
ThemeBuilder