RFR: 8312089: Simplify and modernize equals, hashCode, and compareTo in java.nio and implementation code [v2]

Alan Bateman alanb at openjdk.org
Fri Jul 14 15:55:16 UTC 2023


On Fri, 14 Jul 2023 14:42:47 GMT, Pavel Rappo <prappo at openjdk.org> wrote:

> > * java.nio.charset.Charset#compareTo seems **inconsistent** with equals. If so, I cannot see where that inconsistency is specified.
> 
> @AlanBateman, what do you think of that? For convenience, let me paste here relevant source parts:

There are a few classes where the natural ordering is not consistent with equals. For another PR, this could be documented as it is done in other classes. n practical terms then it's probably not a concern because the canonical name will usually be a charset name registered with IANA.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/14886#issuecomment-1636053904


More information about the nio-dev mailing list