You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by mg...@apache.org on 2020/02/20 11:26:01 UTC
[tomcat] branch master updated: Revert "Check for non-null
'methods'"
This is an automated email from the ASF dual-hosted git repository.
mgrigorov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/master by this push:
new 9f1e1fa Revert "Check for non-null 'methods'"
9f1e1fa is described below
commit 9f1e1fa3744cbb69b18536a8717da3311c40685c
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
AuthorDate: Thu Feb 20 13:25:43 2020 +0200
Revert "Check for non-null 'methods'"
This reverts commit 9ff6b12c3d7c99b4efc05a686f53e46aa24ad8a1.
---
java/jakarta/servlet/http/HttpServlet.java | 44 ++++++++++++++----------------
1 file changed, 21 insertions(+), 23 deletions(-)
diff --git a/java/jakarta/servlet/http/HttpServlet.java b/java/jakarta/servlet/http/HttpServlet.java
index 6b9091b..56b4ce1 100644
--- a/java/jakarta/servlet/http/HttpServlet.java
+++ b/java/jakarta/servlet/http/HttpServlet.java
@@ -443,31 +443,29 @@ public abstract class HttpServlet extends GenericServlet {
boolean allowPut = false;
boolean allowDelete = false;
- if (methods != null) {
- for (final Method method : methods) {
- switch (method.getName()) {
- case "doGet": {
- allowGet = true;
- allowHead = true;
- break;
- }
- case "doPost": {
- allowPost = true;
- break;
- }
- case "doPut": {
- allowPut = true;
- break;
- }
- case "doDelete": {
- allowDelete = true;
- break;
- }
- default:
- // NO-OP
+ for (int i = 0; i < methods.length; i++) {
+ switch (methods[i].getName()) {
+ case "doGet": {
+ allowGet = true;
+ allowHead = true;
+ break;
}
-
+ case "doPost": {
+ allowPost = true;
+ break;
+ }
+ case "doPut": {
+ allowPut = true;
+ break;
+ }
+ case "doDelete": {
+ allowDelete = true;
+ break;
+ }
+ default:
+ // NO-OP
}
+
}
StringBuilder allow = new StringBuilder();
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org