Skip to content

AssertionError when replacing missing key #244

@fvlad

Description

@fvlad

Hi. I'm using jctools 2.1.2.
I found that when I try to replace a value in NBHM for a key that doesn't exit, I get AssertionError. Here is the sample test:

@Test
public void replaceTest() {
    final ConcurrentMap<String, String> map = new NonBlockingHashMap<>();

    assertNull(map.replace(UUID.randomUUID().toString(), UUID.randomUUID().toString()));
    assertFalse(map.replace(UUID.randomUUID().toString(), UUID.randomUUID().toString(), UUID.randomUUID().toString()));
}

The test works fine when I replace NBHM with ConcurrentHashMap.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions