This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit f528b957e1c3460c8c1b3ab9930109e7eb20c70c
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 | 4 +++-
 webapps/docs/config/systemprops.xml                            | 2 ++
 4 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/websocket/Constants.java 
b/java/org/apache/tomcat/websocket/Constants.java
index 85a60347b4..73503186e4 100644
--- a/java/org/apache/tomcat/websocket/Constants.java
+++ b/java/org/apache/tomcat/websocket/Constants.java
@@ -140,6 +140,13 @@ public class Constants {
     public static final String WS_AUTHENTICATION_USER_NAME = 
"org.apache.tomcat.websocket.WS_AUTHENTICATION_USER_NAME";
     public static final String WS_AUTHENTICATION_PASSWORD = 
"org.apache.tomcat.websocket.WS_AUTHENTICATION_PASSWORD";
 
+    /**
+     * 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 16768617d8..e900a540a9 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 0a29137557..5fa9d3c675 100644
--- a/java/org/apache/tomcat/websocket/server/WsServerContainer.java
+++ b/java/org/apache/tomcat/websocket/server/WsServerContainer.java
@@ -74,6 +74,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;
@@ -363,12 +364,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 42262b3e04..a555cd109a 100644
--- a/webapps/docs/config/systemprops.xml
+++ b/webapps/docs/config/systemprops.xml
@@ -147,6 +147,8 @@
       <ul>
         
<li><code>org.apache.tomcat.websocket.server.WsServerContainer#isEnforceNoAddAfterHandshake</code></li>
       </ul>
+      <p>This system property is deprecated and will be removed in Tomcat
+      10.1.</p>
     </property>
 
   </properties>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to