On Tue, 6 Oct 2026 19:25:33 GMT, Volkan Yazici <[email protected]> wrote:
> Fix port comparison in `java.net.URI::compareTo` and increase the test > coverage. > > `open/test/jdk/java/net/URI/Test.java` is improved in following aspects: > > - Old `gt(u, v)` was delegating to `lt(v, u)`. This left `u.compareTo(v) > 0` > path unchecked. > - `eqHashCompUni(u, v)` is introduced to verify all `equals()`, `hashCode()`, > `compareTo()` contracts. > - `eqHashCompBid(u, v)` is introduced to verify `eqHashCompUni(u, v)` > bidirectionally. > > --------- > - [X] I confirm that I make this contribution in accordance with the [OpenJDK > Interim AI Policy](https://openjdk.org/legal/ai). test/jdk/java/net/URI/Test.java line 1518: > 1516: eq(new URI("http://host/a%00bcd"), new > URI("http://host/a%00bcd")); > 1517: ne(new URI("http://host/a%00bcd"), new > URI("http://host/aZ00bcd")); > 1518: eq0(new URI("http://host/abc%e2def%C3ghi"), As far as I can see, in the newer proposed change, for these specific test URIs we are now doing `equals()` and `compareTo()` checks. Before this change it was just doing `equals()` check. Is the new proposed change intentional? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/33232#discussion_r4376122720
