JNIEnv::FindClass("[B")
Andrew Haley
aph@redhat.com
Mon Apr 4 10:01:00 GMT 2005
Thomas Hallgren writes:
> Caolan McNamara wrote:
> > Should FindClass be able to return a jclass for an array of bytes ?
> >
> > db 4 wants to do this so it can make an array of arrays of bytes which
> > is failing at runtime. i.e.
> > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=153230
> > Is it legitimate in the first place ?
> >
> > C.
> >
> >
> Why should it not be? Class.forName("[B") must certanly work, why should
> the JNI semantics be different?
This:
public class foo2
{
public static void main (String[] argv) throws Throwable {
Class c = Class.forName ("[Ljava.lang.String;");
c = Class.forName ("[B");
System.out.println (c);
c = ClassLoader.getSystemClassLoader().loadClass ("[[Ljava.lang.String;");
System.out.println (c);
}
}
works on other implementations but fails on gcj.
So, the right place to fix this is ClassLoader.loadClass().
Andrew.
More information about the Java
mailing list