Skip to content

Commit 92deb71

Browse files
committed
Remove deprecated code. Internal storage for method can now use String.
1 parent f5d92b5 commit 92deb71

1 file changed

Lines changed: 5 additions & 23 deletions

File tree

java/org/apache/coyote/Request.java

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public Request() {
8686

8787
private final MessageBytes schemeMB = MessageBytes.newInstance();
8888

89-
private final MessageBytes methodMB = MessageBytes.newInstance();
89+
private String method;
9090
private final MessageBytes uriMB = MessageBytes.newInstance();
9191
private final MessageBytes decodedUriMB = MessageBytes.newInstance();
9292
private final MessageBytes queryMB = MessageBytes.newInstance();
@@ -306,34 +306,16 @@ public MessageBytes scheme() {
306306
return schemeMB;
307307
}
308308

309-
/**
310-
* Get a MessageBytes instance that holds the current request's HTTP method.
311-
*
312-
* @return a MessageBytes instance that holds the current request's HTTP method.
313-
*
314-
* @deprecated Use {@link #getMethod()}, {@link Request#setMethod(String)} and {@link #setMethod(byte[], int, int)}
315-
*/
316-
@Deprecated
317-
public MessageBytes method() {
318-
return methodMB;
319-
}
320-
321309
public void setMethod(String method) {
322-
methodMB.setString(method);
310+
this.method = method;
323311
}
324312

325313
public void setMethod(byte[] buf, int start, int len) {
326-
String method = Method.bytesToString(buf, start, len);
327-
if (method == null) {
328-
methodMB.setBytes(buf, start, len);
329-
method = methodMB.toStringType();
330-
} else {
331-
methodMB.setString(method);
332-
}
314+
this.method = Method.bytesToString(buf, start, len);
333315
}
334316

335317
public String getMethod() {
336-
return methodMB.toStringType();
318+
return method;
337319
}
338320

339321
public MessageBytes requestURI() {
@@ -790,7 +772,7 @@ public void recycle() {
790772
uriMB.recycle();
791773
decodedUriMB.recycle();
792774
queryMB.recycle();
793-
methodMB.recycle();
775+
method = null;
794776
protoMB.recycle();
795777

796778
schemeMB.recycle();

0 commit comments

Comments
 (0)