Skip to content

Commit e9e4200

Browse files
namannigamliach
authored andcommitted
8343125: Correct the documentation for TreeMap's getFloorEntry and getCeilingEntry
Reviewed-by: liach, acobbs
1 parent c59adf6 commit e9e4200

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/java.base/share/classes/java/util/TreeMap.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -420,10 +420,9 @@ else if (cmp > 0)
420420
}
421421

422422
/**
423-
* Gets the entry corresponding to the specified key; if no such entry
424-
* exists, returns the entry for the least key greater than the specified
425-
* key; if no such entry exists (i.e., the greatest key in the Tree is less
426-
* than the specified key), returns {@code null}.
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,
425+
* or the tree is empty), returns {@code null}.
427426
*/
428427
final Entry<K,V> getCeilingEntry(K key) {
429428
Entry<K,V> p = root;
@@ -453,10 +452,9 @@ final Entry<K,V> getCeilingEntry(K key) {
453452
}
454453

455454
/**
456-
* Gets the entry corresponding to the specified key; if no such entry
457-
* exists, returns the entry for the greatest key less than the specified
458-
* key; if no such entry exists (i.e., the least key in the Tree is greater
459-
* than the specified key), returns {@code null}.
455+
* Returns the entry for the greatest key less than or equal to the specified key;
456+
* if no such entry exists (i.e. the specified key is less than any key in the tree,
457+
* or the tree is empty), returns {@code null}.
460458
*/
461459
final Entry<K,V> getFloorEntry(K key) {
462460
Entry<K,V> p = root;

0 commit comments

Comments
 (0)