Re: [Sablevm-developer] Re: Reflection and interfaces
Brought to you by:
egagnon
From: Chris P. <chr...@ma...> - 2004-05-21 13:54:31
|
Laurent Martelli wrote: >>>>>>"Grzegorz" == Grzegorz B Prokopski <ga...@de...> writes: > > > Grzegorz> On (19/05/04 14:19), Laurent Martelli wrote: > >> Hello, > >> > >> java.lang.Class.getMethods() returns an empty for interfaces with > >> sablevm 1.1.4. Is it a known bug/limitation ? > > Grzegorz> I have looked at the code of Classpath and functions > Grzegorz> called into the VM and it seems that this should be > Grzegorz> handled. I presume it's a bug then. > > Grzegorz> Could somebody more insightful take a look at that? > > I think java.lang.Class.getDeclaredMethods() should rather look like this: > > Method[] getDeclaredMethods (boolean publicOnly) > { > - if (isPrimitive() || isArray() || isInterface()) > + if (isPrimitive() || isArray()) > { > return new Method[] { }; > } > else > { > return VMClass.getDeclaredMethods(this, publicOnly); > } > } > > I though I had already sen this to the list, but I've been using gmane > and there seems to be a delay. Hi Laurent, I never got this java.lang.getDeclaredMethods() patch before and I'm subscribed to sab...@li.... I did however get a suggestion for java.lang.isAssignableFrom(). I'm not a Classpath hacker, so you'll need to wait for a response from Etienne or David about that. In the meantime, for the above, you can take a look at VMClass.getDeclaredMethods() in sablevm/src/libsablevm/java_lang_VMClass.c and maybe you'll find the problem. Also, if you want to get a recent "staging" branch of both sablevm and sablevm-classpath (this is the first-level shared developer branch), you can follow the instructions here: http://devel.sablevm.org/wiki/Getting Cheers, Chris |