RFR: 4750574: (se spec) Selector spec should clarify calculation of select return value

Daniel Fuchs daniel.fuchs at oracle.com
Wed Feb 2 19:18:02 UTC 2022


No problem with that Brian.

Thanks!

best regards,

-- daniel

On 02/02/2022 18:46, Brian Burkhalter wrote:
> On Wed, 26 Jan 2022 10:18:31 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:
> 
>>> Improve the description of the return value of each of the `Selector.select()` methods which do not accept an action parameter.
>>
>> Ah, yes - I have been bitten by this before. I wonder if it would deserve an `@apiNote` to say that the number returned doesn't always reflect the number of keys present in the selected-key set, and that a caller may consider clearing the selected-key set before calling these methods if they want to ensure that the number returned is equal to the size of the selected-key set.
> 
> @dfuch Regarding the API note, maybe add an example snippet instead under a separate issue to be created?
> 
> -------------
> 
> PR: https://git.openjdk.java.net/jdk/pull/7220



More information about the nio-dev mailing list