aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2023-05-19 13:49:42 -0400
committerGerrit Code Review @ Eclipse.org <gerrit@eclipse.org>2023-05-19 13:49:42 -0400
commit0eedb1affbf4b0ea5f0e036bfde0b9e2ec0e6d6a (patch)
tree12f78a632c9f0268dc1e0dc31f9a045d44061303 /org.eclipse.jgit
parent334852c52fa1a926104f59ed1ab2dfaa80fa6d50 (diff)
parent2cbf0c1774ed0529fc4910c768452902e346ff23 (diff)
downloadjgit-0eedb1affbf4b0ea5f0e036bfde0b9e2ec0e6d6a.tar.gz
jgit-0eedb1affbf4b0ea5f0e036bfde0b9e2ec0e6d6a.zip
Merge "Also add suppressed exception if unchecked exception occurs in finally"
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java5
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchProcess.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java5
3 files changed, 9 insertions, 3 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java
index 666e9d8cbc..9508f3fe39 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java
@@ -1723,6 +1723,11 @@ public class PackWriter implements AutoCloseable {
}
throw new IOException(JGitText
.get().packingCancelledDuringObjectsWriting, e);
+ } catch (Throwable e) {
+ if (e1 != null) {
+ e.addSuppressed(e1);
+ }
+ throw e;
}
}
}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchProcess.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchProcess.java
index f02160e457..c510194ee6 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchProcess.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchProcess.java
@@ -111,7 +111,7 @@ class FetchProcess {
for (PackLock lock : packLocks) {
lock.unlock();
}
- } catch (IOException e) {
+ } catch (Throwable e) {
if (e1 != null) {
e.addSuppressed(e1);
}
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);
}