RFR [6961766]: PrintStream.write() should flush at most once

David Holmes david.holmes at oracle.com
Wed Aug 7 12:19:25 UTC 2013


Ivan,

On 7/08/2013 3:08 PM, Alan Bateman wrote:
> On 06/08/2013 09:38, Ivan Gerasimov wrote:
>> Hello everybody!
>>
>> Would you please review a simple fix, suggested by someone on
>> bugs.sun.com?
>>
>> j.i.PrintStream#write(char[]) calls out.flush() on each '\n' character
>> found in the array.
>> It's sufficient to do it only once.
> One thing to check is whether this will require any changes to the spec
> (as it is currently specified to call flush when a newline is written).
> I don't have time just at the moment to check this but that would be my
> only concern with a change like this.

Yes - this is NOT A BUG this is the spec for this class:

"Optionally, a PrintStream can be created so as to flush automatically; 
this means that the flush method is automatically invoked after a byte 
array is written, one of the println methods is invoked, or a newline 
character or byte ('\n') is written. "

This bug report should be closed as "not an issue".

David
-----


> -Alan



More information about the core-libs-dev mailing list