Skip to content

Commit

Permalink
JENKINS-10982 trim labels
Browse files Browse the repository at this point in the history
  • Loading branch information
imod committed Sep 14, 2011
1 parent a986785 commit cc111ac
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
Expand Up @@ -34,7 +34,9 @@ public LabelParameterValue(String name) {
@DataBoundConstructor
public LabelParameterValue(String name, String label) {
super(name);
this.label = label;
if(label != null){
this.label = label.trim();
}
}

/**
Expand All @@ -43,7 +45,9 @@ public LabelParameterValue(String name, String label) {
*/
public LabelParameterValue(String name, String description, String label) {
super(name, description);
this.label = label;
if(label != null){
this.label = label.trim();
}
}

@Override
Expand Down Expand Up @@ -77,7 +81,9 @@ public String getLabel() {
* the label to set
*/
public void setLabel(String label) {
this.label = label;
if(label != null){
this.label = label.trim();
}
}

/**
Expand Down
Expand Up @@ -35,12 +35,12 @@ public class NodeParameterValue extends LabelParameterValue {
public NodeParameterValue(String name, List<String> labels) {
super(name);
if (labels != null && !labels.isEmpty()) {
this.setLabel(labels.get(0));
this.setLabel(labels.get(0).trim());
if (labels.size() > 1) {
final List<String> subList = labels.subList(1, labels.size());
nextLabels = new ArrayList<String>();
for (String l : subList) {
nextLabels.add(l);
nextLabels.add(l.trim());
}
}
} else {
Expand Down

0 comments on commit cc111ac

Please sign in to comment.