Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Sohn2010-12-06 23:58:19 +0000
committerShawn O. Pearce2010-12-08 00:18:30 +0000
commit45731756a56361a51e839e26d3b0bed1c06ee37a (patch)
tree914823e211dbbdf277acd2e9725cfb743155e112 /org.eclipse.jgit.junit
parente22f9552a8531a56fe2ffd7135da3e8607f708bc (diff)
downloadjgit-45731756a56361a51e839e26d3b0bed1c06ee37a.tar.gz
jgit-45731756a56361a51e839e26d3b0bed1c06ee37a.tar.xz
jgit-45731756a56361a51e839e26d3b0bed1c06ee37a.zip
[findbugs] Do not ignore exceptional return value
java.io.File.delete() reports failure as an exceptional return value false. Fix the code which silently ignored this exceptional return value. Also remove some duplicate deletion helper methods. Change-Id: I80ed20ca1f07a2bc6e779957a4ad0c713789c5be 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/TestRepository.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java
index e74af8cf71..71446a0dce 100644
--- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java
+++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java
@@ -97,6 +97,7 @@ import org.eclipse.jgit.storage.file.PackIndex.MutableEntry;
import org.eclipse.jgit.storage.pack.PackWriter;
import org.eclipse.jgit.treewalk.TreeWalk;
import org.eclipse.jgit.treewalk.filter.PathFilterGroup;
+import org.eclipse.jgit.util.FileUtils;
/**
* Wrapper to make creating test data easier.
@@ -651,10 +652,10 @@ public class TestRepository<R extends Repository> {
}
}
- private void prunePacked(ObjectDirectory odb) {
+ private void prunePacked(ObjectDirectory odb) throws IOException {
for (PackFile p : odb.getPacks()) {
for (MutableEntry e : p)
- odb.fileFor(e.toObjectId()).delete();
+ FileUtils.delete(odb.fileFor(e.toObjectId()));
}
}

Back to the top