Clean up warnings and polishing

This commit is contained in:
Sam Brannen
2022-07-31 14:14:56 +03:00
parent 9d1e9703ae
commit e4395f2f8b
55 changed files with 412 additions and 396 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -30,6 +30,7 @@ import static org.mockito.Mockito.mock;
/**
* @author Arjen Poutsma
*/
@SuppressWarnings("deprecation")
class FutureAdapterTests {
private FutureAdapter<String, Integer> adapter;
@@ -50,7 +51,7 @@ class FutureAdapterTests {
}
@Test
void cancel() throws Exception {
void cancel() {
given(adaptee.cancel(true)).willReturn(true);
boolean result = adapter.cancel(true);
assertThat(result).isTrue();
@@ -84,5 +85,4 @@ class FutureAdapterTests {
assertThat(result).isEqualTo("42");
}
}

View File

@@ -33,7 +33,7 @@ import static org.mockito.Mockito.verifyNoInteractions;
* @author Arjen Poutsma
* @author Sebastien Deleuze
*/
@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "deprecation" })
class ListenableFutureTaskTests {
@Test

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2021 the original author or authors.
* Copyright 2002-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,8 +27,10 @@ import static org.assertj.core.api.Assertions.assertThat;
/**
* Unit tests for {@link MonoToListenableFutureAdapter}.
*
* @author Rossen Stoyanchev
*/
@SuppressWarnings("deprecation")
class MonoToListenableFutureAdapterTests {
@Test
@@ -42,6 +44,7 @@ class MonoToListenableFutureAdapterTests {
}
@Test
@SuppressWarnings("deprecation")
void failure() {
Throwable expected = new IllegalStateException("oops");
AtomicReference<Object> actual = new AtomicReference<>();

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2021 the original author or authors.
* Copyright 2002-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -36,6 +36,7 @@ import static org.mockito.Mockito.verifyNoMoreInteractions;
* @author Mattias Severson
* @author Juergen Hoeller
*/
@SuppressWarnings("deprecation")
class SettableListenableFutureTests {
private final SettableListenableFuture<String> settableListenableFuture = new SettableListenableFuture<>();