Move empty argument removal at the end

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1736026 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/Expander.java b/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/Expander.java
index b20284d..ec9f699 100644
--- a/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/Expander.java
+++ b/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/Expander.java
@@ -1091,7 +1091,6 @@
                 val = asCollection(val).stream()
                         .map(String::valueOf)
                         .flatMap(s -> Arrays.stream(s.split(_flags)))
-                        .filter(s -> !s.isEmpty())
                         .collect(Collectors.toList());
             }
 
@@ -1156,6 +1155,13 @@
                 }
             }
 
+            // Empty argument removal
+            if (val instanceof Collection) {
+                val = asCollection(val).stream()
+                        .filter(o -> !(o instanceof CharSequence) || ((CharSequence) o).length() > 0)
+                        .collect(Collectors.toList());
+            }
+
             if (inQuote) {
                 val = mapToList.apply(val);
                 if (val instanceof Collection) {