OSDN Git Service

Fix for PR java/5165:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 21 Dec 2001 21:59:27 +0000 (21:59 +0000)
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 21 Dec 2001 21:59:27 +0000 (21:59 +0000)
* java/lang/natClassLoader.cc (_Jv_PrepareCompiledClass):
Convert any constant string field to a String; not just final
fields.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@48255 138bc75d-0d04-0410-961f-82ee72b054a4

libjava/ChangeLog
libjava/java/lang/natClassLoader.cc

index a9ce352..b4daf82 100644 (file)
@@ -1,5 +1,10 @@
 2001-12-21  Tom Tromey  <tromey@redhat.com>
 
+       Fix for PR java/5165:
+       * java/lang/natClassLoader.cc (_Jv_PrepareCompiledClass):
+       Convert any constant string field to a String; not just final
+       fields.
+
        Fix for PR libgcj/2428:
        * java/lang/natClass.cc: Include RuntimePermission.h.
        (getClassLoader): Define.
index a6f7b60..75d9e32 100644 (file)
@@ -292,12 +292,10 @@ _Jv_PrepareCompiledClass (jclass klass)
       for (int n = JvNumStaticFields (klass); n > 0; --n)
        {
          int mod = f->getModifiers ();
-         // Maybe the compiler should mark these with
-         // _Jv_FIELD_CONSTANT_VALUE?  For now we just know that this
-         // only happens for constant strings.
+         // If we have a static String field with a non-null initial
+         // value, we know it points to a Utf8Const.
          if (f->getClass () == &StringClass
-             && java::lang::reflect::Modifier::isStatic (mod)
-             && java::lang::reflect::Modifier::isFinal (mod))
+             && java::lang::reflect::Modifier::isStatic (mod))
            {
              jstring *strp = (jstring *) f->u.addr;
              if (*strp)