RFR: 8311162: Simplify and modernize equals and hashCode for java.net

Daniel Fuchs dfuchs at openjdk.org
Fri Jun 30 09:36:53 UTC 2023


On Fri, 30 Jun 2023 09:17:42 GMT, Pavel Rappo <prappo at openjdk.org> wrote:

> ```return Set.of(that.addrs).containsAll(Set.of(this.addrs));```

Since it's been checked before that the arrays have the same length it could even be:

    return Set.of(that.addrs).equals(Set.of(this.addrs));


but your proposed changes are already good enough.

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

PR Comment: https://git.openjdk.org/jdk/pull/14726#issuecomment-1614397323


More information about the net-dev mailing list