Skip to content

Commit

Permalink
[JENKINS-48090] Naming
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenc committed Dec 4, 2017
1 parent 0fa2972 commit 68baf70
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/main/java/jenkins/branch/MultiBranchProject.java
Expand Up @@ -647,7 +647,7 @@ protected void computeChildren(final ChildObserver<P> observer, final TaskListen
}

private void scheduleBuild(BranchProjectFactory<P, R> factory, final P item, SCMRevision revision,
TaskListener listener, String name, Cause[] cause, Action... actions) {
TaskListener listener, String name, Cause[] causes, Action... actions) {
if (!isBuildable()) {
listener.getLogger().printf("Did not schedule build for branch: %s (%s is disabled)%n",
name, getDisplayName());
Expand All @@ -665,22 +665,22 @@ private void scheduleBuild(BranchProjectFactory<P, R> factory, final P item, SCM
if (causeCount == 0) {
// no existing causes, insert new one at start
_actions = new Action[actions.length + 1];
_actions[0] = new CauseAction(cause);
_actions[0] = new CauseAction(causes);
System.arraycopy(actions, 0, _actions, 1, actions.length);
} else {
// existing causes, filter out and insert aggregate at start
_actions = new Action[actions.length + 1 - causeCount];
int i = 1;
List<Cause> causeList = new ArrayList<>();
Collections.addAll(causeList, cause);
List<Cause> _causes = new ArrayList<>();
Collections.addAll(_causes, causes);
for (Action a: actions) {
if (a instanceof CauseAction) {
causeList.addAll(((CauseAction) a).getCauses());
_causes.addAll(((CauseAction) a).getCauses());
} else {
_actions[i++] = a;
}
}
_actions[0] = new CauseAction(causeList);
_actions[0] = new CauseAction(_causes);
}
if (ParameterizedJobMixIn.scheduleBuild2(item, 0, _actions) != null) {
listener.getLogger().println("Scheduled build for branch: " + name);
Expand Down

0 comments on commit 68baf70

Please sign in to comment.