aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2023-05-18 12:02:48 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2023-05-18 21:10:33 +0200
commit2cbf0c1774ed0529fc4910c768452902e346ff23 (patch)
tree2bc13ab42e4bb10e3e91e954441dd8913c76ef00 /org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java
parent4562e79e234696ae3e1601db9bf8b73a1ef7edf8 (diff)
downloadjgit-2cbf0c1774ed0529fc4910c768452902e346ff23.tar.gz
jgit-2cbf0c1774ed0529fc4910c768452902e346ff23.zip
Also add suppressed exception if unchecked exception occurs in finally
If a method called in a finally block throws an exception we should add exceptions caught earlier to the exception we throw in the finally block not regarding if it's a checked or unchecked exception. Change-Id: I4c6be9a3a08482b07659ca31d6987ce719d81ca5
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java
index ed8f450c53..cc6c252fa1 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java
@@ -530,9 +530,10 @@ class WalkFetchConnection extends BaseFetchConnection {
// are unusable and we shouldn't consult them again.
//
try {
- if (pack.tmpIdx != null)
+ if (pack.tmpIdx != null) {
FileUtils.delete(pack.tmpIdx);
- } catch (IOException e) {
+ }
+ } catch (Throwable e) {
if (e1 != null) {
e.addSuppressed(e1);
}