]> source.dussan.org Git - jgit.git/commitdiff
[errorprone] Fix pattern FutureReturnValueIgnored 22/1194022/3
authorMatthias Sohn <matthias.sohn@sap.com>
Sun, 28 Apr 2024 23:37:28 +0000 (01:37 +0200)
committerMatthias Sohn <matthias.sohn@sap.com>
Mon, 29 Apr 2024 13:20:42 +0000 (15:20 +0200)
See https://errorprone.info/bugpattern/FutureReturnValueIgnored

Change-Id: I7225fd6388ce70ed5eea9e61b29bd10e1a927acb

org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcKeepFilesTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/pack/GcCommitSelectionTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackHandleDeletedPackFileTest.java
tools/BUILD

index 9a2935f136e164e8e1fc12772db79c0bb408d811..e1b6778c0edecca9fbaef6d6e332550f1cd82c01 100644 (file)
@@ -162,7 +162,7 @@ public class GcKeepFilesTest extends GcTestCase {
        private void testKeptObjectsAreIncluded() throws Exception {
                BranchBuilder bb = tr.branch("refs/heads/master");
                ObjectId commitObjectInLockedPack = bb.commit().create().toObjectId();
-               gc.gc();
+               gc.gc().get();
                stats = gc.getStatistics();
                assertEquals(COMMIT_AND_TREE_OBJECTS, stats.numberOfPackedObjects);
                assertEquals(1, stats.numberOfPackFiles);
@@ -170,7 +170,7 @@ public class GcKeepFilesTest extends GcTestCase {
                                .createNewFile());
 
                bb.commit().create();
-               gc.gc();
+               gc.gc().get();
                stats = gc.getStatistics();
                assertEquals(2 * COMMIT_AND_TREE_OBJECTS + 1,
                                stats.numberOfPackedObjects);
@@ -194,7 +194,7 @@ public class GcKeepFilesTest extends GcTestCase {
        private void testKeptObjectsAreNotIncluded() throws Exception {
                BranchBuilder bb = tr.branch("refs/heads/master");
                ObjectId commitObjectInLockedPack = bb.commit().create().toObjectId();
-               gc.gc();
+               gc.gc().get();
                stats = gc.getStatistics();
                assertEquals(COMMIT_AND_TREE_OBJECTS, stats.numberOfPackedObjects);
                assertEquals(1, stats.numberOfPackFiles);
@@ -202,7 +202,7 @@ public class GcKeepFilesTest extends GcTestCase {
                                .createNewFile());
 
                bb.commit().create();
-               gc.gc();
+               gc.gc().get();
                stats = gc.getStatistics();
                assertEquals(COMMIT_AND_TREE_OBJECTS + 1, stats.numberOfPackedObjects);
                assertEquals(2, stats.numberOfPackFiles);
index 0c09ad1510ccbca680d0fc5815e11a83ac23b147..ecf9a15b031de482cb007eac05624a7f270852dc 100644 (file)
@@ -110,7 +110,7 @@ public class GcCommitSelectionTest extends GcTestCase {
                tr.branch(mainBranch).update(commit1);
 
                gc.setExpireAgeMillis(0);
-               gc.gc();
+               gc.gc().get();
 
                // Create only 2 bitmaps, for commit0 and commit1, excluding commit2
                assertEquals(2, gc.getStatistics().numberOfBitmaps);
@@ -227,7 +227,7 @@ public class GcCommitSelectionTest extends GcTestCase {
                PackConfig packConfig = new PackConfig();
                packConfig.setBitmapExcludedRefsPrefixes(new String[] { "refs/heads/other" });
                gc.setPackConfig(packConfig);
-               gc.gc();
+               gc.gc().get();
                assertEquals(1,
                        gc.getStatistics().numberOfBitmaps);
        }
index 118eb984d08f011e5b0851bd603ad3a7d07697c1..097b84974f6814f58f14dc0ae0666d28daf786e3 100644 (file)
@@ -102,7 +102,7 @@ public class UploadPackHandleDeletedPackFileTest
                                        try {
                                                addNewCommit();
 
-                                               new GC(remote.getRepository()).gc();
+                                               new GC(remote.getRepository()).gc().get();
 
                                                pack.getPackFile().create(packExt).delete();
                                        } catch (Exception e) {
@@ -136,7 +136,7 @@ public class UploadPackHandleDeletedPackFileTest
                                .create();
                remote.update("master", commit0);
 
-               new GC(remote.getRepository()).gc(); // create pack files
+               new GC(remote.getRepository()).gc().get(); // create pack files
 
                head = remote.commit().message("1").parent(commit0)
                                .add("test1.txt", remote.blob("1"))
index 14e15795c7c41617ede4675bb8bbab271134f870..4c3bffb9d263495638bba78539111d015a92d16d 100644 (file)
@@ -158,7 +158,7 @@ java_package_configuration(
         "-Xep:FromTemporalAccessor:ERROR",
         "-Xep:FunctionalInterfaceClash:ERROR",
         "-Xep:FunctionalInterfaceMethodChanged:ERROR",
-        "-Xep:FutureReturnValueIgnored:WARN",
+        "-Xep:FutureReturnValueIgnored:ERROR",
         "-Xep:FuturesGetCheckedIllegalExceptionType:ERROR",
         "-Xep:GetClassOnAnnotation:ERROR",
         "-Xep:GetClassOnClass:ERROR",