Skip to content

Commit

Permalink
Merge pull request #13 from jenkinsci/fix-backwards-compatibility
Browse files Browse the repository at this point in the history
Fix for bug JENKINS-34415 Broken backward compatibility
  • Loading branch information
Le0Michine committed Apr 24, 2016
2 parents d449908 + 754f9ea commit bffcad2
Showing 1 changed file with 12 additions and 2 deletions.
Expand Up @@ -29,8 +29,8 @@
public class BuildNameSetter extends BuildWrapper implements MatrixAggregatable {

public final String template;
public boolean runAtStart = true;
public boolean runAtEnd = true;
public Boolean runAtStart = true;
public Boolean runAtEnd = true;

@DataBoundConstructor
public BuildNameSetter(String template, Boolean runAtStart, Boolean runAtEnd) {
Expand All @@ -39,6 +39,16 @@ public BuildNameSetter(String template, Boolean runAtStart, Boolean runAtEnd) {
this.runAtEnd = toBooleanDefaultIfNull(runAtEnd, true);
}

protected Object readResolve() {
if (runAtStart == null) {
runAtStart = true;
}
if (runAtEnd == null) {
runAtEnd = true;
}
return this;
}

@Override
public Environment setUp(AbstractBuild build, Launcher launcher, BuildListener listener) throws IOException, InterruptedException {
if (runAtStart)
Expand Down

0 comments on commit bffcad2

Please sign in to comment.