tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1832017 - /tomcat/trunk/test/org/apache/catalina/core/TestSwallowAbortedUploads.java
Date Tue, 22 May 2018 11:07:29 GMT
Author: markt
Date: Tue May 22 11:07:29 2018
New Revision: 1832017

URL: http://svn.apache.org/viewvc?rev=1832017&view=rev
Log:
Refactor to avoid SpotBugs warning

Modified:
    tomcat/trunk/test/org/apache/catalina/core/TestSwallowAbortedUploads.java

Modified: tomcat/trunk/test/org/apache/catalina/core/TestSwallowAbortedUploads.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/core/TestSwallowAbortedUploads.java?rev=1832017&r1=1832016&r2=1832017&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/core/TestSwallowAbortedUploads.java (original)
+++ tomcat/trunk/test/org/apache/catalina/core/TestSwallowAbortedUploads.java Tue May 22 11:07:29
2018
@@ -318,9 +318,9 @@ public class TestSwallowAbortedUploads e
 
         private static final long serialVersionUID = 1L;
 
-        private int status = 200;
+        private final int status;
 
-        public void setStatus(int status) {
+        public AbortedPOSTServlet(int status) {
             this.status = status;
         }
 
@@ -353,10 +353,8 @@ public class TestSwallowAbortedUploads e
 
             Tomcat tomcat = getTomcatInstance();
             context = tomcat.addContext("", TEMP_DIR);
-            AbortedPOSTServlet servlet = new AbortedPOSTServlet();
-            servlet.setStatus(status);
-            Tomcat.addServlet(context, servletName,
-                              servlet);
+            AbortedPOSTServlet servlet = new AbortedPOSTServlet(status);
+            Tomcat.addServlet(context, servletName, servlet);
             context.addServletMappingDecoded(URI, servletName);
             context.setSwallowAbortedUploads(swallow);
 



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


Mime
View raw message