JDK-8067661: transferTo proposal for Appendable

Alan Bateman Alan.Bateman at oracle.com
Tue Nov 14 11:45:06 UTC 2017


On 14/11/2017 07:51, Patrick Reinhart wrote:
> Hi Brian
>
> See latest changes here:
>
> http://cr.openjdk.java.net/~reinhapa/reviews/8067661/webrev.03
>
This version mostly looks quite good, a few comments:

- Readable "hence unspecified". In several other places, including 
InputStream.transferTo, we use "therefore unspecified" and it would be 
good to keep that consistent.

- Readable "Depending on which class implements the appendable ...". 
What would you think about replacing this sentence with: "If the 
destination is capacity bounded and has insufficient capacity to append 
all characters read from the source then an exception will be thrown 
after transferring zero or some bytes to the destination".

- CharBuffer. I don't think the first sentence in the @implSpec is 
needed, it's okay to start with "If the given Appendable ...". There's a 
typo in the second sentence "it's data if possible" -> "its data" (no 
"if possible" as it will use put unconditionally when the destination is 
a CharBuffer).

- CharBuffer. IOException is not possible when reading here, it's only 
writing.

- CharBuffer: NullPointerException is covered by the package 
description, the methods in this package do not specified NPE. It is not 
needed in the read method either.

- CharBuffer: The @param and @throws have a specific style in this 
package and probably best to keep that consistent if you can.

-Alan





More information about the core-libs-dev mailing list