[jdk9] RFR: 8163517: Various cleanup in java.io code

Ivan Gerasimov ivan.gerasimov at oracle.com
Tue Aug 16 17:20:01 UTC 2016


Thank you Aleksey for your careful review!


On 16.08.2016 16:08, Aleksey Shipilev wrote:
> On 08/16/2016 03:53 PM, Ivan Gerasimov wrote:
>> BUGURL: https://bugs.openjdk.java.net/browse/JDK-8163517
>> WEBREV: http://cr.openjdk.java.net/~igerasim/8163517/00/webrev/
> Both ObjectInputStream and ObjectOutputStream can use auto-unboxing in
> these blocks?
>
> 1271         if (result.booleanValue()) {
> 1272             return;
> 1273         }

Yes. I'll also invert the logic, as it reads better.

> ObjectStreamClass:
>
> I wonder if the entire getPackageName is replaceable with
> Class.getPackageName()? If so, ditch the method completely and use
> Class.getPackageName everywhere. This may complicate backporting to JDK
> 8 though.

Unfortunately, Class.getPackageName() cannot handle arrays, so I'll 
leave it as is.

> OutputStreamWriter:
>
> New code in append(CharSequence,int,int) unnecessarily calls toString on
> CharBuffers which are handled specially downstream in append(CharSequence).

Good catch, thanks!
I'll replace the call to write(String) with append(CharSequence).
This will make the code even shorter.

Here is the updated webrev:
http://cr.openjdk.java.net/~igerasim/8163517/01/webrev/


With kind regards,
Ivan.



More information about the core-libs-dev mailing list