Skip to content

Commit

Permalink
Retain compatibility with old build records
Browse files Browse the repository at this point in the history
  • Loading branch information
md5 committed Sep 22, 2016
1 parent 87c2046 commit c67d3aa
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
@SuppressWarnings("unchecked")
public abstract class AbstractRubyMetricsProjectAction<T extends AbstractRubyMetricsBuildAction> extends Actionable implements ProminentProjectAction {

protected final Job<?, ?> job;
protected Job<?, ?> job;
private transient AbstractProject<?, ?> project; // Retain backwards compatibility with old build records

public AbstractRubyMetricsProjectAction(Job<?, ?> job) {
this.job = job;
Expand Down Expand Up @@ -66,4 +67,10 @@ public Integer getLastResultBuild() {
return null;
}

private Object readResolve() {
if (job == null) {
job = project;
}
return this;
}
}

0 comments on commit c67d3aa

Please sign in to comment.