Skip to content

ConcurrentReferenceHashMap misses dedicated computeIfAbsent, computeIfPresent, compute, merge implementations #35794

@jhoeller

Description

@jhoeller

In the course of #35788, it turns out that ConcurrentReferenceHashMap does not provide dedicated implementations for the callback-based methods in ConcurrentMap yet: computeIfAbsent, computeIfPresent, compute, merge. This is very likely the reason for the race condition observed in #35788 where the calling code relies on uniqueness of the computed value from a computeIfAbsent call.

Since such dedicated implementations of the callback-based methods may also improve concurrent correctness for other scenarios and are necessary for consistent null support in ConcurrentReferenceHashMap, this qualifies as a bug to be fixed in the 6.2.x line still.

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions