Skip to content

Commit

Permalink
JENKINS-74931: Re-add the script field
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mtughan committed Dec 4, 2024
1 parent 23af772 commit 88a8919
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main/java/org/jenkinsci/plugins/scriptler/config/Script.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

import edu.umd.cs.findbugs.annotations.CheckForNull;
import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import hudson.Util;
import java.io.Serial;
import java.io.Serializable;
Expand All @@ -51,6 +52,12 @@ public class Script implements Comparable<Script>, NamedResource, Serializable {
*/
private transient String scriptText;

/**
* @deprecated Use {@link #getScriptText()} and {@link #setScriptText(String)} instead.
*/
@Deprecated(since = "384")
public transient String script;

// User with Scriptler/RUN_SCRIPT permission can add/edit Scriptler step in projects
public final boolean nonAdministerUsing;

Expand Down Expand Up @@ -212,8 +219,11 @@ public String getScript() {
return getScriptText();
}

@SuppressFBWarnings("PA_PUBLIC_PRIMITIVE_ATTRIBUTE")
@SuppressWarnings({"deprecated", "java:S1874"})
public void setScriptText(String scriptText) {
this.scriptText = scriptText;
script = scriptText;
}

/**
Expand Down

0 comments on commit 88a8919

Please sign in to comment.