RFR: 8377712: ConstantPool of WeakReferenceKey is not deterministic in CDS archive
Ioi Lam
iklam at openjdk.org
Thu Feb 12 05:54:17 UTC 2026
On Thu, 12 Feb 2026 05:13:03 GMT, Chen Liang <liach at openjdk.org> wrote:
> Then I think we should probably patch GenerateJLIClassesHelper to call `MethodType.methodType(void.class)` (or any other method type) twice somewhere. The 2nd call ensures there will be a method type lookup, which covers the missing code path that causes the problem.
The actions in WeakReferenceKey.equals() is many levels away from `MethodType.methodType()`. Doing this is fragile if the implementation changes at any of those levels. It's also "unnecessary code that has an unobvious side effect".
That's why I prefer to address the problem directly, as close to its source as possible.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/29678#issuecomment-3888819154
More information about the core-libs-dev
mailing list