Skip to content

Instantly share code, notes, and snippets.

@rednaxelafx
Created July 18, 2011 23:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rednaxelafx/1090917 to your computer and use it in GitHub Desktop.
Save rednaxelafx/1090917 to your computer and use it in GitHub Desktop.
invoker and exactInvoker
$ groovysh
Groovy Shell (1.7.5, JVM: 1.7.0-ea)
Type 'help' or '\h' for help.
-------------------------------------------------------------------------------
groovy:000> import java.lang.invoke.*
===> [import java.lang.invoke.*]
groovy:000> mt = MethodType.methodType(String, String)
===> (String)String
groovy:000> MethodHandles.exactInvoker(mt)
===> MethodHandle(MethodHandle,String)String
groovy:000> MethodHandles.invoker(mt)
===> MethodHandle(MethodHandle,Object)Object
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment