ErrorProne: Increase severity of FutureReturnValueIgnored to ERROR
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>
This commit is contained in:
parent
518dc86380
commit
8bd0ba0f15
|
@ -44,6 +44,7 @@
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertFalse;
|
import static org.junit.Assert.assertFalse;
|
||||||
|
import static org.junit.Assert.assertNotNull;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
import static org.junit.Assert.fail;
|
import static org.junit.Assert.fail;
|
||||||
|
|
||||||
|
@ -56,6 +57,7 @@
|
||||||
import java.util.concurrent.CyclicBarrier;
|
import java.util.concurrent.CyclicBarrier;
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
|
import java.util.concurrent.Future;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import org.eclipse.jgit.lfs.lib.AnyLongObjectId;
|
import org.eclipse.jgit.lfs.lib.AnyLongObjectId;
|
||||||
|
@ -122,11 +124,12 @@ public void testParallelUploads() throws Exception {
|
||||||
ExecutorService e = Executors.newFixedThreadPool(count);
|
ExecutorService e = Executors.newFixedThreadPool(count);
|
||||||
try {
|
try {
|
||||||
for (Path p : paths) {
|
for (Path p : paths) {
|
||||||
e.submit(() -> {
|
Future<Object> result = e.submit(() -> {
|
||||||
barrier.await();
|
barrier.await();
|
||||||
putContent(p);
|
putContent(p);
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
|
assertNotNull(result);
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
e.shutdown();
|
e.shutdown();
|
||||||
|
|
|
@ -176,12 +176,13 @@ public boolean isForceUpdate() {
|
||||||
return update.update();
|
return update.update();
|
||||||
});
|
});
|
||||||
|
|
||||||
pool.submit(() -> {
|
Future<Result> result2 = pool.submit(() -> {
|
||||||
refUpdateLockedRef.await();
|
refUpdateLockedRef.await();
|
||||||
gc.packRefs();
|
gc.packRefs();
|
||||||
packRefsDone.await();
|
packRefsDone.await();
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
|
assertNull(result2.get());
|
||||||
|
|
||||||
assertSame(result.get(), Result.FORCED);
|
assertSame(result.get(), Result.FORCED);
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ java_package_configuration(
|
||||||
"-Xep:FragmentInjection:WARN",
|
"-Xep:FragmentInjection:WARN",
|
||||||
"-Xep:FragmentNotInstantiable:WARN",
|
"-Xep:FragmentNotInstantiable:WARN",
|
||||||
"-Xep:FunctionalInterfaceClash:WARN",
|
"-Xep:FunctionalInterfaceClash:WARN",
|
||||||
"-Xep:FutureReturnValueIgnored:WARN",
|
"-Xep:FutureReturnValueIgnored:ERROR",
|
||||||
"-Xep:GetClassOnEnum:WARN",
|
"-Xep:GetClassOnEnum:WARN",
|
||||||
"-Xep:ImmutableAnnotationChecker:WARN",
|
"-Xep:ImmutableAnnotationChecker:WARN",
|
||||||
"-Xep:ImmutableEnumChecker:WARN",
|
"-Xep:ImmutableEnumChecker:WARN",
|
||||||
|
|
Loading…
Reference in New Issue