On Mon, 26 Oct 2026 10:13:41 GMT, Jaikiran Pai <[email protected]> wrote:
>> Volkan Yazici has updated the pull request incrementally with four
>> additional commits since the last revision:
>>
>> - Switch from `String` to `char` for the relation representation
>> - Remove unused `eq0()`
>> - Rename `eqHashCompBid()` to `eqHashCompBidi()`
>> - Remove `!=` relation
>
> test/jdk/java/net/URI/Test.java line 1500:
>
>> 1498: URI t = new URI("http://example.com/%5bsegment%5d");
>> 1499: eq(o, o);
>> 1500: lt(o, r);
>
> My preference would be to retain the `lt`, `gt`, `eq` method names because
> it's much more clearer to understand what these tests are doing at call
> sites, like here. In the implementations of `lt`, `gt`, `eq` etc... you could
> then just call the `eqHashCompBidi` method.
But wouldn't this imply a big misalignment between the method name and what it
actually does. For instance, you will call `eq(u, v)`, but it will check
`equals(u, v)`, `cmp(u, v) == 0`, `hash(u) == hash(v)`, `equals(v, u)`, and
`cmp(v, u) == 0`.
Correct me if I'm mistaken, but I presume your angle is trying to minimize the
touched line count. While I'm totally on board with that argument, in this
case, we do more than simply replacing `eq` with `eqHashCompBidi`:
- We remove the `new URI(...)` boilerplate
- We make it super clear on what we check. Contrast `eqHashCompBidi(u, v, '=')`
versus `eq(u, new URL(v))`.
@jaikiran, let me know if you still want to preserve `eq`, `lt`, `gt` methods
instead.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/33232#discussion_r4379267373