Committed by
Gerrit Code Review
Always use ImmutableList.of() when returning an empty list
Change-Id: I54abee905abacea32f5c49ead2e98a2caf116fbe
Showing
1 changed file
with
2 additions
and
3 deletions
... | @@ -46,7 +46,6 @@ import org.slf4j.LoggerFactory; | ... | @@ -46,7 +46,6 @@ import org.slf4j.LoggerFactory; |
46 | 46 | ||
47 | import java.util.Arrays; | 47 | import java.util.Arrays; |
48 | import java.util.Collection; | 48 | import java.util.Collection; |
49 | -import java.util.Collections; | ||
50 | import java.util.Iterator; | 49 | import java.util.Iterator; |
51 | import java.util.LinkedHashSet; | 50 | import java.util.LinkedHashSet; |
52 | import java.util.List; | 51 | import java.util.List; |
... | @@ -367,7 +366,7 @@ public class ConsistentResourceStore extends AbstractStore<ResourceEvent, Resour | ... | @@ -367,7 +366,7 @@ public class ConsistentResourceStore extends AbstractStore<ResourceEvent, Resour |
367 | 366 | ||
368 | Versioned<Set<Resource>> children = childMap.get((Resource.Discrete) parent); | 367 | Versioned<Set<Resource>> children = childMap.get((Resource.Discrete) parent); |
369 | if (children == null) { | 368 | if (children == null) { |
370 | - return Collections.emptyList(); | 369 | + return ImmutableList.of(); |
371 | } | 370 | } |
372 | 371 | ||
373 | return children.value(); | 372 | return children.value(); |
... | @@ -381,7 +380,7 @@ public class ConsistentResourceStore extends AbstractStore<ResourceEvent, Resour | ... | @@ -381,7 +380,7 @@ public class ConsistentResourceStore extends AbstractStore<ResourceEvent, Resour |
381 | 380 | ||
382 | Versioned<Set<Resource>> children = childMap.get((Resource.Discrete) parent); | 381 | Versioned<Set<Resource>> children = childMap.get((Resource.Discrete) parent); |
383 | if (children == null) { | 382 | if (children == null) { |
384 | - return Collections.emptyList(); | 383 | + return ImmutableList.of(); |
385 | } | 384 | } |
386 | 385 | ||
387 | Stream<Resource.Discrete> discrete = children.value().stream() | 386 | Stream<Resource.Discrete> discrete = children.value().stream() | ... | ... |
-
Please register or login to post a comment