ewrite the last section of the overwiew fo SortedMap documentation and a link fo NavigableMap

Chen Liang chen.l.liang at oracle.com
Sat Nov 2 17:08:40 UTC 2024


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-retn at openjdk.org> on behalf of Remi Forax <forax at univ-mlv.fr>
Sent: Saturday, November 2, 2024 8:13 AM
To: core-libs-dev <core-libs-dev at openjdk.java.net>
Cc: Stuart Marks <smarks at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/core-libs-dev/attachments/20241102/2f772627/attachment.htm>


More information about the core-libs-dev mailing list