Details
Description
The DefaultGroovyMethods:
print(Object)
println(Object)
print(Object, Object)
println(Object, Object)
all will create a PrintWriter and then do a Writer.close() if self is a Writer. That will close the underlying writer, which is definitely the wrong thing.
The correct behavior is to do a flush().
It is easy to see that flushing rather than closing is the right thing by looking at what happens if self is not a Writer. In that case System.out.print(ln) is called and System.out is not closed.
Activity
Jim White
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Affects Version/s | 1.5.7 [ 14242 ] | |
| Assignee | Jim White [ jimwhite ] | |
| Fix Version/s | 1.5.8 [ 14630 ] | |
| Fix Version/s | 1.6 [ 13832 ] | |
| Affects Version/s | 1.6-rc-1 [ 14009 ] |
Jim White
made changes -
| Status | Open [ 1 ] | In Progress [ 3 ] |
Jim White
made changes -
| Resolution | Fixed [ 1 ] | |
| Status | In Progress [ 3 ] | Resolved [ 5 ] |
Paul King
made changes -
| Status | Resolved [ 5 ] | Closed [ 6 ] |