tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1816247 - in /tomcat/trunk/java/org/apache/catalina/servlets: DefaultServlet.java WebdavServlet.java
Date Fri, 24 Nov 2017 17:44:17 GMT
Author: markt
Date: Fri Nov 24 17:44:17 2017
New Revision: 1816247

URL: http://svn.apache.org/viewvc?rev=1816247&view=rev
Log:
Fix a handful of low severity SpotBugs reports
- Serialization warnings. Probably ignorable but the fix is simple.

Modified:
    tomcat/trunk/java/org/apache/catalina/servlets/DefaultServlet.java
    tomcat/trunk/java/org/apache/catalina/servlets/WebdavServlet.java

Modified: tomcat/trunk/java/org/apache/catalina/servlets/DefaultServlet.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/servlets/DefaultServlet.java?rev=1816247&r1=1816246&r2=1816247&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/servlets/DefaultServlet.java (original)
+++ tomcat/trunk/java/org/apache/catalina/servlets/DefaultServlet.java Fri Nov 24 17:44:17
2017
@@ -233,7 +233,7 @@ public class DefaultServlet extends Http
      * the platform default is used.
      */
     protected String fileEncoding = null;
-    private Charset fileEncodingCharset = null;
+    private transient Charset fileEncodingCharset = null;
 
     /**
      * If a file has a BOM, should that be used in preference to fileEncoding?

Modified: tomcat/trunk/java/org/apache/catalina/servlets/WebdavServlet.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/servlets/WebdavServlet.java?rev=1816247&r1=1816246&r2=1816247&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/servlets/WebdavServlet.java (original)
+++ tomcat/trunk/java/org/apache/catalina/servlets/WebdavServlet.java Fri Nov 24 17:44:17
2017
@@ -18,6 +18,7 @@ package org.apache.catalina.servlets;
 
 import java.io.IOException;
 import java.io.InputStream;
+import java.io.Serializable;
 import java.io.StringReader;
 import java.io.StringWriter;
 import java.io.Writer;
@@ -916,7 +917,7 @@ public class WebdavServlet extends Defau
             return;
         }
 
-        LockInfo lock = new LockInfo();
+        LockInfo lock = new LockInfo(maxDepth);
 
         // Parsing lock request
 
@@ -2359,11 +2360,18 @@ public class WebdavServlet extends Defau
     /**
      * Holds a lock information.
      */
-    private class LockInfo {
+    private static class LockInfo implements Serializable {
+
+        private static final long serialVersionUID = 1L;
+
+        public LockInfo(int maxDepth) {
+            this.maxDepth = maxDepth;
+        }
 
 
         // ------------------------------------------------- Instance Variables
 
+        private final int maxDepth;
 
         String path = "/";
         String type = "write";
@@ -2377,7 +2385,6 @@ public class WebdavServlet extends Defau
 
         // ----------------------------------------------------- Public Methods
 
-
         /**
          * Get a String representation of this lock token.
          */
@@ -2466,10 +2473,7 @@ public class WebdavServlet extends Defau
             generatedXML.writeElement("D", "locktoken", XMLWriter.CLOSING);
 
             generatedXML.writeElement("D", "activelock", XMLWriter.CLOSING);
-
         }
-
-
     }
 
 



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


Mime
View raw message