From e9e4200a6aaacc11442f0298525e2531bf08240e Mon Sep 17 00:00:00 2001 From: Naman Nigam Date: Mon, 18 Nov 2024 18:30:24 +0000 Subject: [PATCH] 8343125: Correct the documentation for TreeMap's getFloorEntry and getCeilingEntry Reviewed-by: liach, acobbs --- src/java.base/share/classes/java/util/TreeMap.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/java.base/share/classes/java/util/TreeMap.java b/src/java.base/share/classes/java/util/TreeMap.java index 0e544573f01..79aec5c1456 100644 --- a/src/java.base/share/classes/java/util/TreeMap.java +++ b/src/java.base/share/classes/java/util/TreeMap.java @@ -420,10 +420,9 @@ public class TreeMap } /** - * Gets the entry corresponding to the specified key; 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}. + * Returns the entry for the least key greater than or equal to the specified key; + * if no such entry exists (i.e. the specified key is greater than any key in the tree, + * or the tree is empty), returns {@code null}. */ final Entry getCeilingEntry(K key) { Entry p = root; @@ -453,10 +452,9 @@ public class TreeMap } /** - * Gets the entry corresponding to the specified key; if no such entry - * exists, returns the entry for the greatest key less than the specified - * key; if no such entry exists (i.e., the least key in the Tree is greater - * than the specified key), returns {@code null}. + * Returns the entry for the greatest key less than or equal to the specified key; + * if no such entry exists (i.e. the specified key is less than any key in the tree, + * or the tree is empty), returns {@code null}. */ final Entry getFloorEntry(K key) { Entry p = root;