On Mon, 22 Jun 2026 01:28:35 GMT, Jaikiran Pai <[email protected]> wrote:
>> I've created https://bugs.openjdk.org/browse/JDK-8386963 to track this. > >> whereas here, in these wait(), notify() etc... APIs, which are closer to >> synchronization semantics, a IllegalMonitorStateException gets thrown for >> value objects. Is there a reason why we don't throw a IdentityException from >> these APIs too? > > I see that this same question had come up when the change was originally > introduced in valhalla > https://github.com/openjdk/valhalla/pull/1316/changes#r1887168065. I don't > know if that question led to some decision on intentionally choosing > `IllegalMonitorStateException`. Over several discussions when reviewing this PR, there wasn't any agreement to throw `IdentityException` instead of the current `IllegalMonitorStateException` from these APIs. So this is OK in its current form. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/31123#discussion_r3557947446
