diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2010-12-07 00:58:19 +0100 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2010-12-07 16:18:30 -0800 |
commit | 45731756a56361a51e839e26d3b0bed1c06ee37a (patch) | |
tree | 914823e211dbbdf277acd2e9725cfb743155e112 /org.eclipse.jgit.junit/src | |
parent | e22f9552a8531a56fe2ffd7135da3e8607f708bc (diff) | |
download | jgit-45731756a56361a51e839e26d3b0bed1c06ee37a.tar.gz 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/src')
-rw-r--r-- | org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java | 5 |
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())); } } |