To resolve an unresolved symbolic reference to a call site specifier involves three steps:
- A call site specifier gives a symbolic reference to a method handle which is to serve as the bootstrap method for a dynamic call site (§4.7.23). The method handle is resolved to obtain a
referenceto an instance ofjava.lang.invoke.MethodHandle(§5.4.3.5). - A call site specifier gives a method descriptor, TD. A
referenceto an instance ofjava.lang.invoke.MethodTypeis obtained as if by resolution of a symbolic reference to a method type with the same parameter and return types as TD (§5.4.3.5). - A call site specifier gives zero or more static arguments, which communicate application-specific metadata to the bootstrap method. Any static arguments which are symbolic references to classes, method handles, or method types are resolved, as if by invocation of the ldc instruction (§ldc), to obtain
references toClassobjects,java.lang.invoke.MethodHandleobjects, andjava.lang.invoke.MethodTypeobjects respectively. Any static arguments that are string literals are used to obtainreferences toStringobjects.
The result of call site specifier resolution is a tuple consisting of:
- the
referenceto an instance ofjava.lang.invoke.MethodHandle, - the
referenceto an instance ofjava.lang.invoke.MethodType, - the
references to instances ofClass,java.lang.invoke.MethodHandle,java.lang.invoke.MethodType, andString.
During resolution of the symbolic reference to the method handle in the call site specifier, or resolution of the symbolic reference to the method type for the method descriptor in the call site specifier, or resolution of a symbolic reference to any static argument, any of the exceptions pertaining to method type or method handle resolution may be thrown (§5.4.3.5).