Hi,

On Thu, Jul 19, 2001 at 12:06:46PM -0600, Tom Tromey wrote:
> Today I looked at merging Boolean and Integer with libgcj.
> 
> There's one patch I'd like to make but I don't know how valid it is.
> It is appended.
Would it not be simpler to add a VMClassLoader class to libgcj that
implements the getPrimitiveClass() method?

It seems that with gcj that method is very simple. Something like:

static Class getPrimitiveClass(Sting name) {
        if ("boolean".equals(name))
                return boolean.class;
        if ("char".equals(name))
                return char.class;
        if ("float".equals(name))
                return float.class;
        if ("double".equals(name))
                return double.class;
        if ("byte".equals(name))
                return byte.class;
        if ("short".equals(name))
                return short.class;
        if ("int".equals(name))
                return int.class;
        if ("long".equals(name))
                return long.class;
        if ("void".equals(name))
                return void.class;
        
        throw new ClassNotFoundError("No primitive class: " + name);
}

That way all VMs are treated equal.

Cheers,

Mark
-- 
Stuff to read:
    <http://www.toad.com/gnu/whatswrong.html>
  What's Wrong with Copy Protection, by John Gilmore

_______________________________________________
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath

Reply via email to