Signature of MethodHandleInfo.reflectAs is not specific enough

Peter Levart peter.levart at
Mon Nov 11 08:35:49 UTC 2013

On 11/11/2013 08:14 AM, Peter Levart wrote:
> The method could simply be:
>     public <T extends Member> T reflect(Lookup lookup);

But if one needs to hint the compiler, explicit type parameters can be 
used as an escape hatch as always:
>     Object o = info.<Method>reflect(lookup);

Well, well, explicit type parameters for method invocation are not 
needed in above example:

     Object o = info.reflect(lookup); // compiles

One would only need them in situations like:


Regards, Peter

More information about the core-libs-dev mailing list