RFR: 8251989: Hex formatting and parsing utility [v4]
Chris Hegarty
chegar at openjdk.java.net
Fri Oct 16 13:13:19 UTC 2020
On Fri, 16 Oct 2020 11:46:47 GMT, Chris Hegarty <chegar at openjdk.org> wrote:
>> Please review the corresponding CSR:
>> https://bugs.openjdk.java.net/browse/JDK-8251991
>
> Hi Roger,
>
> This looks very good.
>
> I have a few minor comments:
>
> 1. Add an explicit type parameter <A extends Appendable> to toHexDigits
> 2. Some clean opportunities to reduce line lengths in the test.
>
> I went ahead and created a PR for these, I hope that it ok. Please take a look https://github.com/RogerRiggs/jdk/pull/1
> .
Maybe I'm being too pedantic, but is the use of the term _copy_ for the withers overly prescriptive, and possibly
limiting an implementation? For example, for `withDelimiter` does _copy_ preclude such an implementation:
/**
* Returns a copy of this {@code HexFormat} with the delimiter.
* @param delimiter the delimiter, non-null, may be empty
* @return a copy of this {@code HexFormat} with the delimiter
*/
public HexFormat withDelimiter(String delimiter) {
+ if (delimiter.equals(this.delimiter))
+ return this;
return new HexFormat(delimiter, this.prefix, this.suffix, this.digits);
}
-------------
PR: https://git.openjdk.java.net/jdk/pull/482
More information about the core-libs-dev
mailing list