RFR: 8251989: Hex formatting and parsing utility [v2]

Marcono1234 github.com+11685886+marcono1234 at openjdk.java.net
Tue Oct 13 22:09:11 UTC 2020


On Tue, 13 Oct 2020 16:24:32 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

>> src/java.base/share/classes/java/util/HexFormat.java line 1015:
>> 
>>> 1013:      */
>>> 1014:     @Override
>>> 1015:     public String toString() {
>> 
>> Might be useful to also include the class name?
>
> The caller may need to provide their own context for the output.

I was thinking of the case where the caller invokes it by accident (due to incorrect code, e.g. `"..." + hexFormat`
instead of `"..." + hexFormat.toHexDigits(...)`) and then wonders what "uppercase: true, ..." means or where it even
comes from. For example `java.util.Optional` also includes "Optional[...]".

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

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


More information about the core-libs-dev mailing list