Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #278 from jenkinsci/JENKINS-33467
Don't crash because JENKINS-33467 has changed expected behaviour
  • Loading branch information
rsandell committed Mar 31, 2016
2 parents b7ab589 + 03d057f commit f1a6a39
Showing 1 changed file with 15 additions and 7 deletions.
Expand Up @@ -275,14 +275,22 @@ protected void setThisBuild(Run r) {
*/
protected void cleanUpGerritCauses(GerritCause firstFound, Run build) {
List<Cause> causes = build.getAction(CauseAction.class).getCauses();
int pos = causes.indexOf(firstFound) + 1;
while (pos < causes.size()) {
Cause c = causes.get(pos);
if (c.equals(firstFound)) {
causes.remove(pos);
} else {
pos++;
try {
int pos = causes.indexOf(firstFound) + 1;
while (pos < causes.size()) {
Cause c = causes.get(pos);
if (c.equals(firstFound)) {
causes.remove(pos);
} else {
pos++;
}
}
} catch (UnsupportedOperationException ignored) {
logger.debug("Got smashed by JENKINS-33467, but it shouldn't do any harm", ignored);
/*
TODO Something better should be done here, this is to prevent totally breaking when JENKINS-33467 hits.
But since JENKINS-33467 is aimed at preventing this case maybe it's no longer needed at all.
*/
}
}

Expand Down

0 comments on commit f1a6a39

Please sign in to comment.