* Minor code improvement in write() method.

This commit is contained in:
hns 2006-08-16 11:05:26 +00:00
parent 736769cc80
commit f779decdfc

View file

@ -321,9 +321,10 @@ public final class ResponseTrans extends Writer implements Serializable {
* Write object to response buffer and append a platform dependent newline sequence. * Write object to response buffer and append a platform dependent newline sequence.
*/ */
public synchronized void writeln(Object what) { public synchronized void writeln(Object what) {
write(what); if (what != null) {
// if what is null, buffer may still be uninitialized write(what.toString());
if (buffer == null) { } else if (buffer == null) {
// if what is null, buffer may still be uninitialized
buffer = new StringBuffer(INITIAL_BUFFER_SIZE); buffer = new StringBuffer(INITIAL_BUFFER_SIZE);
} }
buffer.append(newLine); buffer.append(newLine);