Skip to content

Commit

Permalink
Remove "nullness" suppressions added in CL 152864813.
Browse files Browse the repository at this point in the history
They are only necessary when running the Checker Framework, and we don't.
(And they won't be necessary for the Checker Framework, either, after its' upgraded.)

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=153184952
  • Loading branch information
cpovirk committed Apr 14, 2017
1 parent ce9b72a commit fc77a95
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ private void runConcurrentTest(int numberOfThreads, final Callable<Void> callabl
final CountDownLatch startLatch = new CountDownLatch(numberOfThreads);
final CountDownLatch doneLatch = new CountDownLatch(numberOfThreads);
for (int i = numberOfThreads; i > 0; i--) {
@SuppressWarnings({"unused", "nullness"}) // go/futurereturn-lsc
@SuppressWarnings("unused") // go/futurereturn-lsc
Future<?> possiblyIgnoredError =
executorService.submit(
new Callable<Void>() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ enum Impl {
final AtomicInteger integer = new AtomicInteger();
// Execute a bunch of tasks to ensure that our threads are allocated and hot
for (int i = 0; i < NUM_THREADS * 10; i++) {
@SuppressWarnings({"unused", "nullness"}) // go/futurereturn-lsc
@SuppressWarnings("unused") // go/futurereturn-lsc
Future<?> possiblyIgnoredError =
executorService.submit(
new Runnable() {
Expand Down Expand Up @@ -282,10 +282,10 @@ public Object measureSize() {
list = impl.newExecutionList();
listenerLatch = new CountDownLatch(numListeners * NUM_THREADS);
for (int j = 0; j < NUM_THREADS; j++) {
@SuppressWarnings({"unused", "nullness"}) // go/futurereturn-lsc
@SuppressWarnings("unused") // go/futurereturn-lsc
Future<?> possiblyIgnoredError = executorService.submit(addTask);
}
@SuppressWarnings({"unused", "nullness"}) // go/futurereturn-lsc
@SuppressWarnings("unused") // go/futurereturn-lsc
Future<?> possiblyIgnoredError = executorService.submit(executeTask);
returnValue += (int) listenerLatch.getCount();
listenerLatch.await();
Expand All @@ -305,10 +305,10 @@ public Object measureSize() {
for (int i = 0; i < reps; i++) {
list = impl.newExecutionList();
listenerLatch = new CountDownLatch(numListeners * NUM_THREADS);
@SuppressWarnings({"unused", "nullness"}) // go/futurereturn-lsc
@SuppressWarnings("unused") // go/futurereturn-lsc
Future<?> possiblyIgnoredError = executorService.submit(executeTask);
for (int j = 0; j < NUM_THREADS; j++) {
@SuppressWarnings({"unused", "nullness"}) // go/futurereturn-lsc
@SuppressWarnings("unused") // go/futurereturn-lsc
Future<?> possiblyIgnoredError1 = executorService.submit(addTask);
}
returnValue += (int) listenerLatch.getCount();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ public void testRemovalNotification_clear_basher() throws InterruptedException {
final CountDownLatch tasksFinished = new CountDownLatch(nTasks);
for (int i = 0; i < nTasks; i++) {
final String s = "a" + i;
@SuppressWarnings({"unused", "nullness"}) // go/futurereturn-lsc
@SuppressWarnings("unused") // go/futurereturn-lsc
Future<?> possiblyIgnoredError =
threadPool.submit(
new Runnable() {
Expand Down Expand Up @@ -568,7 +568,7 @@ public void testRemovalNotification_get_basher() throws InterruptedException {

ExecutorService threadPool = Executors.newFixedThreadPool(nThreads);
for (int i = 0; i < nTasks; i++) {
@SuppressWarnings({"unused", "nullness"}) // go/futurereturn-lsc
@SuppressWarnings("unused") // go/futurereturn-lsc
Future<?> possiblyIgnoredError =
threadPool.submit(
new Runnable() {
Expand Down
4 changes: 2 additions & 2 deletions guava-tests/test/com/google/common/cache/CacheLoaderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public Map<Object, Object> loadAll(Iterable<? extends Object> keys) {
assertEquals(0, loadAllCount.get());

baseLoader.load(new Object());
@SuppressWarnings({"unused", "nullness"}) // go/futurereturn-lsc
@SuppressWarnings("unused") // go/futurereturn-lsc
Future<?> possiblyIgnoredError = baseLoader.reload(new Object(), new Object());
baseLoader.loadAll(ImmutableList.of(new Object()));
assertEquals(1, loadCount.get());
Expand All @@ -90,7 +90,7 @@ public Map<Object, Object> loadAll(Iterable<? extends Object> keys) {
CacheLoader.asyncReloading(baseLoader, executor);

asyncReloader.load(new Object());
@SuppressWarnings({"unused", "nullness"}) // go/futurereturn-lsc
@SuppressWarnings("unused") // go/futurereturn-lsc
Future<?> possiblyIgnoredError1 = asyncReloader.reload(new Object(), new Object());
asyncReloader.loadAll(ImmutableList.of(new Object()));
assertEquals(2, loadCount.get());
Expand Down
20 changes: 10 additions & 10 deletions guava-tests/test/com/google/common/collect/QueuesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,15 @@ public void testMultipleProducers() throws Exception {

private void testMultipleProducers(BlockingQueue<Object> q) throws InterruptedException {
for (boolean interruptibly : new boolean[] {true, false}) {
@SuppressWarnings({"unused", "nullness"}) // go/futurereturn-lsc
@SuppressWarnings("unused") // go/futurereturn-lsc
Future<?> possiblyIgnoredError = threadPool.submit(new Producer(q, 20));
@SuppressWarnings({"unused", "nullness"}) // go/futurereturn-lsc
@SuppressWarnings("unused") // go/futurereturn-lsc
Future<?> possiblyIgnoredError1 = threadPool.submit(new Producer(q, 20));
@SuppressWarnings({"unused", "nullness"}) // go/futurereturn-lsc
@SuppressWarnings("unused") // go/futurereturn-lsc
Future<?> possiblyIgnoredError2 = threadPool.submit(new Producer(q, 20));
@SuppressWarnings({"unused", "nullness"}) // go/futurereturn-lsc
@SuppressWarnings("unused") // go/futurereturn-lsc
Future<?> possiblyIgnoredError3 = threadPool.submit(new Producer(q, 20));
@SuppressWarnings({"unused", "nullness"}) // go/futurereturn-lsc
@SuppressWarnings("unused") // go/futurereturn-lsc
Future<?> possiblyIgnoredError4 = threadPool.submit(new Producer(q, 20));

List<Object> buf = newArrayList();
Expand Down Expand Up @@ -182,7 +182,7 @@ public void testNegativeMaxElements() throws Exception {
}

private void testNegativeMaxElements(BlockingQueue<Object> q) throws InterruptedException {
@SuppressWarnings({"unused", "nullness"}) // go/futurereturn-lsc
@SuppressWarnings("unused") // go/futurereturn-lsc
Future<?> possiblyIgnoredError = threadPool.submit(new Producer(q, 1));

List<Object> buf = newArrayList();
Expand All @@ -201,7 +201,7 @@ public void testDrain_throws() throws Exception {
}

private void testDrain_throws(BlockingQueue<Object> q) {
@SuppressWarnings({"unused", "nullness"}) // go/futurereturn-lsc
@SuppressWarnings("unused") // go/futurereturn-lsc
Future<?> possiblyIgnoredError = threadPool.submit(new Interrupter(currentThread()));
try {
Queues.drain(q, ImmutableList.of(), 100, MAX_VALUE, NANOSECONDS);
Expand All @@ -218,7 +218,7 @@ public void testDrainUninterruptibly_doesNotThrow() throws Exception {

private void testDrainUninterruptibly_doesNotThrow(final BlockingQueue<Object> q) {
final Thread mainThread = currentThread();
@SuppressWarnings({"unused", "nullness"}) // go/futurereturn-lsc
@SuppressWarnings("unused") // go/futurereturn-lsc
Future<?> possiblyIgnoredError =
threadPool.submit(
new Callable<Void>() {
Expand Down Expand Up @@ -275,7 +275,7 @@ private void assertInterruptibleDrained(BlockingQueue<Object> q) {
}

// but does the wait actually occurs?
@SuppressWarnings({"unused", "nullness"}) // go/futurereturn-lsc
@SuppressWarnings("unused") // go/futurereturn-lsc
Future<?> possiblyIgnoredError = threadPool.submit(new Interrupter(currentThread()));
try {
// if waiting works, this should get stuck
Expand All @@ -291,7 +291,7 @@ private void assertUninterruptibleDrained(BlockingQueue<Object> q) {
assertEquals(0, Queues.drainUninterruptibly(q, ImmutableList.of(), 0, 10, MILLISECONDS));

// but does the wait actually occurs?
@SuppressWarnings({"unused", "nullness"}) // go/futurereturn-lsc
@SuppressWarnings("unused") // go/futurereturn-lsc
Future<?> possiblyIgnoredError = threadPool.submit(new Interrupter(currentThread()));

Stopwatch timer = Stopwatch.createStarted();
Expand Down
2 changes: 1 addition & 1 deletion guava-tests/test/com/google/common/io/MoreFilesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ public void testDeleteRecursively_nonDirectoryFile() throws IOException {
*/
private static void startDirectorySymlinkSwitching(
final Path file, final Path target, ExecutorService executor) {
@SuppressWarnings({"unused", "nullness"}) // go/futurereturn-lsc
@SuppressWarnings("unused") // go/futurereturn-lsc
Future<?> possiblyIgnoredError =
executor.submit(
new Runnable() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ public void testFutureBash() {
final AbstractFuture<String> future = new AbstractFuture<String>() {};
currentFuture.set(future);
for (Callable<?> task : allTasks) {
@SuppressWarnings({"unused", "nullness"}) // go/futurereturn-lsc
@SuppressWarnings("unused") // go/futurereturn-lsc
Future<?> possiblyIgnoredError = executor.submit(task);
}
awaitUnchecked(barrier);
Expand Down Expand Up @@ -580,7 +580,7 @@ public void testSetFutureCancelBash_withDoneFuture() {
final AbstractFuture<String> future = new AbstractFuture<String>() {};
currentFuture.set(future);
for (Callable<?> task : allTasks) {
@SuppressWarnings({"unused", "nullness"}) // go/futurereturn-lsc
@SuppressWarnings("unused") // go/futurereturn-lsc
Future<?> possiblyIgnoredError = executor.submit(task);
}
awaitUnchecked(barrier);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ public void testModify_basher() throws InterruptedException {

ExecutorService threadPool = Executors.newFixedThreadPool(nThreads);
for (int i = 0; i < nTasks; i++) {
@SuppressWarnings({"unused", "nullness"}) // go/futurereturn-lsc
@SuppressWarnings("unused") // go/futurereturn-lsc
Future<?> possiblyIgnoredError =
threadPool.submit(
new Runnable() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1725,7 +1725,7 @@ public ListenableFuture<Integer> apply(String input) throws Exception {

// Pause the executor.
final CountDownLatch beforeFunction = new CountDownLatch(1);
@SuppressWarnings({"unused", "nullness"}) // go/futurereturn-lsc
@SuppressWarnings("unused") // go/futurereturn-lsc
Future<?> possiblyIgnoredError =
executor.submit(
new Runnable() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ public void testSchedule() {
MockExecutor mock = new MockExecutor();
TestExecutor testExecutor = new TestExecutor(mock);

@SuppressWarnings({"unused", "nullness"}) // go/futurereturn-lsc
@SuppressWarnings("unused") // go/futurereturn-lsc
Future<?> possiblyIgnoredError = testExecutor.schedule(DO_NOTHING, 10, TimeUnit.MINUTES);
mock.assertLastMethodCalled("scheduleRunnable", 10, TimeUnit.MINUTES);

@SuppressWarnings({"unused", "nullness"}) // go/futurereturn-lsc
@SuppressWarnings("unused") // go/futurereturn-lsc
Future<?> possiblyIgnoredError1 =
testExecutor.schedule(Executors.callable(DO_NOTHING), 5, TimeUnit.SECONDS);
mock.assertLastMethodCalled("scheduleCallable", 5, TimeUnit.SECONDS);
Expand All @@ -59,12 +59,12 @@ public void testSchedule() {
public void testSchedule_repeating() {
MockExecutor mock = new MockExecutor();
TestExecutor testExecutor = new TestExecutor(mock);
@SuppressWarnings({"unused", "nullness"}) // go/futurereturn-lsc
@SuppressWarnings("unused") // go/futurereturn-lsc
Future<?> possiblyIgnoredError =
testExecutor.scheduleWithFixedDelay(DO_NOTHING, 100, 10, TimeUnit.MINUTES);
mock.assertLastMethodCalled("scheduleWithFixedDelay", 100, 10, TimeUnit.MINUTES);

@SuppressWarnings({"unused", "nullness"}) // go/futurereturn-lsc
@SuppressWarnings("unused") // go/futurereturn-lsc
Future<?> possiblyIgnoredError1 =
testExecutor.scheduleAtFixedRate(DO_NOTHING, 3, 7, TimeUnit.SECONDS);
mock.assertLastMethodCalled("scheduleAtFixedRate", 3, 7, TimeUnit.SECONDS);
Expand Down

0 comments on commit fc77a95

Please sign in to comment.