Hi,
Imagine there is
class A {
public int x(){return 1;}
}
class B extends A {
public int x(){
return super.x()+1;
}
}
to solve cases like that in Groovy we have to generate a call stub for
A#x in B, that allows calling x' as super.x(). That is because
Reflection does not provide any terms of handling this, since if in
Reflection I would try to invoke the method A#x with a B, I would get
B#x invoked and not A#x. Since that again recently was brought to my
attention I was asking myself if MethodHandles do solve that case or
not. Especially all that talking about invoke exact, generic and
whatever makes me wonder right now. Of Remi's having a backport for
MethodHandels, then I wonder how this case is supposed to be solved,
since Reflection cannot be used for this. Dynamically generating a
subclass of A and then sending the call through that subclass instead of
doing super.x() in B would seem like a possible solution... Only I fear
restricted environments forbidding this kind of thing at runtime. If
then at sompile time we didn't take counter measures already, then at
runtime it is too late to do anything and I would prefer not having
people to loosen their security managers for that.
If MethodHandles solve that I failed to see how exactly. If they don't
solve it, then I think it is a problem.
bye Jochen
--
Jochen "blackdrag" Theodorou
The Groovy Project Tech Lead (http://groovy.codehaus.org)
http://blackdragsview.blogspot.com/
--
You received this message because you are subscribed to the Google Groups "JVM
Languages" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/jvm-languages?hl=en.