Hi,
On Sat, Mar 1, 2014 at 12:16 AM, John Rose wrote:
> On Feb 25, 2014, at 3:13 AM, Ali Ebrahimi
> wrote:
>
> I know, this is too late, but I want to share my suggestion:
>
> public T reflectAs(Class super T> expected, MethodHandles.Lookup lookup)
>
>
> Isn't this the same as
>
> public T r
On Feb 25, 2014, at 3:13 AM, Ali Ebrahimi wrote:
> I know, this is too late, but I want to share my suggestion:
>
> public T reflectAs(Class super T> expected, MethodHandles.Lookup lookup)
Isn't this the same as
public T reflectAs...
?
I think we considered AccessibleObject but rejected i
Hi,
I know, this is too late, but I want to share my suggestion:
public T reflectAs(Class expected, MethodHandles.Lookup lookup)
Member mr = reflectAs(Member.class, MethodHandles.lookup());
AnnotatedElement ae = reflectAs(AnnotatedElement.class,
MethodHandles.lookup());
AnnotatedElement am =
Hi,
I know this is not fully type safe, in fact java generics is not fully type
safe.
We don't have any better solution with current language support.
if we had:
or
we had better solutions:
public T reflectAs(Class expected,
Lookup lookup)
public R reflectAs(Class expected, Lookup lookup)
but
Hmm, maybe I don't understand you correctly, but I can see no compelling
need to be able to do
"info.reflectAs(AnnotatedElement.class, lookup)",
as the method's spec clearly says that it will return one of the three
types known to implement java.lang.reflect.Member.
Those types all implement java
On 11/11/2013 08:14 AM, Peter Levart wrote:
The method could simply be:
public 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.reflect(lookup);
Well, well, explicit type parameter
On 11/11/2013 02:24 AM, Ali Ebrahimi wrote:
This is another workaround:
public R reflectAs(Classsuper T> expected, Lookup lookup);
info.reflectAs(Member.class, lookup);//works
info.reflectAs(AnnotatedElement.class, lookup);//works
info.reflectAs(Member.class, lookup);//works
info.reflectAs(An
This is another workaround:
public R reflectAs(Class
expected, Lookup lookup);
info.reflectAs(Member.class, lookup);//works
info.reflectAs(AnnotatedElement.class, lookup);//works
info.reflectAs(Member.class, lookup);//works
info.reflectAs(AnnotatedElement.class, lookup);//works
info.reflectAs(
The is a stupid issue with the signature of MethodHandleInfo.reflectAs,
j.l.r.Field, Method or Constructor implement two interfaces Member and
AnnotatedElement, with the current signature, the code
info.reflectAs(Member.class, lookup)
works but the code
info.reflectAs(AnnotatedElement.class, l