From f91cd13f20a0ac220099a3fd2a146a1feb4e2e27 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Tue, 19 Dec 2023 17:28:40 -0500 Subject: [PATCH 1/2] Restore JCasC compatibility for `JNLPLauncher.tunnel` --- .../main/java/hudson/slaves/JNLPLauncher.java | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/hudson/slaves/JNLPLauncher.java b/core/src/main/java/hudson/slaves/JNLPLauncher.java index 3e11407ef6ba..5a15f605d9a8 100644 --- a/core/src/main/java/hudson/slaves/JNLPLauncher.java +++ b/core/src/main/java/hudson/slaves/JNLPLauncher.java @@ -55,9 +55,9 @@ */ public class JNLPLauncher extends ComputerLauncher { /** - * Deprecated (only used with deprecated {@code -jnlpUrl} mode), but cannot mark it as such without breaking CasC. + * @deprecated see {@link #setTunnel} */ - @DataBoundSetter + @Deprecated @CheckForNull public String tunnel; @@ -162,6 +162,19 @@ public void setWebSocket(boolean webSocket) { this.webSocket = webSocket; } + @Deprecated + 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 From 848d110a449b0124c2177dcb8e4e9b65e5acecd7 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Wed, 20 Dec 2023 13:40:53 -0500 Subject: [PATCH 2/2] Also removing `@Deprecated` on fields & getters --- .../main/java/hudson/slaves/JNLPLauncher.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/core/src/main/java/hudson/slaves/JNLPLauncher.java b/core/src/main/java/hudson/slaves/JNLPLauncher.java index 5a15f605d9a8..4645f3ffbeeb 100644 --- a/core/src/main/java/hudson/slaves/JNLPLauncher.java +++ b/core/src/main/java/hudson/slaves/JNLPLauncher.java @@ -53,11 +53,11 @@ * @author Stephen Connolly * @author Kohsuke Kawaguchi */ +@SuppressWarnings("deprecation") // see comments about CasC public class JNLPLauncher extends ComputerLauncher { /** - * @deprecated see {@link #setTunnel} + * Deprecated (only used with deprecated {@code -jnlpUrl} mode), but cannot mark it as such without breaking CasC. */ - @Deprecated @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 @@ protected Object readResolve() { 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 boolean isLaunchSupported() { 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,7 +164,9 @@ public void setWebSocket(boolean webSocket) { this.webSocket = webSocket; } - @Deprecated + /** + * Deprecated (only used with deprecated {@code -jnlpUrl} mode), but cannot mark it as such without breaking CasC. + */ public String getTunnel() { return tunnel; }