Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ private static final Object putIfMatch( final NonBlockingHashMap topmap, final O
(expVal != MATCH_ANY || V == TOMBSTONE || V == null) &&
!(V==null && expVal == TOMBSTONE) && // Match on null/TOMBSTONE combo
(expVal == null || !expVal.equals(V)) ) // Expensive equals check at the last
return V; // Do not update!
return (V==null && expVal!=null) ? TOMBSTONE : V; // Do not update!

// Actually change the Value in the Key,Value pair
if( CAS_val(kvs, idx, V, putval ) ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public boolean equals( Object o ) {
// Test some basic stuff; add a few keys, remove a few keys
public void testBasic() {
assertTrue ( _nbhm.isEmpty() );
assertThat ( _nbhm.replace("k0","v0"), nullValue() );
assertThat ( _nbhm.putIfAbsent("k1","v1"), nullValue() );
checkSizes (1);
assertThat ( _nbhm.putIfAbsent("k2","v2"), nullValue() );
Expand Down