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


The following commit(s) were added to refs/heads/main by this push:
     new 92deb71207 Remove deprecated code. Internal storage for method can now 
use String.
92deb71207 is described below

commit 92deb712072de68f6b8a8e4828621834885868ed
Author: Mark Thomas <[email protected]>
AuthorDate: Fri Oct 10 09:35:42 2025 +0100

    Remove deprecated code. Internal storage for method can now use String.
---
 java/org/apache/coyote/Request.java | 28 +++++-----------------------
 1 file changed, 5 insertions(+), 23 deletions(-)

diff --git a/java/org/apache/coyote/Request.java 
b/java/org/apache/coyote/Request.java
index 5719144566..5313780965 100644
--- a/java/org/apache/coyote/Request.java
+++ b/java/org/apache/coyote/Request.java
@@ -86,7 +86,7 @@ public final class Request {
 
     private final MessageBytes schemeMB = MessageBytes.newInstance();
 
-    private final MessageBytes methodMB = MessageBytes.newInstance();
+    private String method;
     private final MessageBytes uriMB = MessageBytes.newInstance();
     private final MessageBytes decodedUriMB = MessageBytes.newInstance();
     private final MessageBytes queryMB = MessageBytes.newInstance();
@@ -306,34 +306,16 @@ public final class Request {
         return schemeMB;
     }
 
-    /**
-     * Get a MessageBytes instance that holds the current request's HTTP 
method.
-     *
-     * @return a MessageBytes instance that holds the current request's HTTP 
method.
-     *
-     * @deprecated Use {@link #getMethod()}, {@link Request#setMethod(String)} 
and {@link #setMethod(byte[], int, int)}
-     */
-    @Deprecated
-    public MessageBytes method() {
-        return methodMB;
-    }
-
     public void setMethod(String method) {
-        methodMB.setString(method);
+        this.method = method;
     }
 
     public void setMethod(byte[] buf, int start, int len) {
-        String method = Method.bytesToString(buf, start, len);
-        if (method == null) {
-            methodMB.setBytes(buf, start, len);
-            method = methodMB.toStringType();
-        } else {
-            methodMB.setString(method);
-        }
+        this.method = Method.bytesToString(buf, start, len);
     }
 
     public String getMethod() {
-        return methodMB.toStringType();
+        return method;
     }
 
     public MessageBytes requestURI() {
@@ -790,7 +772,7 @@ public final class Request {
         uriMB.recycle();
         decodedUriMB.recycle();
         queryMB.recycle();
-        methodMB.recycle();
+        method = null;
         protoMB.recycle();
 
         schemeMB.recycle();


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to