aboutsummaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authorBryce McKinlay <bryce@albatross.co.nz>1999-12-02 19:59:30 +0000
committerBryce McKinlay <bryce@gcc.gnu.org>1999-12-02 19:59:30 +0000
commitaa620e429476609d468be40383a7603d2b9c6547 (patch)
treebfdb3ad6a222bf36be8a8702e2ae8b14289e7f8a /libjava
parente6770d3c8c6307d5f453e2990b0d9984589b4c53 (diff)
downloadgcc-aa620e429476609d468be40383a7603d2b9c6547.zip
gcc-aa620e429476609d468be40383a7603d2b9c6547.tar.gz
gcc-aa620e429476609d468be40383a7603d2b9c6547.tar.bz2
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
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog8
-rw-r--r--libjava/java/lang/Boolean.java7
-rw-r--r--libjava/java/lang/natString.cc2
3 files changed, 12 insertions, 5 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 099d727..ed63024 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -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>
diff --git a/libjava/java/lang/Boolean.java b/libjava/java/lang/Boolean.java
index 78ab77f..060f126 100644
--- a/libjava/java/lang/Boolean.java
+++ b/libjava/java/lang/Boolean.java
@@ -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;
}
}
diff --git a/libjava/java/lang/natString.cc b/libjava/java/lang/natString.cc
index 53bda1f..88168e3 100644
--- a/libjava/java/lang/natString.cc
+++ b/libjava/java/lang/natString.cc
@@ -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);