Closed TheSail28 closed 9 months ago
How hard is it to reproduce this? So far I haven't been able to. Does it reproduce with -Xint
?
We were able to reproduce this issue with a bytecode file, can you try to see if you can reproduce it? test.zip
The new test case uses IdentityHashMap, which uses System.identityHashCode(). This API doesn't provide any guarantees about the hash code value, which is free to be different from run to run, resulting in a different order.
Affected versions
We found a test case with execution problems. To facilitate analysis, we simplified the test case and the simplified class file can ben found at attachment.
Java -version output
Reproduce
Expected Result
Actual Result
Problem summary
IdentityHashMap
saves results in an unstable order. It is unordered likeHashMap
, but the output ofHashMap
is stable. If the output ordering is unstable, it can lead to errors in the execution logic in corner code scenarios.Attachment