This fixes the behaviour of StringBuffer/Builder.append as
noted in PR34840.

ChangeLog:

2008-03-14  Andrew John Hughes  <[EMAIL PROTECTED]>

        PR classpath/34840
        * java/lang/AbstractStringBuffer.java:
        (append(CharSequence,int,int)): Just set
        sequence to "null" don't append it.

-- 
Andrew :)

Support Free Java!
Contribute to GNU Classpath and the OpenJDK
http://www.gnu.org/software/classpath
http://openjdk.java.net
PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
Fingerprint = F8EF F1EA 401E 2E60 15FA  7927 142C 2591 94EF D9D8
Index: java/lang/AbstractStringBuffer.java
===================================================================
RCS file: /sources/classpath/classpath/java/lang/AbstractStringBuffer.java,v
retrieving revision 1.3
diff -u -3 -p -u -r1.3 AbstractStringBuffer.java
--- java/lang/AbstractStringBuffer.java	12 Mar 2008 00:01:45 -0000	1.3
+++ java/lang/AbstractStringBuffer.java	14 Mar 2008 00:42:12 -0000
@@ -405,8 +405,8 @@ abstract class AbstractStringBuffer
 
   /**
    * Append some characters from the <code>CharSequence</code> to this
-   * buffer.  If the argument is null, the four characters "null" are
-   * appended.
+   * buffer.  If the argument is null, the <code>seq</code> is assumed
+   * to be equal to the string <code>"null"</code>.
    *
    * @param seq the <code>CharSequence</code> providing the characters
    * @param start the starting index
@@ -417,7 +417,7 @@ abstract class AbstractStringBuffer
   public AbstractStringBuffer append(CharSequence seq, int start, int end)
   {
     if (seq == null)
-      return append("null");
+      seq = "null";
     if (end - start > 0)
       {
 	ensureCapacity_unsynchronized(count + end - start);

Attachment: signature.asc
Description: Digital signature

Reply via email to