From df03159afe15788eb74bced96ce7b44dfc70788c Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Sat, 23 Dec 2023 18:49:49 -0500 Subject: [PATCH] Restore JCasC compatibility for `JNLPLauncher.tunnel` (#8793) * Restore JCasC compatibility for `JNLPLauncher.tunnel` * Also removing `@Deprecated` on fields & getters --- .../main/java/hudson/slaves/JNLPLauncher.java | 27 +++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/hudson/slaves/JNLPLauncher.java b/core/src/main/java/hudson/slaves/JNLPLauncher.java index 3e11407ef6..4645f3ffbe 100644 --- a/core/src/main/java/hudson/slaves/JNLPLauncher.java +++ b/core/src/main/java/hudson/slaves/JNLPLauncher.java @@ -53,11 +53,11 @@ import org.kohsuke.stapler.DataBoundSetter; * @author Stephen Connolly * @author Kohsuke Kawaguchi */ +@SuppressWarnings("deprecation") // see comments about CasC public class JNLPLauncher extends ComputerLauncher { /** * Deprecated (only used with deprecated {@code -jnlpUrl} mode), but cannot mark it as such without breaking CasC. */ - @DataBoundSetter @CheckForNull public String tunnel; @@ -67,11 +67,9 @@ public class JNLPLauncher extends ComputerLauncher { @Deprecated public final transient String vmargs = null; - @Deprecated @NonNull private RemotingWorkDirSettings workDirSettings = RemotingWorkDirSettings.getEnabledDefaults(); - @Deprecated private boolean webSocket; /** @@ -131,7 +129,9 @@ public class JNLPLauncher extends ComputerLauncher { return this; } - @Deprecated + /** + * Deprecated (only used with deprecated {@code -jnlpUrl} mode), but cannot mark it as such without breaking CasC. + */ public RemotingWorkDirSettings getWorkDirSettings() { return workDirSettings; } @@ -149,7 +149,9 @@ public class JNLPLauncher extends ComputerLauncher { return false; } - @Deprecated + /** + * Deprecated (only used with deprecated {@code -jnlpUrl} mode), but cannot mark it as such without breaking CasC. + */ public boolean isWebSocket() { return webSocket; } @@ -162,6 +164,21 @@ public class JNLPLauncher extends ComputerLauncher { this.webSocket = webSocket; } + /** + * Deprecated (only used with deprecated {@code -jnlpUrl} mode), but cannot mark it as such without breaking CasC. + */ + public String getTunnel() { + return tunnel; + } + + /** + * Deprecated (only used with deprecated {@code -jnlpUrl} mode), but cannot mark it as such without breaking CasC. + */ + @DataBoundSetter + public void setTunnel(String tunnel) { + this.tunnel = tunnel; + } + @Override public void launch(SlaveComputer computer, TaskListener listener) { // do nothing as we cannot self start