Skip to content
Permalink
Browse files
JENKINS-50963 - UpdatePolicies and ChecksumPolicy rest to default on …
…edit. On doFill action for those field the default value is no longer forced. (#34)
  • Loading branch information
tJouve authored and jgangemi committed May 18, 2018
1 parent 8851b74 commit abe4c4fa280ca27c6e8cb34d3e161e234774a09f
Showing with 9 additions and 12 deletions.
  1. +9 −12 src/main/java/org/jvnet/hudson/plugins/repositoryconnector/ArtifactResolver.java
@@ -316,19 +316,19 @@ public boolean configure(StaplerRequest req, JSONObject formData) throws Descrip
}

public ListBoxModel doFillReleaseChecksumPolicyItems() {
return createSelectItems(CHECKSUM_POLICIES, defaultReleaseChecksumPolicy);
return createSelectItems(CHECKSUM_POLICIES);
}

public ListBoxModel doFillReleaseUpdatePolicyItems() {
return createSelectItems(UPDATE_POLICIES, defaultReleaseUpdatePolicy);
return createSelectItems(UPDATE_POLICIES);
}

public ListBoxModel doFillSnapshotChecksumPolicyItems() {
return createSelectItems(CHECKSUM_POLICIES, defaultSnapshotChecksumPolicy);
return createSelectItems(CHECKSUM_POLICIES);
}

public ListBoxModel doFillSnapshotUpdatePolicyItems() {
return createSelectItems(UPDATE_POLICIES, defaultSnapshotUpdatePolicy);
return createSelectItems(UPDATE_POLICIES);
}

@Override
@@ -341,15 +341,12 @@ public boolean isApplicable(Class<? extends AbstractProject> aClass) {
return true;
}

private ListBoxModel createSelectItems(String[] choices, String dflt) {
private ListBoxModel createSelectItems(String[] choices) {
ListBoxModel items = new ListBoxModel();

for (int i = 0; i < choices.length; i++) {
items.add(choices[i]);

if (dflt.equals(choices[i])) {
items.get(i).selected = true;
}

for (String choice : choices) {
items.add(choice);

}

return items;

0 comments on commit abe4c4f

Please sign in to comment.