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;