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

Chris Hegarty chegar at openjdk.java.net
Fri Oct 16 14:27:15 UTC 2020


On Fri, 16 Oct 2020 14:00:38 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

> Since the instances are immutable, it seemed useful to emphasize that only the instance returned has the requested
> change. Discarding the return value was incorrect programming. The original instance is not modified.

Understood, and agree.

> The "copy" phrasing was used throughout java.time.

Ok, but that does not mean that it is appropriate or correct.

> Since reference equality is specifically dis-allowed for value-based objects, there is no way to discover a difference
> between a copy and the original with the same parameters.

A _copy_ implies that something identical or similar is _created_ or _made_, but that does not *always* have to be the
case here, but the spec *requires* it. Why not just; "Returns a formatter similar to this formatter with the given
delimiter". OR something along those lines.

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

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


More information about the core-libs-dev mailing list