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:
Bryce McKinlay 1999-12-02 19:59:30 +00:00 committed by Bryce McKinlay
parent e6770d3c8c
commit aa620e4294
3 changed files with 12 additions and 5 deletions

View File

@ -1,7 +1,11 @@
1999-12-02 Bryce McKinlay <bryce@albatross.co.nz>
* libjava/java/net/ServerSocket.java (ServerSocket): Bind to any
interface if bindAddr is null.
* java/net/ServerSocket.java (ServerSocket): Bind to any interface
if bindAddr is null.
* java/lang/natString.cc (equalsIgnoreCase): return false if
anotherString is null.
* java/lang/Boolean.java (valueOf): return FALSE if argument is
null.
1999-11-30 Tom Tromey <tromey@cygnus.com>

View File

@ -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;
}
}

View File

@ -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);