large Class.forName() patch

Jason Baker jbaker at cs.utah.edu
Mon Jan 31 12:40:23 PST 2000


Archie Cobbs <archie at whistle.com> writes:

> Jason Baker writes:
> > >   #define INTEGER_PRIMITIVE_CLASS	"I"
> > > 
> > > and use INTEGER_PRIMITIVE_CLASS instead of "int".. would this work?
> > 
> > No, its even worse, since a class in the anonymous package is alot
> > more likely to be called "I" than "int".  We can use "I" only where a
> > class would be L<path>;.  
> 
> Good point.. what about
> 
>   #define INTEGER_PRIMITIVE_CLASS	";I"
>   #define BOOLEAN_PRIMITIVE_CLASS	";Z"
> 

That works, but why are we looking up primitve types by name anyway?

nephi(14) find . -type f -print | xargs grep '"int"'
./developers/fixup.c:    addSymbol("_Jv_intClass", CLASS, "int", "", "");
./kaffe/kaffevm/itypes.c:        * Note that a user-defined "class int" is impossible cause "int"
./kaffe/kaffevm/itypes.c:       initPrimClass(&intClass, "int", 'I', 4);
./libraries/javalib/java/lang/Integer.java:     final public static Class TYPE = Class.getPrimitiveClass("int");

getPrimitveClass does not look up types by name, so the only problem
is in developers/fixup.c.  Why can't it just translate _Jv_intClass to
intClass?

Jason


More information about the kaffe mailing list