]> source.dussan.org Git - jgit.git/commitdiff
[errorprone] Suppress [Finally] warnings 99/200299/2
authorMatthias Sohn <matthias.sohn@sap.com>
Thu, 2 Mar 2023 09:43:10 +0000 (10:43 +0100)
committerMatthias Sohn <matthias.sohn@sap.com>
Thu, 2 Mar 2023 22:33:27 +0000 (23:33 +0100)
In these cases we use Throwable#addSuppressed to ensure the exception
thrown in the catch block preceding the finally block throwing another
exception isn't lost.

Change-Id: I96e78a5c15238ab77ac90ca1901850ce19acfcd8

org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchProcess.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java

index e0eb1264408e14ff5ac04d2d5d49e62ca9e6fd31..f02160e4579b3a126ce9a8670cbed16f6c532a25 100644 (file)
@@ -90,6 +90,7 @@ class FetchProcess {
                                .collect(Collectors.toList());
        }
 
+       @SuppressWarnings("Finally")
        void execute(ProgressMonitor monitor, FetchResult result,
                        String initialBranch)
                        throws NotSupportedException, TransportException {
index d67fe074e4436edaf3deec317f36398357b2eabe..ed8f450c53873cd5ced1318d720f5d9c1a8be5ef 100644 (file)
@@ -470,6 +470,7 @@ class WalkFetchConnection extends BaseFetchConnection {
                }
        }
 
+       @SuppressWarnings("Finally")
        private boolean downloadPackedObject(final ProgressMonitor monitor,
                        final AnyObjectId id) throws TransportException {
                // Search for the object in a remote pack whose index we have,