Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[JENKINS-14155] Automatically select the first option of tags listing…
… if default value is not defined
  • Loading branch information
Manuel Recena committed Dec 11, 2015
1 parent ae4ae64 commit 5012326
Showing 1 changed file with 10 additions and 6 deletions.
Expand Up @@ -141,13 +141,17 @@ public ParameterValue createValue(StaplerRequest req, JSONObject formData) {
return value;
}

@Override
public ParameterValue getDefaultParameterValue() {
if (StringUtils.isEmpty(this.defaultValue)) {
return null;
@Override
public ParameterValue getDefaultParameterValue() {
if (StringUtils.isEmpty(this.defaultValue)) {
List<String> tags = getTags(null);
if (tags.size() > 0) {
return new ListSubversionTagsParameterValue(getName(), getTagsDir(), tags.get(0));
}
return null;
}
return new ListSubversionTagsParameterValue(getName(), getTagsDir(), this.defaultValue);
}
return new ListSubversionTagsParameterValue(getName(), getTagsDir(), this.defaultValue);
}

@Override
public DescriptorImpl getDescriptor() {
Expand Down

0 comments on commit 5012326

Please sign in to comment.