Merge "Also add suppressed exception if unchecked exception occurs in finally"

This commit is contained in:
Matthias Sohn 2023-05-19 13:49:42 -04:00 committed by Gerrit Code Review @ Eclipse.org
commit 0eedb1affb
3 changed files with 9 additions and 3 deletions

View File

@ -1723,6 +1723,11 @@ private void parallelDeltaSearch(ProgressMonitor monitor,
}
throw new IOException(JGitText
.get().packingCancelledDuringObjectsWriting, e);
} catch (Throwable e) {
if (e1 != null) {
e.addSuppressed(e1);
}
throw e;
}
}
}

View File

@ -111,7 +111,7 @@ void execute(ProgressMonitor monitor, FetchResult result,
for (PackLock lock : packLocks) {
lock.unlock();
}
} catch (IOException e) {
} catch (Throwable e) {
if (e1 != null) {
e.addSuppressed(e1);
}

View File

@ -530,9 +530,10 @@ private boolean downloadPackedObject(final ProgressMonitor monitor,
// 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);
}