Skip to content
This repository was archived by the owner on Mar 27, 2025. It is now read-only.

Commit 6c76f17

Browse files
committed
Ensure backwards compatibility with command form
1 parent 7a9094f commit 6c76f17

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/main/java/com/mathworks/ci/RunMatlabCommandStep.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import org.jenkinsci.plugins.workflow.steps.StepDescriptor;
1212
import org.jenkinsci.plugins.workflow.steps.StepExecution;
1313
import org.kohsuke.stapler.DataBoundConstructor;
14+
import org.kohsuke.stapler.DataBoundSetter;
1415
import com.google.common.collect.ImmutableSet;
1516
import hudson.EnvVars;
1617
import hudson.Extension;
@@ -23,19 +24,23 @@
2324
public class RunMatlabCommandStep extends Step {
2425

2526
private String command;
26-
private String startupOptions;
27+
private String startupOptions = "";
2728

2829
@DataBoundConstructor
29-
public RunMatlabCommandStep(String command, String startupOptions) {
30+
public RunMatlabCommandStep(String command) {
3031
this.command = command;
31-
this.startupOptions = startupOptions;
3232
}
3333

3434

3535
public String getCommand() {
3636
return this.command;
3737
}
3838

39+
@DataBoundSetter
40+
public void setStartupOptions(String startupOptions) {
41+
this.startupOptions = startupOptions;
42+
}
43+
3944
public String getStartupOptions() {
4045
return Util.fixNull(this.startupOptions);
4146
}

src/test/java/com/mathworks/ci/RunMatlabCommandStepTester.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020

2121
public class RunMatlabCommandStepTester extends RunMatlabCommandStep {
2222
@DataBoundConstructor
23-
public RunMatlabCommandStepTester(String command, String startupOptions) {
24-
super(command, startupOptions);
23+
public RunMatlabCommandStepTester(String command) {
24+
super(command);
2525
}
2626

2727
@Override

0 commit comments

Comments
 (0)