Method references in annotations?

Jason Schroeder shrode at
Mon Aug 15 15:59:38 PDT 2011

Minor restatement of my last sentence: "My aim was to explore
MethodHandles with a similar ability to box method references and to
also attempt to get the annotation request for free."

On Mon, Aug 15, 2011 at 4:56 PM, Jason Schroeder <shrode at> wrote:
> Neal,
> Since I now read that there are internal conversations, any
> implementation experiment
> I have here is noise, until those email threads appear.
> To answer your question:
> The signature of Method.invoke implements all methods.  And therefore
> the signature of Method.invoke is the uninteresting, unused SAM for
> all methods in Java.  So for the purpose of boxing a method reference,
> and not adding a plain literal hack of "Method m =," it is
> possible to explore the ramifications of making a SAM interface for
> Method.invoke and expecting an optimization/special-case of:
> MethodInvoke m =
> to play by the rules of SAM but return the actual Method.   As a
> starting point, then one can begin to elide the needs for some
> similarity across method references by specifying a boxing-like rule.
>  My aim was to reach into MethodHandles and get the annotation
> requirement for free.

More information about the lambda-dev mailing list