RFR: 8279598: Provide adapter from RandomGenerator to Random [v19]
liach
duke at openjdk.java.net
Fri Mar 18 22:16:30 UTC 2022
On Fri, 18 Mar 2022 19:11:45 GMT, jmehrens <duke at openjdk.java.net> wrote:
> > you are not expected to inspect a random object by its string.
> > ToString representations tend to show up in exception messages and logging. Seems like this adapter just won't adapt that call. Not a deal breaker.
>
> > Also the reverse order comparator in Collections doesn't have a toString override as well.
> > ToString wasn't added to that for compatibility reasons. Since this hasn't been released yet that doesn't apply here.
>
> https://bugs.openjdk.java.net/browse/JDK-6483125
How is this issue related at all? `equals` is [explicitly specified](https://github.com/openjdk/jdk/blob/8384ac4ed3eaaa18998ab88e1ca36358c212e699/src/java.base/share/classes/java/util/Comparator.java#L178) in comparator, while `toString` is not specified in `Random` at all. Also, my `Comparator` example talks about the `toString` method than the `equals` method. Please read the topics more carefully.
-------------
PR: https://git.openjdk.java.net/jdk/pull/7001
More information about the core-libs-dev
mailing list