Skip to content

Commit 1255bd1

Browse files
committed
Add remaining @SuppressWarnings("removal") for ListenableFuture
See gh-33780
1 parent a1f6098 commit 1255bd1

7 files changed

+17
-18
lines changed

Diff for: spring-context/src/test/java/org/springframework/scheduling/concurrent/AbstractSchedulingTaskExecutorTests.java

+8-8
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
*/
4848
abstract class AbstractSchedulingTaskExecutorTests {
4949

50-
@SuppressWarnings("deprecation")
50+
@SuppressWarnings("removal")
5151
private org.springframework.core.task.AsyncListenableTaskExecutor executor;
5252

5353
protected String testName;
@@ -64,7 +64,7 @@ void setup(TestInfo testInfo) {
6464
this.executor = buildExecutor();
6565
}
6666

67-
@SuppressWarnings("deprecation")
67+
@SuppressWarnings("removal")
6868
protected abstract org.springframework.core.task.AsyncListenableTaskExecutor buildExecutor();
6969

7070
@AfterEach
@@ -125,7 +125,7 @@ void submitRunnableWithGetAfterShutdown() throws Exception {
125125
}
126126

127127
@Test
128-
@SuppressWarnings("deprecation")
128+
@SuppressWarnings("removal")
129129
void submitListenableRunnable() {
130130
TestTask task = new TestTask(this.testName, 1);
131131
// Act
@@ -156,7 +156,7 @@ void submitCompletableRunnable() {
156156
}
157157

158158
@Test
159-
@SuppressWarnings("deprecation")
159+
@SuppressWarnings("removal")
160160
void submitFailingListenableRunnable() {
161161
TestTask task = new TestTask(this.testName, 0);
162162
org.springframework.util.concurrent.ListenableFuture<?> future = executor.submitListenable(task);
@@ -185,7 +185,7 @@ void submitFailingCompletableRunnable() {
185185
}
186186

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

262262
@Test
263-
@SuppressWarnings("deprecation")
263+
@SuppressWarnings("removal")
264264
void submitListenableCallable() {
265265
TestCallable task = new TestCallable(this.testName, 1);
266266
// Act
@@ -275,7 +275,7 @@ void submitListenableCallable() {
275275
}
276276

277277
@Test
278-
@SuppressWarnings("deprecation")
278+
@SuppressWarnings("removal")
279279
void submitFailingListenableCallable() {
280280
TestCallable task = new TestCallable(this.testName, 0);
281281
// Act
@@ -291,7 +291,7 @@ void submitFailingListenableCallable() {
291291
}
292292

293293
@Test
294-
@SuppressWarnings("deprecation")
294+
@SuppressWarnings("removal")
295295
void submitListenableCallableWithGetAfterShutdown() throws Exception {
296296
org.springframework.util.concurrent.ListenableFuture<?> future1 = executor.submitListenable(new TestCallable(this.testName, -1));
297297
org.springframework.util.concurrent.ListenableFuture<?> future2 = executor.submitListenable(new TestCallable(this.testName, -1));

Diff for: spring-context/src/test/java/org/springframework/scheduling/concurrent/ConcurrentTaskExecutorTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ class ConcurrentTaskExecutorTests extends AbstractSchedulingTaskExecutorTests {
4141
new ThreadPoolExecutor(1, 1, 60, TimeUnit.SECONDS, new LinkedBlockingQueue<>());
4242

4343

44-
@SuppressWarnings("deprecation")
4544
@Override
45+
@SuppressWarnings("removal")
4646
protected org.springframework.core.task.AsyncListenableTaskExecutor buildExecutor() {
4747
concurrentExecutor.setThreadFactory(new CustomizableThreadFactory(this.threadNamePrefix));
4848
return new ConcurrentTaskExecutor(concurrentExecutor);
4949
}
5050

51-
@Override
5251
@AfterEach
52+
@Override
5353
void shutdownExecutor() {
5454
for (Runnable task : concurrentExecutor.shutdownNow()) {
5555
if (task instanceof Future) {

Diff for: spring-context/src/test/java/org/springframework/scheduling/concurrent/ConcurrentTaskSchedulerTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ class ConcurrentTaskSchedulerTests extends AbstractSchedulingTaskExecutorTests {
5151
private final AtomicBoolean taskRun = new AtomicBoolean();
5252

5353

54-
@SuppressWarnings("deprecation")
5554
@Override
55+
@SuppressWarnings("removal")
5656
protected org.springframework.core.task.AsyncListenableTaskExecutor buildExecutor() {
5757
threadFactory.setThreadNamePrefix(this.threadNamePrefix);
5858
scheduler.setTaskDecorator(runnable -> () -> {
@@ -62,8 +62,8 @@ protected org.springframework.core.task.AsyncListenableTaskExecutor buildExecuto
6262
return scheduler;
6363
}
6464

65-
@Override
6665
@AfterEach
66+
@Override
6767
void shutdownExecutor() {
6868
for (Runnable task : ((ExecutorService) scheduler.getConcurrentExecutor()).shutdownNow()) {
6969
if (task instanceof Future) {

Diff for: spring-context/src/test/java/org/springframework/scheduling/concurrent/DecoratedThreadPoolTaskExecutorTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -26,7 +26,7 @@
2626
class DecoratedThreadPoolTaskExecutorTests extends AbstractSchedulingTaskExecutorTests {
2727

2828
@Override
29-
@SuppressWarnings("deprecation")
29+
@SuppressWarnings("removal")
3030
protected org.springframework.core.task.AsyncListenableTaskExecutor buildExecutor() {
3131
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
3232
executor.setTaskDecorator(runnable ->

Diff for: spring-context/src/test/java/org/springframework/scheduling/concurrent/SimpleAsyncTaskSchedulerTests.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ class SimpleAsyncTaskSchedulerTests extends AbstractSchedulingTaskExecutorTests
4444
private final AtomicBoolean taskRun = new AtomicBoolean();
4545

4646

47-
@SuppressWarnings("deprecation")
4847
@Override
48+
@SuppressWarnings("removal")
4949
protected org.springframework.core.task.AsyncListenableTaskExecutor buildExecutor() {
5050
scheduler.setTaskDecorator(runnable -> () -> {
5151
taskRun.set(true);
@@ -63,7 +63,6 @@ void submitRunnableWithGetAfterShutdown() {
6363
}
6464

6565
@Test
66-
@SuppressWarnings("deprecation")
6766
@Override
6867
void submitListenableRunnableWithGetAfterShutdown() {
6968
// decorated Future cannot be cancelled on shutdown with SimpleAsyncTaskScheduler

Diff for: spring-context/src/test/java/org/springframework/scheduling/concurrent/ThreadPoolTaskExecutorTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class ThreadPoolTaskExecutorTests extends AbstractSchedulingTaskExecutorTests {
4141

4242

4343
@Override
44-
@SuppressWarnings("deprecation")
44+
@SuppressWarnings("removal")
4545
protected org.springframework.core.task.AsyncListenableTaskExecutor buildExecutor() {
4646
executor.setThreadNamePrefix(this.threadNamePrefix);
4747
executor.setMaxPoolSize(1);

Diff for: spring-context/src/test/java/org/springframework/scheduling/concurrent/ThreadPoolTaskSchedulerTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ class ThreadPoolTaskSchedulerTests extends AbstractSchedulingTaskExecutorTests {
4848
private final AtomicBoolean taskRun = new AtomicBoolean();
4949

5050

51-
@SuppressWarnings("deprecation")
5251
@Override
52+
@SuppressWarnings("removal")
5353
protected org.springframework.core.task.AsyncListenableTaskExecutor buildExecutor() {
5454
scheduler.setTaskDecorator(runnable -> () -> {
5555
taskRun.set(true);

0 commit comments

Comments
 (0)