Skip to content

Commit

Permalink
(Re)suppress deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrannen committed Oct 30, 2024
1 parent 79cf554 commit f427ac3
Show file tree
Hide file tree
Showing 23 changed files with 48 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
* @see org.springframework.core.task.TaskExecutor
* @see SchedulerFactoryBean#setTaskExecutor
*/
@SuppressWarnings("removal")
@SuppressWarnings({"deprecation", "removal"})
public class SimpleThreadPoolTaskExecutor extends SimpleThreadPool
implements AsyncListenableTaskExecutor, SchedulingTaskExecutor, InitializingBean, DisposableBean {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ protected Object[] resolveArguments(ApplicationEvent event) {
return new Object[] {event};
}

@SuppressWarnings({"removal", "unchecked"})
@SuppressWarnings({"removal", "unchecked", "deprecation"})
protected void handleResult(Object result) {
if (reactiveStreamsPresent && new ReactiveResultHandler().subscribeToPublisher(result)) {
if (logger.isTraceEnabled()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
* @see DefaultManagedTaskExecutor
* @see ThreadPoolTaskExecutor
*/
@SuppressWarnings("removal")
@SuppressWarnings({"deprecation", "removal"})
public class ConcurrentTaskExecutor implements AsyncListenableTaskExecutor, SchedulingTaskExecutor {

private static final Executor STUB_EXECUTOR = (task -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,13 +218,13 @@ public <T> Future<T> submit(Callable<T> task) {
return super.submit(new DelegatingErrorHandlingCallable<>(task, this.errorHandler));
}

@SuppressWarnings("removal")
@SuppressWarnings({"deprecation", "removal"})
@Override
public org.springframework.util.concurrent.ListenableFuture<?> submitListenable(Runnable task) {
return super.submitListenable(TaskUtils.decorateTaskWithErrorHandler(task, this.errorHandler, false));
}

@SuppressWarnings("removal")
@SuppressWarnings({"deprecation", "removal"})
@Override
public <T> org.springframework.util.concurrent.ListenableFuture<T> submitListenable(Callable<T> task) {
return super.submitListenable(new DelegatingErrorHandlingCallable<>(task, this.errorHandler));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,13 +269,13 @@ public <T> Future<T> submit(Callable<T> task) {
return super.submit(new DelegatingErrorHandlingCallable<>(task, this.errorHandler));
}

@SuppressWarnings("removal")
@SuppressWarnings({"deprecation", "removal"})
@Override
public org.springframework.util.concurrent.ListenableFuture<?> submitListenable(Runnable task) {
return super.submitListenable(TaskUtils.decorateTaskWithErrorHandler(task, this.errorHandler, false));
}

@SuppressWarnings("removal")
@SuppressWarnings({"deprecation", "removal"})
@Override
public <T> org.springframework.util.concurrent.ListenableFuture<T> submitListenable(Callable<T> task) {
return super.submitListenable(new DelegatingErrorHandlingCallable<>(task, this.errorHandler));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
* @see ThreadPoolExecutorFactoryBean
* @see ConcurrentTaskExecutor
*/
@SuppressWarnings({"serial", "removal"})
@SuppressWarnings({"serial", "deprecation", "removal"})
public class ThreadPoolTaskExecutor extends ExecutorConfigurationSupport
implements AsyncListenableTaskExecutor, SchedulingTaskExecutor {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
* @see ThreadPoolTaskExecutor
* @see SimpleAsyncTaskScheduler
*/
@SuppressWarnings({"serial", "removal"})
@SuppressWarnings({"serial", "deprecation", "removal"})
public class ThreadPoolTaskScheduler extends ExecutorConfigurationSupport
implements AsyncListenableTaskExecutor, SchedulingTaskExecutor, TaskScheduler {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ void collectionReplyNullValue() {
}

@Test
@SuppressWarnings("removal")
@SuppressWarnings({"deprecation", "removal"})
void listenableFutureReply() {
load(TestEventListener.class, ReplyEventListener.class);
org.springframework.util.concurrent.SettableListenableFuture<String> future =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ private interface ITestBean {

Future<Object> failWithFuture();

@SuppressWarnings("deprecation")
@SuppressWarnings({"deprecation", "removal"})
org.springframework.util.concurrent.ListenableFuture<Object> failWithListenableFuture();

void failWithVoid();
Expand Down Expand Up @@ -310,7 +310,7 @@ public Future<Object> failWithFuture() {

@Async
@Override
@SuppressWarnings("deprecation")
@SuppressWarnings({"deprecation", "removal"})
public org.springframework.util.concurrent.ListenableFuture<Object> failWithListenableFuture() {
throw new UnsupportedOperationException("failWithListenableFuture");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
* @author Juergen Hoeller
* @author Chris Beams
*/
@SuppressWarnings({ "resource", "deprecation" })
@SuppressWarnings({"resource", "deprecation", "removal"})
class AsyncExecutionTests {

private static String originalThreadName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
class AsyncResultTests {

@Test
@SuppressWarnings("removal")
@SuppressWarnings({ "deprecation", "removal" })
public void asyncResultWithCallbackAndValue() throws Exception {
String value = "val";
final Set<String> values = new HashSet<>(1);
Expand All @@ -54,7 +54,7 @@ public void onFailure(Throwable ex) {
}

@Test
@SuppressWarnings("removal")
@SuppressWarnings({ "deprecation", "removal" })
public void asyncResultWithCallbackAndException() {
IOException ex = new IOException();
final Set<Throwable> values = new HashSet<>(1);
Expand All @@ -71,15 +71,15 @@ public void onFailure(Throwable ex) {
});
assertThat(values).singleElement().isSameAs(ex);
assertThatExceptionOfType(ExecutionException.class)
.isThrownBy(future::get)
.withCause(ex);
.isThrownBy(future::get)
.withCause(ex);
assertThatExceptionOfType(ExecutionException.class)
.isThrownBy(future.completable()::get)
.withCause(ex);
.isThrownBy(future.completable()::get)
.withCause(ex);
}

@Test
@SuppressWarnings("removal")
@SuppressWarnings({ "deprecation", "removal" })
public void asyncResultWithSeparateCallbacksAndValue() throws Exception {
String value = "val";
final Set<String> values = new HashSet<>(1);
Expand All @@ -92,19 +92,19 @@ public void asyncResultWithSeparateCallbacksAndValue() throws Exception {
}

@Test
@SuppressWarnings("removal")
@SuppressWarnings({ "deprecation", "removal" })
public void asyncResultWithSeparateCallbacksAndException() {
IOException ex = new IOException();
final Set<Throwable> values = new HashSet<>(1);
org.springframework.util.concurrent.ListenableFuture<String> future = AsyncResult.forExecutionException(ex);
future.addCallback(result -> new AssertionError("Success callback not expected: " + result), values::add);
assertThat(values).singleElement().isSameAs(ex);
assertThatExceptionOfType(ExecutionException.class)
.isThrownBy(future::get)
.withCause(ex);
.isThrownBy(future::get)
.withCause(ex);
assertThatExceptionOfType(ExecutionException.class)
.isThrownBy(future.completable()::get)
.withCause(ex);
.isThrownBy(future.completable()::get)
.withCause(ex);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ void submitRunnableWithGetAfterShutdown() throws Exception {
}

@Test
@SuppressWarnings("removal")
@SuppressWarnings({ "deprecation", "removal" })
void submitListenableRunnable() {
TestTask task = new TestTask(this.testName, 1);
// Act
Expand Down Expand Up @@ -156,7 +156,7 @@ void submitCompletableRunnable() {
}

@Test
@SuppressWarnings("removal")
@SuppressWarnings({ "deprecation", "removal" })
void submitFailingListenableRunnable() {
TestTask task = new TestTask(this.testName, 0);
org.springframework.util.concurrent.ListenableFuture<?> future = executor.submitListenable(task);
Expand Down Expand Up @@ -185,7 +185,7 @@ void submitFailingCompletableRunnable() {
}

@Test
@SuppressWarnings("removal")
@SuppressWarnings({ "deprecation", "removal" })
void submitListenableRunnableWithGetAfterShutdown() throws Exception {
org.springframework.util.concurrent.ListenableFuture<?> future1 = executor.submitListenable(new TestTask(this.testName, -1));
org.springframework.util.concurrent.ListenableFuture<?> future2 = executor.submitListenable(new TestTask(this.testName, -1));
Expand Down Expand Up @@ -260,7 +260,7 @@ void submitCallableWithGetAfterShutdown() throws Exception {
}

@Test
@SuppressWarnings("removal")
@SuppressWarnings({ "deprecation", "removal" })
void submitListenableCallable() {
TestCallable task = new TestCallable(this.testName, 1);
// Act
Expand All @@ -275,7 +275,7 @@ void submitListenableCallable() {
}

@Test
@SuppressWarnings("removal")
@SuppressWarnings({ "deprecation", "removal" })
void submitFailingListenableCallable() {
TestCallable task = new TestCallable(this.testName, 0);
// Act
Expand All @@ -291,7 +291,7 @@ void submitFailingListenableCallable() {
}

@Test
@SuppressWarnings("removal")
@SuppressWarnings({ "deprecation", "removal" })
void submitListenableCallableWithGetAfterShutdown() throws Exception {
org.springframework.util.concurrent.ListenableFuture<?> future1 = executor.submitListenable(new TestCallable(this.testName, -1));
org.springframework.util.concurrent.ListenableFuture<?> future2 = executor.submitListenable(new TestCallable(this.testName, -1));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
* @see java.util.concurrent.ExecutorService
* @see java.util.concurrent.Executors
*/
@SuppressWarnings("removal")
@SuppressWarnings({"deprecation", "removal"})
public class TaskExecutorAdapter implements AsyncListenableTaskExecutor {

private final Executor concurrentExecutor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* @author Arjen Poutsma
* @author Sebastien Deleuze
*/
@SuppressWarnings("removal")
@SuppressWarnings({"deprecation", "removal"})
class ListenableFutureTaskTests {

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*
* @author Rossen Stoyanchev
*/
@SuppressWarnings("removal")
@SuppressWarnings({"deprecation", "removal"})
class MonoToListenableFutureAdapterTests {

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
* @author Mattias Severson
* @author Juergen Hoeller
*/
@SuppressWarnings("removal")
@SuppressWarnings({"deprecation", "removal"})
class SettableListenableFutureTests {

private final SettableListenableFuture<String> settableListenableFuture = new SettableListenableFuture<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ public void handleFoo() {

@Controller
@MessageMapping("listenable-future")
@SuppressWarnings("removal")
@SuppressWarnings({"deprecation", "removal"})
private static class ListenableFutureController {

org.springframework.util.concurrent.ListenableFutureTask<String> future;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ DeferredResult<Person> getDeferredResultWithDelayedError() {
}

@GetMapping(params = "listenableFuture")
@SuppressWarnings("deprecation")
@SuppressWarnings({ "deprecation", "removal" })
org.springframework.util.concurrent.ListenableFuture<Person> getListenableFuture() {
org.springframework.util.concurrent.ListenableFutureTask<Person> futureTask =
new org.springframework.util.concurrent.ListenableFutureTask<>(() -> new Person("Joe"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ DeferredResult<Person> getDeferredResultWithDelayedError() {
}

@RequestMapping(params = "listenableFuture")
@SuppressWarnings("deprecation")
@SuppressWarnings({"deprecation", "removal"})
org.springframework.util.concurrent.ListenableFuture<Person> getListenableFuture() {
org.springframework.util.concurrent.ListenableFutureTask<Person> futureTask =
new org.springframework.util.concurrent.ListenableFutureTask<>(() -> new Person("Joe"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
*/
public class DeferredResultMethodReturnValueHandler implements HandlerMethodReturnValueHandler {

@SuppressWarnings("removal")
@SuppressWarnings({"deprecation", "removal"})
@Override
public boolean supportsReturnType(MethodParameter returnType) {
Class<?> type = returnType.getParameterType();
Expand All @@ -46,7 +46,7 @@ public boolean supportsReturnType(MethodParameter returnType) {
CompletionStage.class.isAssignableFrom(type));
}

@SuppressWarnings("removal")
@SuppressWarnings({"deprecation", "removal"})
@Override
public void handleReturnValue(@Nullable Object returnValue, MethodParameter returnType,
ModelAndViewContainer mavContainer, NativeWebRequest webRequest) throws Exception {
Expand Down Expand Up @@ -75,7 +75,7 @@ else if (returnValue instanceof CompletionStage<?> completionStage) {
WebAsyncUtils.getAsyncManager(webRequest).startDeferredResultProcessing(result, mavContainer);
}

@SuppressWarnings("removal")
@SuppressWarnings({"deprecation", "removal"})
private DeferredResult<Object> adaptListenableFuture(org.springframework.util.concurrent.ListenableFuture<?> future) {
DeferredResult<Object> result = new DeferredResult<>();
future.addCallback(new org.springframework.util.concurrent.ListenableFutureCallback<Object>() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void setup() throws Exception {


@Test
@SuppressWarnings("removal")
@SuppressWarnings({"deprecation", "removal"})
public void supportsReturnType() throws Exception {
assertThat(this.handler.supportsReturnType(
on(TestController.class).resolveReturnType(DeferredResult.class, String.class))).isTrue();
Expand All @@ -88,7 +88,7 @@ void deferredResult() throws Exception {
}

@Test
@SuppressWarnings("removal")
@SuppressWarnings({"deprecation", "removal"})
public void listenableFuture() throws Exception {
org.springframework.util.concurrent.SettableListenableFuture<String> future =
new org.springframework.util.concurrent.SettableListenableFuture<>();
Expand All @@ -109,7 +109,7 @@ void deferredResultWithError() throws Exception {
}

@Test
@SuppressWarnings("removal")
@SuppressWarnings({"deprecation", "removal"})
public void listenableFutureWithError() throws Exception {
org.springframework.util.concurrent.SettableListenableFuture<String> future =
new org.springframework.util.concurrent.SettableListenableFuture<>();
Expand Down Expand Up @@ -150,7 +150,7 @@ static class TestController {

DeferredResult<String> handleDeferredResult() { return null; }

@SuppressWarnings("removal")
@SuppressWarnings({"deprecation", "removal"})
org.springframework.util.concurrent.ListenableFuture<String> handleListenableFuture() { return null; }

CompletableFuture<String> handleCompletableFuture() { return null; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public void setFallbackRequest(DefaultTransportRequest fallbackRequest) {


@Deprecated(since = "6.0", forRemoval = true)
@SuppressWarnings("removal")
@SuppressWarnings({"deprecation", "removal"})
public void connect(WebSocketHandler handler,
org.springframework.util.concurrent.SettableListenableFuture<WebSocketSession> future) {

Expand Down Expand Up @@ -208,7 +208,7 @@ public String toString() {
* to connect. Also implements {@code Runnable} to handle a scheduled timeout
* callback.
*/
@SuppressWarnings("removal")
@SuppressWarnings({"deprecation", "removal"})
private class ListenableConnectCallback implements
org.springframework.util.concurrent.ListenableFutureCallback<WebSocketSession>, Runnable {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void sendMessageError() {
}

@Test
@SuppressWarnings("deprecation")
@SuppressWarnings({"deprecation", "removal"})
void connect() {
HttpHeaders handshakeHeaders = new HttpHeaders();
handshakeHeaders.setOrigin("foo");
Expand Down

0 comments on commit f427ac3

Please sign in to comment.