[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: String/Hashtable bootstrapping problem
From: |
John Leuner |
Subject: |
Re: String/Hashtable bootstrapping problem |
Date: |
Sat, 07 Jul 2001 01:27:53 +0000 |
User-agent: |
Mutt/1.3.15i |
> > > I have encountered a problem trying to initialize the String and Hashtable
> > > classes. Here's the problem:
> > >
> > > - Hashtable uses String constants like "loadFactor" and "threshold" which
> > > are initialized in Hashtable.<clinit>.
> >
> > You are mistaken, these are primitive types (ints and floats).
>
> I'm talking about these lines from java.util.Hashtable:
>
> // used for serializing instances of this class
> private static final ObjectStreamField[] serialPersistentFields =
> { new ObjectStreamField("loadFactor", float.class),
> new ObjectStreamField("threshold", int.class) };
I didn't see these. Further inspection shows that they're not in my copy of
Hashtable.java. I have revision 1.13 from CVS, which one are you using?
I have a method in my JVM which makes a String object from an Ascii string.
At the end I have this code:
//Now return the value of String.intern
{
jmethodID mid = CLASSFILE_FindMethod( env, ODEREF(hObjectTemp)->pstType,
"intern", "()Ljava/lang/String;");
if(mid)
{
return (*env)->CallObjectMethod( env, hObjectTemp, mid);
}
else
{
eprintf("System method String.intern() not found, bailing out\n");
assert(2 == 3);
}
}
Of course, this is potentially a serious speed killer, a JVM should make the
string allocation as fast as possible.
John Leuner