On Sat, 5 Sep 2026 16:25:37 GMT, Alan Bateman <[email protected]> wrote:

>>> The head branch is benshuai5D:codex/JDK-8250677. Can you say if any part of 
>>> the changes in this PR were generated by codex?
>> 
>> No. AI was used only to help understand the surrounding code, identify 
>> relevant existing tests, and organize test results. 
>> The code changes in this PR were written and reviewed manually by me and my 
>> colleagues.
>
>> I was used only to help understand the surrounding code, identify relevant 
>> existing tests, and organize test results. The code changes in this PR were 
>> written and reviewed manually by me and my colleagues.
> 
> Thanks for confirming.
> 
> I'm not sure yet about doing anything about this. The proposed change looks 
> like it will break the contract for Object.hashCode in that two equals 
> Version objects might have different hash codes, e.g. "1" and "1+0".

@AlanBateman
> I'm not sure yet about doing anything about this. The proposed change looks 
> like it will break the contract for Object.hashCode in that two equals 
> Version objects might have different hash codes, e.g. "1" and "1+0".

That’s already broken in the current version for `"1‑a"` and `"1‑a+0"`:

var a = ModuleDescriptor.Version.parse("1-a");
var b = ModuleDescriptor.Version.parse("1-a+0");

IO.println(a.equals(b)); // prints "true"
IO.println(a.hashCode() == b.hashCode()); // prints "false"

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

PR Comment: https://git.openjdk.org/jdk/pull/32715#issuecomment-5553375719

Reply via email to