> Mark, > > On 6/24/19 05:58, ma...@apache.org wrote: >> This is an automated email from the ASF dual-hosted git >> repository. > >> markt pushed a commit to branch 8.5.x in repository >> https://gitbox.apache.org/repos/asf/tomcat.git > >> commit 4ec3d26396e4d8804629d31fa2459eb1401bcf44 Author: Mark Thomas >> <ma...@apache.org> AuthorDate: Mon Jun 24 10:54:54 2019 +0100 > >> Back-port spotbugs fixes --- >> java/org/apache/catalina/servlets/WebdavServlet.java | 12 >> ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) > >> diff --git a/java/org/apache/catalina/servlets/WebdavServlet.java >> b/java/org/apache/catalina/servlets/WebdavServlet.java index >> 5ce1678..1ad0f97 100644 --- >> a/java/org/apache/catalina/servlets/WebdavServlet.java +++ >> b/java/org/apache/catalina/servlets/WebdavServlet.java @@ -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; @@ -909,7 +910,7 @@ >> public class WebdavServlet extends DefaultServlet { return; } > >> - LockInfo lock = new LockInfo(); + LockInfo lock = >> new LockInfo(maxDepth); > >> // Parsing lock request > >> @@ -2357,11 +2358,18 @@ public class WebdavServlet extends >> DefaultServlet { /** * Holds a lock information. */ - private >> class LockInfo { + private static class LockInfo implements >> Serializable { + + private static final long >> serialVersionUID = 1L; > > Shouldn't this be something more random?
No. Since we are marking the class Serializable then we get to choose the ID. Best practise is to start at 1 and increment whenever an incompatible change is made. >> + + public LockInfo(int maxDepth) { + >> this.maxDepth = maxDepth; + } > > The "maxDepth" member does not seem to be used. Is this part of a > separate commit? No. This one confused me for a while. Prior to the patch maxDepth was a field in WebdavServlet. (It still is after the patch.) LockInfo accessed that field directly. The patch makes LockInfo static so the maxDepth field in WebdavServlet was no longer visible. The patch adds a maxDepth field to LockInfo and sets it in the constructor from WebdavServlet#maxDepth. The code the reads maxDepth is unchanged. It now reads the field from LockInfo rather than WebdavServlet. Mark --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org