From fbe736c9bbd65b261c37b80a02927a83732c022a Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Wed, 2 Dec 2015 10:49:35 -0500 Subject: [PATCH] Cleaner type-inference assistance --- .../org/elasticsearch/cloud/gce/GceComputeServiceImpl.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/plugins/discovery-gce/src/main/java/org/elasticsearch/cloud/gce/GceComputeServiceImpl.java b/plugins/discovery-gce/src/main/java/org/elasticsearch/cloud/gce/GceComputeServiceImpl.java index 0171a7fe539..943b1cd0eae 100644 --- a/plugins/discovery-gce/src/main/java/org/elasticsearch/cloud/gce/GceComputeServiceImpl.java +++ b/plugins/discovery-gce/src/main/java/org/elasticsearch/cloud/gce/GceComputeServiceImpl.java @@ -80,14 +80,12 @@ public class GceComputeServiceImpl extends AbstractLifecycleComponent items = instanceList.isEmpty() ? Collections.emptyList() : instanceList.getItems(); - return items; + return instanceList.isEmpty() ? Collections.emptyList() : instanceList.getItems(); } catch (PrivilegedActionException e) { logger.warn("Problem fetching instance list for zone {}", zoneId); logger.debug("Full exception:", e); // assist type inference - List items = Collections.emptyList(); - return items; + return Collections.emptyList(); } }).reduce(new ArrayList<>(), (a, b) -> { a.addAll(b);