Java Code Examples for java.lang.invoke.MethodHandle#getClass()

The following examples show how to use java.lang.invoke.MethodHandle#getClass() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GuardedInvocation.java    From openjdk-8-source with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Creates a new guarded invocation.
 *
 * @param invocation the method handle representing the invocation. Must not be null.
 * @param guard the method handle representing the guard. Must have the same method type as the invocation, except
 * it must return boolean. For some useful guards, check out the {@link Guards} class. It can be null. If both it
 * and the switch point are null, this represents an unconditional invocation, which is legal but unusual.
 * @param switchPoint the optional switch point that can be used to invalidate this linkage.
 * @throws NullPointerException if invocation is null.
 */
public GuardedInvocation(MethodHandle invocation, MethodHandle guard, SwitchPoint switchPoint) {
    invocation.getClass(); // NPE check
    this.invocation = invocation;
    this.guard = guard;
    this.switchPoint = switchPoint;
}
 
Example 2
Source File: GuardedInvocation.java    From openjdk-8 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Creates a new guarded invocation.
 *
 * @param invocation the method handle representing the invocation. Must not be null.
 * @param guard the method handle representing the guard. Must have the same method type as the invocation, except
 * it must return boolean. For some useful guards, check out the {@link Guards} class. It can be null. If both it
 * and the switch point are null, this represents an unconditional invocation, which is legal but unusual.
 * @param switchPoint the optional switch point that can be used to invalidate this linkage.
 * @throws NullPointerException if invocation is null.
 */
public GuardedInvocation(MethodHandle invocation, MethodHandle guard, SwitchPoint switchPoint) {
    invocation.getClass(); // NPE check
    this.invocation = invocation;
    this.guard = guard;
    this.switchPoint = switchPoint;
}
 
Example 3
Source File: GuardedInvocation.java    From nashorn with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Creates a new guarded invocation.
 *
 * @param invocation the method handle representing the invocation. Must not be null.
 * @param guard the method handle representing the guard. Must have the same method type as the invocation, except
 * it must return boolean. For some useful guards, check out the {@link Guards} class. It can be null. If both it
 * and the switch point are null, this represents an unconditional invocation, which is legal but unusual.
 * @param switchPoint the optional switch point that can be used to invalidate this linkage.
 * @throws NullPointerException if invocation is null.
 */
public GuardedInvocation(MethodHandle invocation, MethodHandle guard, SwitchPoint switchPoint) {
    invocation.getClass(); // NPE check
    this.invocation = invocation;
    this.guard = guard;
    this.switchPoint = switchPoint;
}