You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2017/12/02 20:37:57 UTC

svn commit: r1816983 - in /tomcat/trunk: java/org/apache/catalina/storeconfig/StoreFileMover.java res/findbugs/filter-false-positives.xml

Author: markt
Date: Sat Dec  2 20:37:57 2017
New Revision: 1816983

URL: http://svn.apache.org/viewvc?rev=1816983&view=rev
Log:
Spotbugs fixes (rank >=16) in store config

Modified:
    tomcat/trunk/java/org/apache/catalina/storeconfig/StoreFileMover.java
    tomcat/trunk/res/findbugs/filter-false-positives.xml

Modified: tomcat/trunk/java/org/apache/catalina/storeconfig/StoreFileMover.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/storeconfig/StoreFileMover.java?rev=1816983&r1=1816982&r2=1816983&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/storeconfig/StoreFileMover.java (original)
+++ tomcat/trunk/java/org/apache/catalina/storeconfig/StoreFileMover.java Sat Dec  2 20:37:57 2017
@@ -140,7 +140,9 @@ public class StoreFileMover {
             configNew = new File(getBasename(), configFile + ".new");
         }
         if (!configNew.getParentFile().exists()) {
-            configNew.getParentFile().mkdirs();
+            if (!configNew.getParentFile().mkdirs()) {
+                throw new IllegalStateException("Cannot create directory " + configNew);
+            }
         }
         String sb = getTimeTag();
         configSave = new File(configFile + sb);

Modified: tomcat/trunk/res/findbugs/filter-false-positives.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/res/findbugs/filter-false-positives.xml?rev=1816983&r1=1816982&r2=1816983&view=diff
==============================================================================
--- tomcat/trunk/res/findbugs/filter-false-positives.xml (original)
+++ tomcat/trunk/res/findbugs/filter-false-positives.xml Sat Dec  2 20:37:57 2017
@@ -397,6 +397,12 @@
     <Bug code="NP" />
   </Match>
   <Match>
+    <!-- If old -> save worked, assume save -> old will to -->
+    <Class name="org.apache.catalina.storeconfig.StoreFileMover" />
+    <Method name="move" />
+    <Bug pattern="RV_RETURN_VALUE_IGNORED_BAD_PRACTICE" />
+  </Match>
+  <Match>
     <Class name="org.apache.catalina.tribes.group.interceptors.TcpFailureDetector"/>
     <Method name="memberAlive"/>
     <Bug code="DE"/>



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