diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2023-05-19 13:49:42 -0400 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org <gerrit@eclipse.org> | 2023-05-19 13:49:42 -0400 |
commit | 0eedb1affbf4b0ea5f0e036bfde0b9e2ec0e6d6a (patch) | |
tree | 12f78a632c9f0268dc1e0dc31f9a045d44061303 /org.eclipse.jgit | |
parent | 334852c52fa1a926104f59ed1ab2dfaa80fa6d50 (diff) | |
parent | 2cbf0c1774ed0529fc4910c768452902e346ff23 (diff) | |
download | jgit-0eedb1affbf4b0ea5f0e036bfde0b9e2ec0e6d6a.tar.gz jgit-0eedb1affbf4b0ea5f0e036bfde0b9e2ec0e6d6a.zip |
Merge "Also add suppressed exception if unchecked exception occurs in finally"
Diffstat (limited to 'org.eclipse.jgit')
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); } |