classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [cp-patches] RFC: RMI Class loader fix


From: Jeroen Frijters
Subject: RE: [cp-patches] RFC: RMI Class loader fix
Date: Mon, 25 Jul 2005 18:26:32 +0200

Mark Wielaard wrote:
> On Mon, 2005-07-25 at 14:52 +0200, Jeroen Frijters wrote:
> > I'm not an RMI person, but an IKVM user ran into an RMI 
> problem that I
> > think is caused by a problem in the RMI class loader that 
> the attached
> > patch should fix.
> > 
> > Please comment.
> 
> I assume this is because the code tries to load an array class and
> forName() allows to specify arrays as type strings, but 
> loadClass() only allows for fully qualified class names? Our
> documentation isn't very clear here. But if that is the case then
> this patch looks good.

Unfortunately the Sun documentation isn't very clear either, but you are
correct that I believe this to be the case. BTW, clearly Class.forName()
allows array types, but ClassLoader.loadClass() isn't very clear and the
Sun implementation does some weird things. Here's an example I tried:

public class test
{
  public static void main(String[] args) throws Exception
  {
    System.out.println(test.class.getClassLoader().loadClass("test"));
    Class.forName("[Ltest;");
 
System.out.println(test.class.getClassLoader().loadClass("[Ltest;"));
  }
}

If you run this on JDK 1.5, the second loadClass succeeds, but if you
comment out the Class.forName(), the second load class fails. On JDK
1.4, the Class.forName() isn't required, but if you comment out the
first loadClass, the second one will fail...

I will commit the RMI fix.

Regards,
Jeroen




reply via email to

[Prev in Thread] Current Thread [Next in Thread]