RFR: 8343125: Correct the documentation for TreeMap's getFloorEntry and getCeilingEntry [v2]
Archie Cobbs
acobbs at openjdk.org
Thu Nov 14 03:53:46 UTC 2024
On Thu, 14 Nov 2024 03:19:01 GMT, Naman Nigam <duke at openjdk.org> wrote:
>> src/java.base/share/classes/java/util/TreeMap.java line 424:
>>
>>> 422: /**
>>> 423: * Returns the entry for the least key greater than or equal to the specified key;
>>> 424: * if no such entry exists (i.e. the specified key is greater than any key in the tree),
>>
>> I'd suggest changing "the specified key is greater than any key in the tree" → "the specified key is greater than any key in the tree, or the tree is empty"; same thing for `getFloorEntry()`.
>
> @archiecobbs Thank you for your suggestion. Yes, the tree being an empty case could be made explicit, though I was assuming it to be inferrable by the words 'any key' earlier. Updating with that as a change.
It's definitely inferrable (and the phrasing was from the original, so not your fault) but it's good to eliminate any ambiguity, however minimal, for a diverse public readership. Thanks.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21729#discussion_r1841523077
More information about the core-libs-dev
mailing list