-
Couldn't load subscription status.
- Fork 38.8k
Closed
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)status: backportedAn issue that has been backported to maintenance branchesAn issue that has been backported to maintenance branchestype: bugA general bugA general bug
Milestone
Description
Christoph Strobl opened SPR-16584 and commented
ConcurrentReferenceHashMap needs to override the default implementation of computeIfAbsent in order to allow adding computed null values.
#from: ConcurrentMap.java
... implementation assumes that the
ConcurrentMapcannot containnullvalues andget()returningnullunambiguously means the key is absent. Implementations which supportnullvalues must override this default implementation.
The following currently fails:
ConcurrentReferenceHashMap<String, Object> map = new ConcurrentReferenceHashMap<>();
map.computeIfAbsent("key", key -> null);
assertThat(map.containsKey("key")).isTrue();Affects: 4.3.14, 5.0.4
Issue Links:
- LinkedCaseInsensitiveMap doesn't implement getOrDefault properly [SPR-13981] #18553 LinkedCaseInsensitiveMap doesn't implement getOrDefault properly
- LinkedCaseInsensitiveMap cannot access locale from subclass [SPR-15752] #20307 LinkedCaseInsensitiveMap cannot access locale from subclass
- ConcurrentReferenceHashMap does not enforce visibility of cached EntrySet [SPR-16994] #21532 ConcurrentReferenceHashMap does not enforce visibility of cached EntrySet
Referenced from: commits 8d8bb04, 356ef45
Backported to: 4.3.15
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)status: backportedAn issue that has been backported to maintenance branchesAn issue that has been backported to maintenance branchestype: bugA general bugA general bug