Committed by
Gerrit Code Review
Make return value null-safe
Change-Id: Ia56fac56ef8c036328ef6804386c0f86bd157f8f
Showing
1 changed file
with
2 additions
and
2 deletions
... | @@ -217,8 +217,8 @@ public class GossipIntentStore | ... | @@ -217,8 +217,8 @@ public class GossipIntentStore |
217 | .map(ControllerNode::id) | 217 | .map(ControllerNode::id) |
218 | .filter(node -> !Objects.equals(node, me)) | 218 | .filter(node -> !Objects.equals(node, me)) |
219 | .collect(Collectors.toList()); | 219 | .collect(Collectors.toList()); |
220 | - if (nodes.size() == 0) { | 220 | + if (nodes.isEmpty()) { |
221 | - return null; | 221 | + return ImmutableList.of(); |
222 | } | 222 | } |
223 | return ImmutableList.of(nodes.get(RandomUtils.nextInt(nodes.size()))); | 223 | return ImmutableList.of(nodes.get(RandomUtils.nextInt(nodes.size()))); |
224 | } | 224 | } | ... | ... |
-
Please register or login to post a comment