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 3c0791abb95342a9e5fcf90eb4a18a9c6188c269
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Mon Oct 2 11:43:01 2023 +0100

    Deprecate PushBuilder as per latest Servlet 6.1
---
 java/jakarta/servlet/http/HttpServletRequest.java        | 9 ++++++---
 java/jakarta/servlet/http/HttpServletRequestWrapper.java | 3 +++
 java/jakarta/servlet/http/PushBuilder.java               | 3 +++
 webapps/docs/changelog.xml                               | 5 +++++
 4 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/java/jakarta/servlet/http/HttpServletRequest.java 
b/java/jakarta/servlet/http/HttpServletRequest.java
index 7bb78cb999..8e36a97ccd 100644
--- a/java/jakarta/servlet/http/HttpServletRequest.java
+++ b/java/jakarta/servlet/http/HttpServletRequest.java
@@ -223,12 +223,15 @@ public interface HttpServletRequest extends 
ServletRequest {
      * instance obtained.
      *
      * @return A builder that can be used to generate push requests based on 
this request or {@code null} if push is not
-     *             supported. Note that even if a PushBuilder instance is 
returned, by the time that
-     *             {@link PushBuilder#push()} is called, it may no longer be 
valid to push a request and the push
-     *             request will be ignored.
+     *             supported. Some implementations may opt not to support 
server push and will therefore always return
+     *             {@code null}. If a PushBuilder instance is returned, by the 
time that {@link PushBuilder#push()} is
+     *             called, it may no longer be valid to push a request and the 
push request will be ignored.
      *
      * @since Servlet 4.0
+     *
+     * @deprecated In favor of 103 early hints
      */
+    @Deprecated
     default PushBuilder newPushBuilder() {
         return null;
     }
diff --git a/java/jakarta/servlet/http/HttpServletRequestWrapper.java 
b/java/jakarta/servlet/http/HttpServletRequestWrapper.java
index 766488be9d..ac56f2cee8 100644
--- a/java/jakarta/servlet/http/HttpServletRequestWrapper.java
+++ b/java/jakarta/servlet/http/HttpServletRequestWrapper.java
@@ -349,7 +349,10 @@ public class HttpServletRequestWrapper extends 
ServletRequestWrapper implements
      * request object.
      *
      * @since Servlet 4.0
+     *
+     * @deprecated In favor of 103 early hints
      */
+    @Deprecated
     @Override
     public PushBuilder newPushBuilder() {
         return this._getHttpServletRequest().newPushBuilder();
diff --git a/java/jakarta/servlet/http/PushBuilder.java 
b/java/jakarta/servlet/http/PushBuilder.java
index 9a1092011d..46c6ed72bc 100644
--- a/java/jakarta/servlet/http/PushBuilder.java
+++ b/java/jakarta/servlet/http/PushBuilder.java
@@ -32,7 +32,10 @@ import java.util.Set;
  * </ul>
  *
  * @since Servlet 4.0
+ *
+ * @deprecated In favor of 103 early hints
  */
+@Deprecated
 public interface PushBuilder {
 
     /**
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 8dc474f05b..0addab5e1f 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -160,6 +160,11 @@
         Improve statistics collection for upgraded connections under load.
         (remm)
       </fix>
+      <update>
+        <code>PushBuilder</code> has been deprecated in line with the changes
+        for the Servlet 6.1 specification. It will be replaced in a future
+        Tomcat 11 milestone with support for 103 early hints. (markt)
+      </update>
     </changelog>
   </subsection>
   <subsection name="Jasper">


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

Reply via email to