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>
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);
}
}