Repository: ant-ivy
Updated Branches:
  refs/heads/master 68e0a9c71 -> 1d3567f30


IVY-1282 Add missing trim()

Project: http://git-wip-us.apache.org/repos/asf/ant-ivy/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant-ivy/commit/1d3567f3
Tree: http://git-wip-us.apache.org/repos/asf/ant-ivy/tree/1d3567f3
Diff: http://git-wip-us.apache.org/repos/asf/ant-ivy/diff/1d3567f3

Branch: refs/heads/master
Commit: 1d3567f3051682dd0ea8406a3f605cb5c42de27f
Parents: 68e0a9c
Author: Gintas Grigelionis <gin...@apache.org>
Authored: Fri Feb 2 19:08:53 2018 +0100
Committer: Gintas Grigelionis <gin...@apache.org>
Committed: Fri Feb 2 19:08:53 2018 +0100

----------------------------------------------------------------------
 .../ivy/plugins/parser/AbstractModuleDescriptorParser.java     | 2 +-
 .../ivy/plugins/parser/xml/XmlModuleDescriptorUpdater.java     | 2 +-
 src/java/org/apache/ivy/util/StringUtils.java                  | 6 +-----
 3 files changed, 3 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/1d3567f3/src/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParser.java
----------------------------------------------------------------------
diff --git 
a/src/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParser.java 
b/src/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParser.java
index 903e432..0005927 100644
--- a/src/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParser.java
+++ b/src/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParser.java
@@ -125,7 +125,7 @@ public abstract class AbstractModuleDescriptorParser 
implements ModuleDescriptor
                 return;
             }
 
-            String[] conf = confs.split(";");
+            String[] conf = confs.trim().split("\\s*;\\s*");
             parseDepsConfs(conf, dd, useDefaultMappingToGuessRightOperand, 
evaluateConditions);
         }
 

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/1d3567f3/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorUpdater.java
----------------------------------------------------------------------
diff --git 
a/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorUpdater.java 
b/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorUpdater.java
index a5ab593..bd8b180 100644
--- a/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorUpdater.java
+++ b/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorUpdater.java
@@ -850,7 +850,7 @@ public final class XmlModuleDescriptorUpdater {
         private String removeConfigurationsFromMapping(String mapping) {
             StringBuilder newMapping = new StringBuilder();
             String mappingSep = "";
-            for (String groups : mapping.split(";")) {
+            for (String groups : mapping.trim().split("\\s*;\\s*")) {
                 String[] ops = groups.split("->");
                 List<String> confsToWrite = new ArrayList<>();
                 for (String lh : splitToArray(ops[0])) {

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/1d3567f3/src/java/org/apache/ivy/util/StringUtils.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/util/StringUtils.java 
b/src/java/org/apache/ivy/util/StringUtils.java
index 099437c..64ce722 100644
--- a/src/java/org/apache/ivy/util/StringUtils.java
+++ b/src/java/org/apache/ivy/util/StringUtils.java
@@ -129,11 +129,7 @@ public final class StringUtils {
         if (list == null) {
             return null;
         }
-        String[] parts = list.split(",");
-        for (int i = 0; i < parts.length; i++) {
-            parts[i] = parts[i].trim();
-        }
-        return parts;
+        return list.trim().split("\\s*,\\s*");
     }
 
     /**

Reply via email to