RFR: JDK-8260694: (fc) Add apiNote to FileChannel.transferFrom to better describe "no bytes available" case [v2]

Hamlin Li mli at openjdk.java.net
Wed Feb 3 05:29:44 UTC 2021


On Wed, 3 Feb 2021 02:07:10 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> Hi Alan, Thanks for reviewing.
>> I will add the sentence you suggested at the end of second paragraph, will use "end-of-stream".
>> Still think it's better to add an apiNote, although it's a little redundant, but it helps emphasize it, I saw several cases of misunderstanding of transferFrom. How do you think about it?
>
> Given the other verbiage I don't think that an `apiNote` is actually necessary.

Hi Brian, 
At the beginning, I don't think this patch is necessary, because I think if I read really carefully, then I can avoid the misuse.
But the truth is there are several misuse cases, not just in my company, several are in opensource projects. So, I think it's worth to emphasize it even if it's a little redudant.
How do you think about it?

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

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


More information about the nio-dev mailing list