daily pastebin goal
13%
SHARE
TWEET

Untitled

a guest Jul 23rd, 2018 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package dyn;
  2.  
  3. import java.dyn.*;
  4.  
  5. public class Invoker {
  6.  
  7.    protected Object targetObject;
  8.  
  9.    public CallSite bootstrap(MethodHandles.Lookup lookup, String name, MethodType type) {
  10.       try {
  11.          MethodHandle handle = lookup.bind(targetObject, "bar",
  12.                MethodType.methodType(void.class, String.class));
  13.          return new ConstantCallSite(handle);
  14.       } catch (NoAccessException e) {
  15.          throw new RuntimeException("Failed lookup", e);
  16.       }
  17.    }
  18. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top