RFR: 8343125: Correct the documentation for TreeMap's getFloorEntry and getCeilingEntry

Chen Liang liach at openjdk.org
Wed Nov 13 17:42:38 UTC 2024


On Sat, 26 Oct 2024 14:06:37 GMT, Naman Nigam <duke at openjdk.org> wrote:

> As the documentation of getCeilingEntry currently reads, the inference is misleading as follows:
> 
> if no such entry exists, returns the entry for the least key greater than the specified key;
> if no such entry exists (i.e., the greatest key in the Tree is less than the specified key), returns {@code null}
> Have modified the first section to ensure that its clear that the value returned is upon existence of the key. Added a similar change for getFloorEntry.

Changes requested by liach (Reviewer).

src/java.base/share/classes/java/util/TreeMap.java line 514:

> 512:                 }
> 513:             } else {
> 514:                 return p;

Is this from a bad merge?

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

PR Review: https://git.openjdk.org/jdk/pull/21729#pullrequestreview-2434000248
PR Review Comment: https://git.openjdk.org/jdk/pull/21729#discussion_r1840903705


More information about the core-libs-dev mailing list