RFR: 8344892: beans/finder/MethodFinder.findMethod incorrectly returns null

Chen Liang liach at openjdk.org
Fri Feb 28 19:22:52 UTC 2025


On Fri, 28 Feb 2025 18:59:52 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

> *the unsynchronised access to the data structures doesn't gain anything*

The existing optimistic fast path can avoid the lock, with the assumption that garbage collection of the cache values are rare. It is fine. However these plain access do require that the cached values to be thread safe and support safe publication.

Given the huge complexity of this cache and confusions around it, I recommend checking out `jdk.internal.util.ReferencedKeyMap`, which is already exported to `java.desktop` module.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/23845#issuecomment-2691383449


More information about the client-libs-dev mailing list