Skip to content

Commit

Permalink
Array utils recommendation, and changing job lookup/compare to be bas…
Browse files Browse the repository at this point in the history
…ed on name, not displayname, as this fails.
  • Loading branch information
Darren Ball committed Feb 23, 2016
1 parent 1e2f8a4 commit 395f1f6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@

import net.sf.json.JSONObject;

import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.StringUtils;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.QueryParameter;
import org.kohsuke.stapler.StaplerRequest;
Expand Down Expand Up @@ -78,7 +80,7 @@ public ThrottleJobProperty(Integer maxConcurrentPerNode,
this.paramsToUseForLimit = paramsToUseForLimit;
if ((this.paramsToUseForLimit != null)) {
if ((this.paramsToUseForLimit.length() > 0)) {
this.paramsToCompare = Arrays.asList(this.paramsToUseForLimit.split(","));
this.paramsToCompare = Arrays.asList(ArrayUtils.nullToEmpty(StringUtils.split(this.paramsToUseForLimit)));
}
else {
this.paramsToCompare = new ArrayList<String>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ private boolean isAnotherBuildWithSameParametersRunningOnNode(Node node, Queue.I
if (exec.getCurrentExecutable() != null &&
exec.getCurrentExecutable().getParent() != null &&
exec.getCurrentExecutable().getParent().getOwnerTask() != null &&
exec.getCurrentExecutable().getParent().getOwnerTask().getName().equals(item.task.getDisplayName())) {
exec.getCurrentExecutable().getParent().getOwnerTask().getName().equals(item.task.getName())) {
List<ParameterValue> executingUnitParams = getParametersFromWorkUnit(exec.getCurrentWorkUnit());
executingUnitParams = doFilterParams(paramsToCompare, executingUnitParams);

Expand Down

0 comments on commit 395f1f6

Please sign in to comment.