Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #101 from jenkinsci/JENKINS-33935
Fixed JENKINS-33935
  • Loading branch information
dalvizu committed May 23, 2016
2 parents 00a6a4f + 27e234d commit 6aabd2f
Showing 1 changed file with 7 additions and 5 deletions.
Expand Up @@ -599,8 +599,7 @@ private List<Action> filterActions(final List<Action> actions) {
final List<Action> retval = new ArrayList<Action>();
for (final Action action : actions) {
if (action instanceof CauseAction) {
final CauseAction causeAction = (CauseAction) action;
filterOutUserIdCause(causeAction);
final CauseAction causeAction = filterOutUserIdCause((CauseAction) action);
if (!causeAction.getCauses().isEmpty()) {
retval.add(causeAction);
}
Expand All @@ -619,15 +618,18 @@ private List<Action> filterActions(final List<Action> actions) {
*
* @param causeAction
* the causeAction to remove UserIdCause from
* @return a causeAction with UserIdCause removed
*/
private void filterOutUserIdCause(CauseAction causeAction) {
private CauseAction filterOutUserIdCause(CauseAction causeAction) {
final List<Cause> causes = new ArrayList<Cause>();
final Iterator<Cause> it = causeAction.getCauses().iterator();
while (it.hasNext()) {
final Cause cause = it.next();
if (cause instanceof UserIdCause) {
it.remove();
if (!(cause instanceof UserIdCause)) {
causes.add(cause);
}
}
return new CauseAction(causes);
}

/**
Expand Down

0 comments on commit 6aabd2f

Please sign in to comment.