natString.cc (_Jv_AllocString): Initialize cachedHashCode.
authorTom Tromey <tromey@redhat.com>
Mon, 28 Apr 2003 18:19:23 +0000 (18:19 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Mon, 28 Apr 2003 18:19:23 +0000 (18:19 +0000)
* java/lang/natString.cc (_Jv_AllocString): Initialize
cachedHashCode.
(init): Likewise.
(_Jv_NewStringUtf8Const): Likewise.

From-SVN: r66180

libjava/ChangeLog
libjava/java/lang/natString.cc

index 6765b0e..72b4f92 100644 (file)
@@ -1,3 +1,10 @@
+2003-04-27  Tom Tromey  <tromey@redhat.com>
+
+       * java/lang/natString.cc (_Jv_AllocString): Initialize
+       cachedHashCode.
+       (init): Likewise.
+       (_Jv_NewStringUtf8Const): Likewise.
+
 2003-03-29  Mohan Embar  <gnustuff@thisiscool.com>
 
        * include/jvm.h: (_Jv_GetNbArgs) added
index 6514d81..8c9789e 100644 (file)
@@ -288,6 +288,7 @@ _Jv_NewStringUtf8Const (Utf8Const* str)
       chrs = JvGetStringChars(jstr);
       memcpy (chrs, buffer, sizeof(jchar)*length);
     }
+  jstr->cachedHashCode = hash;
   *ptr = jstr;
   SET_STRING_IS_INTERNED(jstr);
   // When string is GC'd, clear the slot in the hash table.
@@ -408,6 +409,7 @@ _Jv_AllocString(jsize len)
   obj->data = obj;
   obj->boffset = sizeof(java::lang::String);
   obj->count = len;
+  obj->cachedHashCode = 0;
   return obj;
 }