On Wed, 10 Mar 2021 23:03:03 GMT, Brian Burkhalter <b...@openjdk.org> wrote:

> Please review this minor change to the specification of 
> `java.io.PrintStream`. The longstanding behavior for flushing is to invoke 
> the `flush()` method of the underlying `OutputStream` rather than its 
> override but this was not made explicit in the specification.

> Yes, I noticed that as well. I didn?t think it was worth complicating things 
> for the purpose of this issue to address it.

I guess what I was trying to ask is whether we should actually specify that 
`print` and `append` call `flush` - as this seems to be a side effect of some 
optimization.
Maybe we should say that the implementation ensures that flush is called when 
writing a byte array or when  a newline character or byte ({@code '\n'}) is 
written - but might call it in additional unspecified circumstances?

-------------

PR: https://git.openjdk.java.net/jdk/pull/2926

Reply via email to