re PR java/5165 (Loading class fields with a ConstantValue attribute)
Fix for PR java/5165: * java/lang/natClassLoader.cc (_Jv_PrepareCompiledClass): Convert any constant string field to a String; not just final fields. From-SVN: r48255
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user