Skip to content

Commit 24ff60c

Browse files
committed
JENKINS-74931: Re-add the script field
The Active Choices plugin still depends on this field in order to be able to use the script in a parameter. Re-add it for the moment since the deprecated getter/setter added doesn't seem to be sufficient. (cherry picked from commit 88a8919)
1 parent 222f5d4 commit 24ff60c

File tree

1 file changed

+10
-0
lines changed
  • src/main/java/org/jenkinsci/plugins/scriptler/config

1 file changed

+10
-0
lines changed

src/main/java/org/jenkinsci/plugins/scriptler/config/Script.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
import edu.umd.cs.findbugs.annotations.CheckForNull;
2727
import edu.umd.cs.findbugs.annotations.NonNull;
28+
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
2829
import hudson.Util;
2930
import java.io.Serial;
3031
import java.io.Serializable;
@@ -51,6 +52,12 @@ public class Script implements Comparable<Script>, NamedResource, Serializable {
5152
*/
5253
private transient String scriptText;
5354

55+
/**
56+
* @deprecated Use {@link #getScriptText()} and {@link #setScriptText(String)} instead.
57+
*/
58+
@Deprecated(since = "384")
59+
public transient String script;
60+
5461
// User with Scriptler/RUN_SCRIPT permission can add/edit Scriptler step in projects
5562
public final boolean nonAdministerUsing;
5663

@@ -206,8 +213,11 @@ public String getScript() {
206213
return getScriptText();
207214
}
208215

216+
@SuppressFBWarnings("PA_PUBLIC_PRIMITIVE_ATTRIBUTE")
217+
@SuppressWarnings({"deprecated", "java:S1874"})
209218
public void setScriptText(String scriptText) {
210219
this.scriptText = scriptText;
220+
script = scriptText;
211221
}
212222

213223
/**

0 commit comments

Comments
 (0)