mirror of
https://github.com/gcc-mirror/gcc.git
synced 2026-05-06 23:25:24 +02:00
natString.cc (equalsIgnoreCase): return false if anotherString is null.
* java/lang/natString.cc (equalsIgnoreCase): return false if
anotherString is null.
* java/lang/Boolean.java (valueOf): return FALSE if argument is
null.
From-SVN: r30763
This commit is contained in:
committed by
Bryce McKinlay
parent
e6770d3c8c
commit
aa620e4294
@@ -89,7 +89,10 @@ public final class Boolean extends Object implements Serializable
|
||||
|
||||
public static Boolean valueOf(String str)
|
||||
{
|
||||
/* This returns a Boolean (big B), not a boolean (little b). */
|
||||
return str.equalsIgnoreCase("true") ? TRUE : FALSE;
|
||||
if (str == null)
|
||||
return FALSE;
|
||||
else
|
||||
/* This returns a Boolean (big B), not a boolean (little b). */
|
||||
return str.equalsIgnoreCase("true") ? TRUE : FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -524,7 +524,7 @@ java::lang::String::toCharArray()
|
||||
jboolean
|
||||
java::lang::String::equalsIgnoreCase (jstring anotherString)
|
||||
{
|
||||
if (count != anotherString->count)
|
||||
if (anotherString == NULL || count != anotherString->count)
|
||||
return false;
|
||||
register jchar *tptr = JvGetStringChars (this);
|
||||
register jchar *optr = JvGetStringChars (anotherString);
|
||||
|
||||
Reference in New Issue
Block a user