Skip to content

Commit

Permalink
[FIXED JENKINS-18003]
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Korotkov committed May 17, 2013
1 parent 277fb8f commit 6e09ecc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/main/groovy/com/cloudbees/plugins/flow/JobInvocation.groovy
Expand Up @@ -87,7 +87,7 @@ public class JobInvocation {

public Result getResult() throws ExecutionException, InterruptedException {
waitForCompletion();
return build.getResult();
return getBuild().getResult();
}

public String getResultString() throws ExecutionException, InterruptedException {
Expand All @@ -96,8 +96,8 @@ public class JobInvocation {

public String getColorForHtml() {
BallColor color = BallColor.NOTBUILT;
if (build != null) {
color = build.getIconColor();
if (getBuild() != null) {
color = getBuild().getIconColor();
}
return color.getHtmlBaseColor();
}
Expand Down Expand Up @@ -153,16 +153,16 @@ public class JobInvocation {
}

public String getBuildUrl() {
return this.build != null ? this.build.getAbsoluteUrl() : null;
return this.getBuild() != null ? this.getBuild().getAbsoluteUrl() : null;
}

public String getStartTime() {
String formattedStartTime = "";
if (build.getTime() != null) {
if (getBuild().getTime() != null) {
formattedStartTime = DateFormat.getDateTimeInstance(
DateFormat.SHORT,
DateFormat.SHORT)
.format(build.getTime());
.format(getBuild().getTime());
}
return formattedStartTime;
}
Expand Down
10 changes: 8 additions & 2 deletions src/main/java/com/cloudbees/plugins/flow/FlowRun.java
Expand Up @@ -52,9 +52,9 @@ public class FlowRun extends Build<BuildFlow, FlowRun> {

private String dsl;

private JobInvocation.Start startJob = new JobInvocation.Start(this);
private JobInvocation.Start startJob;

private DirectedGraph<JobInvocation, JobEdge> jobsGraph = new SimpleDirectedGraph<JobInvocation, JobEdge>(JobEdge.class);
private DirectedGraph<JobInvocation, JobEdge> jobsGraph;

private transient ThreadLocal<FlowState> state = new ThreadLocal<FlowState>();

Expand All @@ -71,6 +71,12 @@ public FlowRun(BuildFlow job) throws IOException {
}

private void setup(BuildFlow job) {
if (jobsGraph == null) {
jobsGraph = new SimpleDirectedGraph<JobInvocation, JobEdge>(JobEdge.class);
}
if (startJob == null) {
startJob = new JobInvocation.Start(this);
}
this.dsl = job.getDsl();
startJob.buildStarted(this);
jobsGraph.addVertex(startJob);
Expand Down

1 comment on commit 6e09ecc

@fraz3alpha
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, do you know when this fix will make it into a release of the plugin?

Please sign in to comment.