You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2015/08/23 18:07:23 UTC

svn commit: r1697208 - /commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/util/Class2HTMLTestCase.java

Author: sebb
Date: Sun Aug 23 16:07:23 2015
New Revision: 1697208

URL: http://svn.apache.org/r1697208
Log:
FindBUgs: Check return of mkdirs()

Modified:
    commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/util/Class2HTMLTestCase.java

Modified: commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/util/Class2HTMLTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/util/Class2HTMLTestCase.java?rev=1697208&r1=1697207&r2=1697208&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/util/Class2HTMLTestCase.java (original)
+++ commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/util/Class2HTMLTestCase.java Sun Aug 23 16:07:23 2015
@@ -21,6 +21,7 @@ import java.io.File;
 import java.io.FileInputStream;
 
 import org.apache.commons.bcel6.classfile.ClassParser;
+import org.junit.Assert;
 
 import junit.framework.TestCase;
 
@@ -28,7 +29,9 @@ public class Class2HTMLTestCase extends
 
     public void testConvertJavaUtil() throws Exception {
         File outputDir = new File("target/test-output/html");
-        outputDir.mkdirs();
+        if (!outputDir.mkdirs()) { // either was not created or already existed
+            Assert.assertTrue(outputDir.isDirectory()); // fail if missing
+        }
 
         FileInputStream file = new FileInputStream("target/test-classes/Java8Example.class");