Fixed a null pointer exception in SimpleMastershipStore; need to verify whether same exists in distributed one.

Change-Id: I89ad124114586eb69bb9de3702085e8587cb315c
This commit is contained in:
Thomas Vachuska 2014-11-27 11:49:54 -08:00 committed by Gerrit Code Review
parent 27d322d683
commit a68be8199f

View File

@ -23,6 +23,7 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.concurrent.atomic.AtomicInteger;
@ -173,7 +174,7 @@ public class SimpleMastershipStore
public Set<DeviceId> getDevices(NodeId nodeId) {
Set<DeviceId> ids = new HashSet<>();
for (Map.Entry<DeviceId, NodeId> d : masterMap.entrySet()) {
if (d.getValue().equals(nodeId)) {
if (Objects.equals(d.getValue(), nodeId)) {
ids.add(d.getKey());
}
}