I strongly agree.  The use of SortedMap should be no longer preferred, like 
that for java.util.Stack/Vector.  We should update the Javadoc to refer to 
NavigableMap as the main total-ordered version and refer to SortedMap as a 
legacy interface.  In fact, we should probably override all SortedMap methods 
in NavigableMap, so IDE navigations never direct users to SortedMap.

Regards,
Chen Liang
________________________________
From: core-libs-dev <core-libs-dev-r...@openjdk.org> on behalf of Remi Forax 
<fo...@univ-mlv.fr>
Sent: Saturday, November 2, 2024 8:13 AM
To: core-libs-dev <core-libs-...@openjdk.java.net>
Cc: Stuart Marks <sma...@openjdk.java.net>
Subject: ewrite the last section of the overwiew fo SortedMap documentation and 
a link fo NavigableMap

Hello,
I was discussing with a student, she was trying to use the SortedMap interface 
but had trouble with tailMap() no being a strictly higher view from a key.
The solution was to use NavigableMap instead of SortedMap because it provides 
more methods to get lower/higher subMap and entries from keys.

I think we can improve de documentation of SortedMap (the last section (Note:) 
of the overview) by rewriting it saying that NavigableMap provides a richer API
instead of the current documentation that propose to add 1 or '\0' to the 
subMap() which is a ugly hack.

regards,
Rémi

Reply via email to