This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push: new 0c472e8089 Deprecate code that will be removed in Tomcat 10.1 0c472e8089 is described below commit 0c472e80896be83fd7dc228bdd9b36b2be7398b4 Author: Mark Thomas <ma...@apache.org> AuthorDate: Thu Jun 16 14:35:20 2022 +0100 Deprecate code that will be removed in Tomcat 10.1 As of WebSocket 2.1, the deployment restriction described in section 6.4 of the Jakarta WebSocket specification is removed so these settings will no longer be required. --- java/org/apache/tomcat/websocket/Constants.java | 7 +++++++ java/org/apache/tomcat/websocket/server/Constants.java | 9 +++++++++ java/org/apache/tomcat/websocket/server/WsServerContainer.java | 5 ++++- webapps/docs/config/systemprops.xml | 2 ++ 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/java/org/apache/tomcat/websocket/Constants.java b/java/org/apache/tomcat/websocket/Constants.java index 466a541611..8c1982bc64 100644 --- a/java/org/apache/tomcat/websocket/Constants.java +++ b/java/org/apache/tomcat/websocket/Constants.java @@ -139,6 +139,13 @@ public class Constants { static final boolean ALLOW_UNSUPPORTED_EXTENSIONS = Boolean.getBoolean("org.apache.tomcat.websocket.ALLOW_UNSUPPORTED_EXTENSIONS"); + /** + * WebSocket specification compliance flag. + * + * @deprecated This is no longer required in Jakarta EE 10 onwards and will + * be removed in Tomcat 10.1. + */ + @Deprecated public static final boolean STRICT_SPEC_COMPLIANCE = Boolean.getBoolean("org.apache.tomcat.websocket.STRICT_SPEC_COMPLIANCE"); diff --git a/java/org/apache/tomcat/websocket/server/Constants.java b/java/org/apache/tomcat/websocket/server/Constants.java index 876f1b8074..de5041a527 100644 --- a/java/org/apache/tomcat/websocket/server/Constants.java +++ b/java/org/apache/tomcat/websocket/server/Constants.java @@ -25,6 +25,15 @@ public class Constants { "org.apache.tomcat.websocket.binaryBufferSize"; public static final String TEXT_BUFFER_SIZE_SERVLET_CONTEXT_INIT_PARAM = "org.apache.tomcat.websocket.textBufferSize"; + + /** + * Allows the deployment restriction defined in section 6.4 of the Jakarta + * WebSocket specification to be ignored. + * + * @deprecated This is no longer required in Jakarta EE 10 onwards and will + * be removed in Tomcat 10.1. + */ + @Deprecated public static final String ENFORCE_NO_ADD_AFTER_HANDSHAKE_CONTEXT_INIT_PARAM = "org.apache.tomcat.websocket.noAddAfterHandshake"; diff --git a/java/org/apache/tomcat/websocket/server/WsServerContainer.java b/java/org/apache/tomcat/websocket/server/WsServerContainer.java index 74815a7fe7..c5336d6d57 100644 --- a/java/org/apache/tomcat/websocket/server/WsServerContainer.java +++ b/java/org/apache/tomcat/websocket/server/WsServerContainer.java @@ -73,6 +73,7 @@ public class WsServerContainer extends WsWebSocketContainer private final Map<String,ExactPathMatch> configExactMatchMap = new ConcurrentHashMap<>(); private final Map<Integer,ConcurrentSkipListMap<String,TemplatePathMatch>> configTemplateMatchMap = new ConcurrentHashMap<>(); + @SuppressWarnings("deprecation") private volatile boolean enforceNoAddAfterHandshake = org.apache.tomcat.websocket.Constants.STRICT_SPEC_COMPLIANCE; private volatile boolean addAllowed = true; @@ -80,6 +81,7 @@ public class WsServerContainer extends WsWebSocketContainer private volatile boolean endpointsRegistered = false; private volatile boolean deploymentFailed = false; + @SuppressWarnings("deprecation") WsServerContainer(ServletContext servletContext) { this.servletContext = servletContext; @@ -419,12 +421,13 @@ public class WsServerContainer extends WsWebSocketContainer } - + @Deprecated public boolean isEnforceNoAddAfterHandshake() { return enforceNoAddAfterHandshake; } + @Deprecated public void setEnforceNoAddAfterHandshake( boolean enforceNoAddAfterHandshake) { this.enforceNoAddAfterHandshake = enforceNoAddAfterHandshake; diff --git a/webapps/docs/config/systemprops.xml b/webapps/docs/config/systemprops.xml index d5463c4e41..42e83ac600 100644 --- a/webapps/docs/config/systemprops.xml +++ b/webapps/docs/config/systemprops.xml @@ -366,6 +366,8 @@ <li><code>org.apache.tomcat.websocket.server#isEnforceNoAddAfterHandshake</code> (default changes from <code>false</code> to <code>true</code>)</li> </ul> + <p>This system property is deprecated and will be removed in Tomcat + 10.1.</p> </property> <property name="org.apache.tomcat.util.http. ServerCookie.STRICT_NAMING"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org