This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: JNIEnv::FindClass("[B")


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]