Sonar fixes
Rule: Use isEmpty() to check whether the collection is empty or not.
Change-Id: Ib5ab56b2263623b297db56c5cac2c2ee80e12725
diff --git a/incubator/store/src/main/java/org/onosproject/incubator/store/tunnel/impl/DistributedTunnelStore.java b/incubator/store/src/main/java/org/onosproject/incubator/store/tunnel/impl/DistributedTunnelStore.java
index 31452ac..0907643 100644
--- a/incubator/store/src/main/java/org/onosproject/incubator/store/tunnel/impl/DistributedTunnelStore.java
+++ b/incubator/store/src/main/java/org/onosproject/incubator/store/tunnel/impl/DistributedTunnelStore.java
@@ -307,7 +307,7 @@
orderRelationship.put(appId, orderSet);
TunnelKey key = TunnelKey.tunnelKey(src, dst);
Set<TunnelId> idSet = srcAndDstKeyMap.get(key);
- if (idSet == null || idSet.size() == 0) {
+ if (idSet == null || idSet.isEmpty()) {
return Collections.emptySet();
}
Collection<Tunnel> tunnelSet = new HashSet<Tunnel>();
@@ -337,7 +337,7 @@
orderRelationship.put(appId, orderSet);
TunnelKey key = TunnelKey.tunnelKey(src, dst);
Set<TunnelId> idSet = srcAndDstKeyMap.get(key);
- if (idSet == null || idSet.size() == 0) {
+ if (idSet == null || idSet.isEmpty()) {
return Collections.emptySet();
}
Collection<Tunnel> tunnelSet = new HashSet<Tunnel>();
@@ -364,7 +364,7 @@
boolean isExist = orderSet.contains(order);
Set<TunnelId> idSet = tunnelNameAsKeyMap.get(tunnelName);
- if (idSet == null || idSet.size() == 0) {
+ if (idSet == null || idSet.isEmpty()) {
return Collections.emptySet();
}
Collection<Tunnel> tunnelSet = new HashSet<Tunnel>();
@@ -447,7 +447,7 @@
for (TunnelId id : tunnelIds) {
result.add(tunnelIdAsKeyStore.get(id));
}
- return result.size() == 0 ? Collections.emptySet() : ImmutableSet
+ return result.isEmpty() ? Collections.emptySet() : ImmutableSet
.copyOf(result);
}
@@ -462,7 +462,7 @@
for (TunnelId id : tunnelIds) {
result.add(tunnelIdAsKeyStore.get(id));
}
- return result.size() == 0 ? Collections.emptySet() : ImmutableSet
+ return result.isEmpty() ? Collections.emptySet() : ImmutableSet
.copyOf(result);
}