felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r1736026 - /felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/Expander.java
Date Mon, 21 Mar 2016 16:56:25 GMT
Author: gnodet
Date: Mon Mar 21 16:56:24 2016
New Revision: 1736026

URL: http://svn.apache.org/viewvc?rev=1736026&view=rev
Log:
Move empty argument removal at the end

Modified:
    felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/Expander.java

Modified: felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/Expander.java
URL: http://svn.apache.org/viewvc/felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/Expander.java?rev=1736026&r1=1736025&r2=1736026&view=diff
==============================================================================
--- felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/Expander.java (original)
+++ felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/Expander.java Mon
Mar 21 16:56:24 2016
@@ -1091,7 +1091,6 @@ public class Expander extends BaseTokeni
                 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 @@ public class Expander extends BaseTokeni
                 }
             }
 
+            // 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) {



Mime
View raw message