RFR: 8290041: ModuleDescriptor.hashCode is inconsistent
Jaikiran Pai
jpai at openjdk.org
Sat Aug 6 08:16:47 UTC 2022
Can I please get a review of this change which proposes to fix https://bugs.openjdk.org/browse/JDK-8290041?
As noted by the reporter, the current implementation is buggy since the calculation can result in a different value of the hashcode depending on the order of iteration of the `Modifier`s. The commit in this PR changes that computation to produce consistent result irrespective of the order in which the `Modifier`s (enum) is iterated upon.
A new test has been added which reproduces the issue and verifies the fix.
-------------
Commit messages:
- 8290041: ModuleDescriptor.hashCode is inconsistent
Changes: https://git.openjdk.org/jdk/pull/9790/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=9790&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8290041
Stats: 47 lines in 2 files changed: 41 ins; 3 del; 3 mod
Patch: https://git.openjdk.org/jdk/pull/9790.diff
Fetch: git fetch https://git.openjdk.org/jdk pull/9790/head:pull/9790
PR: https://git.openjdk.org/jdk/pull/9790
More information about the core-libs-dev
mailing list