On Fri, 18 Mar 2022 19:11:45 GMT, jmehrens <d...@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