commit | a68be8199f023dd19210448e192d301e46efca60 | [log] [tgz] |
---|---|---|
author | Thomas Vachuska <tom@onlab.us> | Thu Nov 27 11:49:54 2014 -0800 |
committer | Gerrit Code Review <gerrit@onlab.us> | Fri Nov 28 21:18:06 2014 +0000 |
tree | 25d5c40c7be56695718b54ad40fccbc91d66ac37 | |
parent | 27d322d683417f212498fc930d83c2ef16463a94 [diff] |
Fixed a null pointer exception in SimpleMastershipStore; need to verify whether same exists in distributed one. Change-Id: I89ad124114586eb69bb9de3702085e8587cb315c
diff --git a/core/store/trivial/src/main/java/org/onlab/onos/store/trivial/impl/SimpleMastershipStore.java b/core/store/trivial/src/main/java/org/onlab/onos/store/trivial/impl/SimpleMastershipStore.java index dba5e92..18aefab 100644 --- a/core/store/trivial/src/main/java/org/onlab/onos/store/trivial/impl/SimpleMastershipStore.java +++ b/core/store/trivial/src/main/java/org/onlab/onos/store/trivial/impl/SimpleMastershipStore.java
@@ -23,6 +23,7 @@ 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 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()); } }