Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
JENKINS-19855
  • Loading branch information
jacobrobertson committed Oct 2, 2013
1 parent 553eb4d commit 52acc7d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/configurationslicing/UnorderedStringSlice.java
Expand Up @@ -31,7 +31,10 @@ public UnorderedStringSlice(UnorderedStringSlicerSpec<I> spec, List<String> conf
this(spec);
nameToValues = new HashMap<String, List<String>>();
for (int i = 0; i < configurationValues.size(); i++) {
String value = configurationValues.get(i).trim();
String value = configurationValues.get(i);
if (spec.isValueTrimmed()) {
value = value.trim();
}
String namesString = itemNames.get(i);
String[] namesSplit = namesString.split("\\n");
List<I> workDomain = spec.getWorkDomain();
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/configurationslicing/UnorderedStringSlicer.java
Expand Up @@ -36,6 +36,15 @@ public int getValueIndex(I item, String indexName) {
public boolean isBlankNeededForValues() {
return true;
}

/**
* Some cases we do not want to trim the value. For example, in Parameters this causes issues.
* This just requires the user to be more conscientious when configuring parameters.
* @return
*/
public boolean isValueTrimmed() {
return true;
}
}

private UnorderedStringSlicerSpec<I> spec;
Expand Down
Expand Up @@ -54,6 +54,12 @@ public String getName(Job item) {
public boolean isIndexUsed(int count) {
return true;
}

@Override
public boolean isValueTrimmed() {
return false;
}

@Override
public String getValueIndex(Job item, int index) {
List<ParameterItem> pitems = getParameterItems(item);
Expand Down

0 comments on commit 52acc7d

Please sign in to comment.