Skip to content
Permalink
Browse files
Fixed JENKINS-33935
Jenkins core made CauseAction.getCauses an unmodifiable collection
(JENKINS-33467) - so we need to make a copy.
  • Loading branch information
dalvizu committed May 23, 2016
1 parent 00a6a4f commit 27e234d2f1b8c86e28465d6a2d8ace5db9c7d778
Showing with 7 additions and 5 deletions.
  1. +7 −5 src/main/java/au/com/centrumsystems/hudson/plugin/buildpipeline/BuildPipelineView.java
@@ -599,8 +599,7 @@ private static ParametersAction mergeParameters(final ParametersAction base, fin
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);
}
@@ -619,15 +618,18 @@ private static ParametersAction mergeParameters(final ParametersAction base, fin
*
* @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);
}

/**

0 comments on commit 27e234d

Please sign in to comment.