Skip to content

ExpireMap Repeated put will be wrong #2

@Acvrock

Description

@Acvrock

v_NewData.setValue(i_Value);

class ExpireMapTest {
    public static void main(String[] args) throws InterruptedException {
        ExpireMap<String, String> map = new ExpireMap<>();
        ExpireMap.Expire<String, String> one = map.put("1", "one", 5);
        Thread.sleep(6000);
        map.put("1", "two", 5);
        System.out.println(map.get("1"));
    }
}

Expected: two
Actual: null

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions