Skip to content

Commit

Permalink
Merge pull request #28 from masterhard/jenkins-18003
Browse files Browse the repository at this point in the history
[FIXED JENKINS-18003]
  • Loading branch information
ndeloof committed May 18, 2013
2 parents 277fb8f + 6e09ecc commit b9628af
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

0 comments on commit b9628af

Please sign in to comment.