Skip to content

Commit

Permalink
Findbugs fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
vivek committed Oct 12, 2017
1 parent 374792f commit a5eabba
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.google.common.base.Predicate;
import hudson.model.Action;
import hudson.model.Queue;
import hudson.model.queue.CauseOfBlockage;
import io.jenkins.blueocean.rest.model.BlueRun;
import org.jenkinsci.plugins.pipeline.StageStatus;
import org.jenkinsci.plugins.pipeline.SyntheticStage;
Expand Down Expand Up @@ -153,7 +154,10 @@ public static boolean isParallelBranch(@Nullable FlowNode node){
if (item != null) {
String cause = item.getCauseOfBlockage().getShortDescription();
if (cause == null) {
cause = item.task.getCauseOfBlockage().getShortDescription();
CauseOfBlockage causeOfBlockage = item.task.getCauseOfBlockage();
if(causeOfBlockage != null) {
return causeOfBlockage.getShortDescription();
}
}
return cause;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import hudson.Extension;
import hudson.model.Queue;
import hudson.model.Run;
import hudson.model.queue.CauseOfBlockage;
import hudson.scm.ChangeLogSet;
import hudson.scm.ChangeLogSet.Entry;
import io.jenkins.blueocean.commons.ServiceException;
Expand Down Expand Up @@ -39,7 +40,6 @@
import org.slf4j.LoggerFactory;

import javax.annotation.Nonnull;
import java.io.IOException;
import java.util.Comparator;
import java.util.LinkedHashMap;
import java.util.Map;
Expand Down Expand Up @@ -245,8 +245,9 @@ public String getCauseOfBlockage() {
Run r = task.runForDisplay();
if (r != null && r.equals(run)) {
String cause = i.getCauseOfBlockage().getShortDescription();
if (task.getCauseOfBlockage() != null) {
cause = task.getCauseOfBlockage().getShortDescription();
CauseOfBlockage causeOfBlockage = task.getCauseOfBlockage();
if ( causeOfBlockage != null) {
return causeOfBlockage.getShortDescription();
}
return cause;
}
Expand Down

0 comments on commit a5eabba

Please sign in to comment.