* Minor code improvement in write() method.
This commit is contained in:
parent
736769cc80
commit
f779decdfc
1 changed files with 4 additions and 3 deletions
|
@ -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);
|
||||||
|
|
Loading…
Add table
Reference in a new issue