Skip to content

Commit

Permalink
Trim trailing whitespace in resourcenames
Browse files Browse the repository at this point in the history
If not trimmed, the trailing whitespaces will find their way
to the jobs config.xml, causing confusion.

Trailing whitespaces in resourcenames are caused also by the
autocompletion script, that suggests resourcenames.

JIRA Issue: https://issues.jenkins-ci.org/browse/JENKINS-47235
  • Loading branch information
Aga303 committed Oct 10, 2017
1 parent 3a9e649 commit 300d4b1
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -43,7 +43,11 @@ public RequiredResourcesProperty(String resourceNames,
String resourceNamesVar, String resourceNumber,
String labelName, @CheckForNull SecureGroovyScript resourceMatchScript) {
super();
this.resourceNames = resourceNames;
if (resourceNames != null) {
this.resourceNames = resourceNames.trim();
} else {
this.resourceNames = null;
}
this.resourceNamesVar = resourceNamesVar;
this.resourceNumber = resourceNumber;
if (resourceMatchScript != null) {
Expand Down

0 comments on commit 300d4b1

Please sign in to comment.