On 01/07/2012 11:08 PM, Jochen Theodorou wrote:
hi all,
I have a small problem and I wonder how others solve this. Assuming I
have
foo.bar()
with the static type of foo being Object. Let us assume there is a
public class Base which provides a public method bar and there is a
class Foo$Foo extending Base, overriding bar, but this class is
private. foo be an instance of Foo$Foo.
If I now follow the usual pattern of Groovy method selection, then
this will give me of course Foo#bar. But if I want to use that I get a
"symbolic reference class is not public"
I may have no control over this class, so I don't see how I could get
a LOOKUP object... how am I supposed to call this method? Should I
really fall back to reflection for this?
bye blackdrag
You can always bypass the security by creating a j.l.r.Method,
call setAccessible() on it and then use lookup.unreflect().
cheers,
Rémi
--
You received this message because you are subscribed to the Google Groups "JVM
Languages" group.
To post to this group, send email to jvm-languages@googlegroups.com.
To unsubscribe from this group, send email to
jvm-languages+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/jvm-languages?hl=en.