From 04245494bbbc45b989cdc75faa585ab61ec2e8c3 Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Tue, 13 Dec 2022 15:04:45 +0100 Subject: [PATCH] CommitGraphWriter: fix UnusedException errorprone error Errorprone run in the bazel build raised this exception: org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/commitgraph/CommitGraphWriter.java:105: error: [UnusedException] This catch block catches an exception and re-throws another, but swallows the caught exception rather than setting it as a cause. This can make debugging harder. } catch (InterruptedIOException e) { ^ (see https://errorprone.info/bugpattern/UnusedException) Did you mean 'throw new IOException(JGitText.get().commitGraphWritingCancelled, e);'? Change-Id: Iad832fe17955fc1e60e6a4902bc50fd9dca76b9d --- .../jgit/internal/storage/commitgraph/CommitGraphWriter.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/commitgraph/CommitGraphWriter.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/commitgraph/CommitGraphWriter.java index 2f96c4d77..a58a9eb63 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/commitgraph/CommitGraphWriter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/commitgraph/CommitGraphWriter.java @@ -103,7 +103,8 @@ public void write(@NonNull ProgressMonitor monitor, writeChunks(monitor, out, chunks); writeCheckSum(out); } catch (InterruptedIOException e) { - throw new IOException(JGitText.get().commitGraphWritingCancelled); + throw new IOException(JGitText.get().commitGraphWritingCancelled, + e); } finally { monitor.endTask(); }