diff options
author | green <green@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-01-17 00:00:43 +0000 |
---|---|---|
committer | green <green@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-01-17 00:00:43 +0000 |
commit | f72e97bc5b43931db2c67a2b2ed75aaecc6b91d9 (patch) | |
tree | 9ea09e09c5b8847d0a2bfe7d1b1a67814545c8f6 /libjava/java | |
parent | 24f9b5dc58fef62def7cd11ca27d531002371800 (diff) | |
download | ppe42-gcc-f72e97bc5b43931db2c67a2b2ed75aaecc6b91d9.tar.gz ppe42-gcc-f72e97bc5b43931db2c67a2b2ed75aaecc6b91d9.zip |
2000-01-16 Anthony Green <green@cygnus.com>
* java/lang/StringBuffer.java (StringBuffer): Don't special case
null argument.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@31451 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java')
-rw-r--r-- | libjava/java/lang/StringBuffer.java | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/libjava/java/lang/StringBuffer.java b/libjava/java/lang/StringBuffer.java index 70f78fbf8e5..7f6e42ec9c9 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. |