RFR: JDK-8167648: java.io.PrintWriter should have PrintWriter((String|File), Charset) constructors

Patrick Reinhart patrick at reini.net
Wed Nov 23 13:45:59 UTC 2016


On 2016-11-23 14:35, Jonathan Bluett-Duncan wrote:
> Hi Patrick,
> 
> Have you considered making `withAutoFlush()` return the `PrintWriter`
> itself, allowing fluent code snippets like the following?
> 
> ```
> PrintWriter writer = new PrintWriter(new File("path/to/file.txt"),
> StandardCharsets.UTF_8).withAutoFlush();
> ```
> 

Good point. I taught about it, but it somehow got lost on the way of 
re-wiring the constructors... :-)

Just updated the webrev


-Patrick


More information about the core-libs-dev mailing list