RFR: 8251989: Hex formatting and parsing utility

Marcono1234 github.com+11685886+marcono1234 at openjdk.java.net
Mon Oct 12 23:08:21 UTC 2020


On Fri, 2 Oct 2020 20:19:11 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

>> src/java.base/share/classes/java/util/HexFormat.java line 290:
>> 
>>> 288:      * @return returns {@code true} if the hexadecimal digits will be uppercase,
>>> 289:      *          otherwise {@code false}
>>> 290:      */
>> 
>> Can someone choose their own `digits`? If not, how about "=="?
>
> I don't think it would be called HexFormat doing Hexadecimal conversions if it could be an arbitrary set of digits.
> The Arrays.equals implementation contains the == test so its implementers choice.

Though on the other hand `HexFormat.toString()` *does* use `==` (but `equals` does not; could possibly also improve
`hashCode` as well then). Might be good if that was consistent.

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

PR: https://git.openjdk.java.net/jdk/pull/482


More information about the core-libs-dev mailing list