Request for Review and Sponsor needed: JDK-8167648: java.io.PrintWriter should have PrintWriter((String|File), Charset) constructors

Jason Mehrens jason_mehrens at hotmail.com
Wed Dec 21 21:40:53 UTC 2016


Patrick,

How is 'withAutoFlush' expected to behave for subclasses of PrintWriter?

Jason

________________________________________
From: core-libs-dev <core-libs-dev-bounces at openjdk.java.net> on behalf of Patrick Reinhart <patrick at reini.net>
Sent: Wednesday, December 21, 2016 3:08 PM
To: Roger Riggs
Cc: core-libs-dev
Subject: Re: Request for Review and Sponsor needed: JDK-8167648:        java.io.PrintWriter should have PrintWriter((String|File), Charset)     constructors

Hi Roger,

I tried to put your suggested changes, into the following webrev:

http://cr.openjdk.java.net/~reinhapa/reviews/8167648/webrev.01


>>>> - 375:  Can this use the new private constructor that will handle psOut.
>>> Here I can not get hold on the encoding at this point or have I missed something here?
>> True, not easily, it is available as a String from OutputStreamWriter.getEncoding() but it would suffer from
>> having to lookup it by name again.
>
> Right, even the Charset is actually available within the StreamEncoder implementation but not provided to the outside world.
>
> Also the OutputStreamWriter is in wrapped in a BufferedWriter and would be needed to be extracted from there again in the first place.

Here I left the invocation as it was beforeā€¦

-Patrick



More information about the core-libs-dev mailing list