From 856444d6fe98dd84a7363c3a6cb64c614e3b1fa7 Mon Sep 17 00:00:00 2001 From: kohsuke Date: Tue, 11 Sep 2007 16:14:10 +0000 Subject: [PATCH] avoid using ',' and '=' in a path name since various tools are often buggy in handling them. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@4695 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/main/java/hudson/matrix/Combination.java | 15 ++++++++++++--- .../java/hudson/matrix/MatrixConfiguration.java | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/hudson/matrix/Combination.java b/core/src/main/java/hudson/matrix/Combination.java index 13bcc5a12d..e369063dd2 100644 --- a/core/src/main/java/hudson/matrix/Combination.java +++ b/core/src/main/java/hudson/matrix/Combination.java @@ -70,17 +70,26 @@ public final class Combination extends TreeMap implements Compara /** * Converts to the ID string representation: * axisName=value,axisName=value,... + * + * @param sep1 + * The separator between multiple axes. + * @param sep2 + * The separator between axis name and value. */ - public String toString() { + public String toString(char sep1, char sep2) { StringBuilder buf = new StringBuilder(); for (Map.Entry e : entrySet()) { - if(buf.length()>0) buf.append(','); - buf.append(e.getKey()).append('=').append(e.getValue()); + if(buf.length()>0) buf.append(sep1); + buf.append(e.getKey()).append(sep2).append(e.getValue()); } if(buf.length()==0) buf.append("default"); // special case to avoid 0-length name. return buf.toString(); } + public String toString() { + return toString(',','='); + } + /** * Reverse operation of {@link #toString()}. */ diff --git a/core/src/main/java/hudson/matrix/MatrixConfiguration.java b/core/src/main/java/hudson/matrix/MatrixConfiguration.java index a621c9dde6..58d20d212b 100644 --- a/core/src/main/java/hudson/matrix/MatrixConfiguration.java +++ b/core/src/main/java/hudson/matrix/MatrixConfiguration.java @@ -85,7 +85,7 @@ public class MatrixConfiguration extends Project public FilePath getWorkspace() { Node node = getLastBuiltOn(); if(node==null) node = Hudson.getInstance(); - return node.getWorkspaceFor(getParent()).child(getName()); + return node.getWorkspaceFor(getParent()).child(getCombination().toString('/','/')); } @Override