Thomas Vachuska
Committed by Gerrit Code Review

Fixed a null pointer exception in SimpleMastershipStore; need to verify whether …

…same exists in distributed one.

Change-Id: I89ad124114586eb69bb9de3702085e8587cb315c
...@@ -23,6 +23,7 @@ import java.util.HashMap; ...@@ -23,6 +23,7 @@ import java.util.HashMap;
23 import java.util.HashSet; 23 import java.util.HashSet;
24 import java.util.List; 24 import java.util.List;
25 import java.util.Map; 25 import java.util.Map;
26 +import java.util.Objects;
26 import java.util.Set; 27 import java.util.Set;
27 import java.util.concurrent.atomic.AtomicInteger; 28 import java.util.concurrent.atomic.AtomicInteger;
28 29
...@@ -173,7 +174,7 @@ public class SimpleMastershipStore ...@@ -173,7 +174,7 @@ public class SimpleMastershipStore
173 public Set<DeviceId> getDevices(NodeId nodeId) { 174 public Set<DeviceId> getDevices(NodeId nodeId) {
174 Set<DeviceId> ids = new HashSet<>(); 175 Set<DeviceId> ids = new HashSet<>();
175 for (Map.Entry<DeviceId, NodeId> d : masterMap.entrySet()) { 176 for (Map.Entry<DeviceId, NodeId> d : masterMap.entrySet()) {
176 - if (d.getValue().equals(nodeId)) { 177 + if (Objects.equals(d.getValue(), nodeId)) {
177 ids.add(d.getKey()); 178 ids.add(d.getKey());
178 } 179 }
179 } 180 }
......