Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9c695227 authored by Vincent Breitmoser's avatar Vincent Breitmoser
Browse files

Storage may still be written to and read from concurrently

parent 75c4b9ff
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
package com.fsck.k9.preferences;


import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

import timber.log.Timber;

public class Storage {
    private HashMap<String, String> storage = new HashMap<>();
    private volatile Map<String, String> storage = Collections.emptyMap();

    public Storage() { }

@@ -66,7 +67,6 @@ public class Storage {
    }

    public void replaceAll(Map<String, String> workingStorage) {
        storage.clear();
        storage.putAll(workingStorage);
        storage = new HashMap<>(workingStorage);
    }
}