aboutsummaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog5
-rw-r--r--libjava/java/lang/StringBuffer.java11
2 files changed, 9 insertions, 7 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index d126cd1..8db6f2f 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,8 @@
+2000-01-16 Anthony Green <green@cygnus.com>
+
+ * java/lang/StringBuffer.java (StringBuffer): Don't special case
+ null argument.
+
2000-01-16 Jeff Sturm <jsturm@sigma6.com>
* java/io/StreamTokenizer.java (nextToken): Avoid unread(TT_EOF).
diff --git a/libjava/java/lang/StringBuffer.java b/libjava/java/lang/StringBuffer.java
index 70f78fb..7f6e42e 100644
--- a/libjava/java/lang/StringBuffer.java
+++ b/libjava/java/lang/StringBuffer.java
@@ -1,6 +1,6 @@
// StringBuffer.java - Growable strings.
-/* Copyright (C) 1998, 1999 Cygnus Solutions
+/* Copyright (C) 1998, 1999, 2000 Red Hat
This file is part of libgcj.
@@ -241,12 +241,9 @@ public final class StringBuffer implements Serializable
public StringBuffer (String str)
{
- // Note: nowhere does it say that we should handle a null
- // argument here. In fact, the JCL implies that we should not.
- // But this leads to an asymmetry: `null + ""' will fail, while
- // `"" + null' will work.
- if (str == null)
- str = "null";
+ // The documentation is not clear, but experimentation with
+ // other implementations indicates that StringBuffer(null)
+ // should throw a NullPointerException.
count = str.length();
// JLS: The initial capacity of the string buffer is 16 plus the
// length of the argument string.