On Thu, 20 May 2021 20:12:07 GMT, Rémi Forax <fo...@openjdk.org> wrote:

> I don't think that using PrintWriter is a good idea here given that a 
> PrintWriter shallow the IOException

Good point, but...

PrintStream does also and it is used frequently for Stdout and Stderr. 

OutputStreamWriter would be a better choice with that in mind. It does not have 
the convenience methods for converting various types to strings but would not 
hide the exceptions. Developers could wrap it in a PrintWriter to get the 
convenience and take on the responsibility of dealing with exceptions by 
polling.

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

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

Reply via email to