The only remaining code where the return value is ignored is in tests.
Update them to store the value and perform a basic assertion.
Change-Id: I29ef5bd5dd0648aac3490f9e47ecc74544109652
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.util.concurrent.CyclicBarrier;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import org.eclipse.jgit.lfs.lib.AnyLongObjectId;
ExecutorService e = Executors.newFixedThreadPool(count);
try {
for (Path p : paths) {
- e.submit(() -> {
+ Future<Object> result = e.submit(() -> {
barrier.await();
putContent(p);
return null;
});
+ assertNotNull(result);
}
} finally {
e.shutdown();
return update.update();
});
- pool.submit(() -> {
+ Future<Result> result2 = pool.submit(() -> {
refUpdateLockedRef.await();
gc.packRefs();
packRefsDone.await();
return null;
});
+ assertNull(result2.get());
assertSame(result.get(), Result.FORCED);
"-Xep:FragmentInjection:WARN",
"-Xep:FragmentNotInstantiable:WARN",
"-Xep:FunctionalInterfaceClash:WARN",
- "-Xep:FutureReturnValueIgnored:WARN",
+ "-Xep:FutureReturnValueIgnored:ERROR",
"-Xep:GetClassOnEnum:WARN",
"-Xep:ImmutableAnnotationChecker:WARN",
"-Xep:ImmutableEnumChecker:WARN",