RFR: 8371418: Methods in AdapterHandlerLibrary use HashtableBase iterate method incorrectly
Ashutosh Mehra
asmehra at openjdk.org
Fri Nov 7 14:44:32 UTC 2025
The closure passed to `HashTable::iterate` in `AdapterHandlerLibrary::contains` and `AdapterHandlerLibrary::print_handler_on` is returning incorrect value. If the search is successful, it should return false to terminate the iteration, but it is returning true. This patch fixes the return value of these closures.
In addition, it also updates `CompactHashTable::iterate` to be the same as `HashTAble::iterate` by using return value of the closure to determine if the iteration should continue or abort.
It also adds `CompactHashTable::iterate_all` to iterate all the values unconditionally. Users of `CompactHashTable::iterate` are updated to use `CompactHashTable::iterate_all`.
-------------
Commit messages:
- 8371418: Methods in AdapterHandlerLibrary use HashtableBase iterate method incorrectly
Changes: https://git.openjdk.org/jdk/pull/28197/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28197&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8371418
Stats: 72 lines in 7 files changed: 35 ins; 10 del; 27 mod
Patch: https://git.openjdk.org/jdk/pull/28197.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/28197/head:pull/28197
PR: https://git.openjdk.org/jdk/pull/28197
More information about the hotspot-dev
mailing list