diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2020-11-29 00:34:41 +0100 |
---|---|---|
committer | Christian Halstrick <christian.halstrick@sap.com> | 2020-12-17 17:18:11 +0100 |
commit | c8c0556f76be89ab422e68e6296b3cd473ab8278 (patch) | |
tree | b04769401a0a58823fdda265682706c773deaa27 /org.eclipse.jgit | |
parent | 9680407e459be6a6239dfc14f02dd52efe7b5d32 (diff) | |
download | jgit-c8c0556f76be89ab422e68e6296b3cd473ab8278.tar.gz jgit-c8c0556f76be89ab422e68e6296b3cd473ab8278.zip |
[errorprone] FetchProcess: ensure exception isn't suppressed
If TransportException is thrown in the finally block of execute()
ensure that the exception handled in the previous catch block isn't
suppressed.
Change-Id: I670acdfb4d36e7a419a9a79ae9faab2e085a43ee
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchProcess.java | 7 |
1 files changed, 7 insertions, 0 deletions
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 0f1892a97e..45adfa6522 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchProcess.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchProcess.java @@ -87,13 +87,20 @@ class FetchProcess { packLocks.clear(); localRefs = null; + Throwable e1 = null; try { executeImp(monitor, result); + } catch (NotSupportedException | TransportException err) { + e1 = err; + throw err; } finally { try { for (PackLock lock : packLocks) lock.unlock(); } catch (IOException e) { + if (e1 != null) { + e.addSuppressed(e1); + } throw new TransportException(e.getMessage(), e); } } |