* 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.
|
||||
*/
|
||||
public synchronized void writeln(Object what) {
|
||||
write(what);
|
||||
// if what is null, buffer may still be uninitialized
|
||||
if (buffer == null) {
|
||||
if (what != null) {
|
||||
write(what.toString());
|
||||
} else if (buffer == null) {
|
||||
// if what is null, buffer may still be uninitialized
|
||||
buffer = new StringBuffer(INITIAL_BUFFER_SIZE);
|
||||
}
|
||||
buffer.append(newLine);
|
||||
|
|
Loading…
Add table
Reference in a new issue