Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Sohn2010-12-10 20:58:05 +0000
committerMatthias Sohn2011-01-28 00:11:12 +0000
commit38eec8f4a26935ba9e75bfbdde8a5682e05f338d (patch)
treee609e5e005fed86ef245b1646010312eaa0a3a61 /org.eclipse.jgit.junit
parentf5fe2dca3cb9f57891e1a4b18832fcc158d0c490 (diff)
downloadjgit-38eec8f4a26935ba9e75bfbdde8a5682e05f338d.tar.gz
jgit-38eec8f4a26935ba9e75bfbdde8a5682e05f338d.tar.xz
jgit-38eec8f4a26935ba9e75bfbdde8a5682e05f338d.zip
[findbugs] Do not ignore exceptional return value of mkdir
java.io.File.mkdir() and mkdirs() report failure as an exceptional return value false. Fix the code which silently ignored this exceptional return value. Change-Id: I41244f4b9d66176e68e2c07e2329cf08492f8619 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.junit')
-rw-r--r--org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java
index 3917c487d7..45c6c41f2c 100644
--- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java
+++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java
@@ -69,6 +69,7 @@ import org.eclipse.jgit.storage.file.FileRepository;
import org.eclipse.jgit.storage.file.WindowCache;
import org.eclipse.jgit.storage.file.WindowCacheConfig;
import org.eclipse.jgit.util.FS;
+import org.eclipse.jgit.util.FileUtils;
import org.eclipse.jgit.util.IO;
import org.eclipse.jgit.util.SystemReader;
import org.junit.After;
@@ -389,7 +390,7 @@ public abstract class LocalDiskRepositoryTestCase {
* the file could not be written.
*/
protected void write(final File f, final String body) throws IOException {
- f.getParentFile().mkdirs();
+ FileUtils.mkdirs(f.getParentFile(), true);
Writer w = new OutputStreamWriter(new FileOutputStream(f), "UTF-8");
try {
w.write(body);

Back to the top