Skip to content

Commit f427ac3

Browse files
committed
(Re)suppress deprecation warnings
See gh-33780
1 parent 79cf554 commit f427ac3

File tree

23 files changed

+48
-48
lines changed

23 files changed

+48
-48
lines changed

Diff for: spring-context-support/src/main/java/org/springframework/scheduling/quartz/SimpleThreadPoolTaskExecutor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
* @see org.springframework.core.task.TaskExecutor
4848
* @see SchedulerFactoryBean#setTaskExecutor
4949
*/
50-
@SuppressWarnings("removal")
50+
@SuppressWarnings({"deprecation", "removal"})
5151
public class SimpleThreadPoolTaskExecutor extends SimpleThreadPool
5252
implements AsyncListenableTaskExecutor, SchedulingTaskExecutor, InitializingBean, DisposableBean {
5353

Diff for: spring-context/src/main/java/org/springframework/context/event/ApplicationListenerMethodAdapter.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ protected Object[] resolveArguments(ApplicationEvent event) {
310310
return new Object[] {event};
311311
}
312312

313-
@SuppressWarnings({"removal", "unchecked"})
313+
@SuppressWarnings({"removal", "unchecked", "deprecation"})
314314
protected void handleResult(Object result) {
315315
if (reactiveStreamsPresent && new ReactiveResultHandler().subscribeToPublisher(result)) {
316316
if (logger.isTraceEnabled()) {

Diff for: spring-context/src/main/java/org/springframework/scheduling/concurrent/ConcurrentTaskExecutor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
* @see DefaultManagedTaskExecutor
6363
* @see ThreadPoolTaskExecutor
6464
*/
65-
@SuppressWarnings("removal")
65+
@SuppressWarnings({"deprecation", "removal"})
6666
public class ConcurrentTaskExecutor implements AsyncListenableTaskExecutor, SchedulingTaskExecutor {
6767

6868
private static final Executor STUB_EXECUTOR = (task -> {

Diff for: spring-context/src/main/java/org/springframework/scheduling/concurrent/ConcurrentTaskScheduler.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -218,13 +218,13 @@ public <T> Future<T> submit(Callable<T> task) {
218218
return super.submit(new DelegatingErrorHandlingCallable<>(task, this.errorHandler));
219219
}
220220

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

227-
@SuppressWarnings("removal")
227+
@SuppressWarnings({"deprecation", "removal"})
228228
@Override
229229
public <T> org.springframework.util.concurrent.ListenableFuture<T> submitListenable(Callable<T> task) {
230230
return super.submitListenable(new DelegatingErrorHandlingCallable<>(task, this.errorHandler));

Diff for: spring-context/src/main/java/org/springframework/scheduling/concurrent/SimpleAsyncTaskScheduler.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -269,13 +269,13 @@ public <T> Future<T> submit(Callable<T> task) {
269269
return super.submit(new DelegatingErrorHandlingCallable<>(task, this.errorHandler));
270270
}
271271

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

278-
@SuppressWarnings("removal")
278+
@SuppressWarnings({"deprecation", "removal"})
279279
@Override
280280
public <T> org.springframework.util.concurrent.ListenableFuture<T> submitListenable(Callable<T> task) {
281281
return super.submitListenable(new DelegatingErrorHandlingCallable<>(task, this.errorHandler));

Diff for: spring-context/src/main/java/org/springframework/scheduling/concurrent/ThreadPoolTaskExecutor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
* @see ThreadPoolExecutorFactoryBean
8181
* @see ConcurrentTaskExecutor
8282
*/
83-
@SuppressWarnings({"serial", "removal"})
83+
@SuppressWarnings({"serial", "deprecation", "removal"})
8484
public class ThreadPoolTaskExecutor extends ExecutorConfigurationSupport
8585
implements AsyncListenableTaskExecutor, SchedulingTaskExecutor {
8686

Diff for: spring-context/src/main/java/org/springframework/scheduling/concurrent/ThreadPoolTaskScheduler.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
* @see ThreadPoolTaskExecutor
7575
* @see SimpleAsyncTaskScheduler
7676
*/
77-
@SuppressWarnings({"serial", "removal"})
77+
@SuppressWarnings({"serial", "deprecation", "removal"})
7878
public class ThreadPoolTaskScheduler extends ExecutorConfigurationSupport
7979
implements AsyncListenableTaskExecutor, SchedulingTaskExecutor, TaskScheduler {
8080

Diff for: spring-context/src/test/java/org/springframework/context/event/AnnotationDrivenEventListenerTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ void collectionReplyNullValue() {
280280
}
281281

282282
@Test
283-
@SuppressWarnings("removal")
283+
@SuppressWarnings({"deprecation", "removal"})
284284
void listenableFutureReply() {
285285
load(TestEventListener.class, ReplyEventListener.class);
286286
org.springframework.util.concurrent.SettableListenableFuture<String> future =

Diff for: spring-context/src/test/java/org/springframework/scheduling/annotation/AsyncAnnotationBeanPostProcessorTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ private interface ITestBean {
275275

276276
Future<Object> failWithFuture();
277277

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

281281
void failWithVoid();
@@ -310,7 +310,7 @@ public Future<Object> failWithFuture() {
310310

311311
@Async
312312
@Override
313-
@SuppressWarnings("deprecation")
313+
@SuppressWarnings({"deprecation", "removal"})
314314
public org.springframework.util.concurrent.ListenableFuture<Object> failWithListenableFuture() {
315315
throw new UnsupportedOperationException("failWithListenableFuture");
316316
}

Diff for: spring-context/src/test/java/org/springframework/scheduling/annotation/AsyncExecutionTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
* @author Juergen Hoeller
5252
* @author Chris Beams
5353
*/
54-
@SuppressWarnings({ "resource", "deprecation" })
54+
@SuppressWarnings({"resource", "deprecation", "removal"})
5555
class AsyncExecutionTests {
5656

5757
private static String originalThreadName;

Diff for: spring-context/src/test/java/org/springframework/scheduling/annotation/AsyncResultTests.java

+12-12
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
class AsyncResultTests {
3333

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

5656
@Test
57-
@SuppressWarnings("removal")
57+
@SuppressWarnings({ "deprecation", "removal" })
5858
public void asyncResultWithCallbackAndException() {
5959
IOException ex = new IOException();
6060
final Set<Throwable> values = new HashSet<>(1);
@@ -71,15 +71,15 @@ public void onFailure(Throwable ex) {
7171
});
7272
assertThat(values).singleElement().isSameAs(ex);
7373
assertThatExceptionOfType(ExecutionException.class)
74-
.isThrownBy(future::get)
75-
.withCause(ex);
74+
.isThrownBy(future::get)
75+
.withCause(ex);
7676
assertThatExceptionOfType(ExecutionException.class)
77-
.isThrownBy(future.completable()::get)
78-
.withCause(ex);
77+
.isThrownBy(future.completable()::get)
78+
.withCause(ex);
7979
}
8080

8181
@Test
82-
@SuppressWarnings("removal")
82+
@SuppressWarnings({ "deprecation", "removal" })
8383
public void asyncResultWithSeparateCallbacksAndValue() throws Exception {
8484
String value = "val";
8585
final Set<String> values = new HashSet<>(1);
@@ -92,19 +92,19 @@ public void asyncResultWithSeparateCallbacksAndValue() throws Exception {
9292
}
9393

9494
@Test
95-
@SuppressWarnings("removal")
95+
@SuppressWarnings({ "deprecation", "removal" })
9696
public void asyncResultWithSeparateCallbacksAndException() {
9797
IOException ex = new IOException();
9898
final Set<Throwable> values = new HashSet<>(1);
9999
org.springframework.util.concurrent.ListenableFuture<String> future = AsyncResult.forExecutionException(ex);
100100
future.addCallback(result -> new AssertionError("Success callback not expected: " + result), values::add);
101101
assertThat(values).singleElement().isSameAs(ex);
102102
assertThatExceptionOfType(ExecutionException.class)
103-
.isThrownBy(future::get)
104-
.withCause(ex);
103+
.isThrownBy(future::get)
104+
.withCause(ex);
105105
assertThatExceptionOfType(ExecutionException.class)
106-
.isThrownBy(future.completable()::get)
107-
.withCause(ex);
106+
.isThrownBy(future.completable()::get)
107+
.withCause(ex);
108108
}
109109

110110
}

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

+6-6
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ void submitRunnableWithGetAfterShutdown() throws Exception {
125125
}
126126

127127
@Test
128-
@SuppressWarnings("removal")
128+
@SuppressWarnings({ "deprecation", "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("removal")
159+
@SuppressWarnings({ "deprecation", "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("removal")
188+
@SuppressWarnings({ "deprecation", "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("removal")
263+
@SuppressWarnings({ "deprecation", "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("removal")
278+
@SuppressWarnings({ "deprecation", "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("removal")
294+
@SuppressWarnings({ "deprecation", "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-core/src/main/java/org/springframework/core/task/support/TaskExecutorAdapter.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
* @see java.util.concurrent.ExecutorService
4444
* @see java.util.concurrent.Executors
4545
*/
46-
@SuppressWarnings("removal")
46+
@SuppressWarnings({"deprecation", "removal"})
4747
public class TaskExecutorAdapter implements AsyncListenableTaskExecutor {
4848

4949
private final Executor concurrentExecutor;

Diff for: spring-core/src/test/java/org/springframework/util/concurrent/ListenableFutureTaskTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
* @author Arjen Poutsma
3434
* @author Sebastien Deleuze
3535
*/
36-
@SuppressWarnings("removal")
36+
@SuppressWarnings({"deprecation", "removal"})
3737
class ListenableFutureTaskTests {
3838

3939
@Test

Diff for: spring-core/src/test/java/org/springframework/util/concurrent/MonoToListenableFutureAdapterTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
*
3131
* @author Rossen Stoyanchev
3232
*/
33-
@SuppressWarnings("removal")
33+
@SuppressWarnings({"deprecation", "removal"})
3434
class MonoToListenableFutureAdapterTests {
3535

3636
@Test

Diff for: spring-core/src/test/java/org/springframework/util/concurrent/SettableListenableFutureTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
* @author Mattias Severson
3737
* @author Juergen Hoeller
3838
*/
39-
@SuppressWarnings("removal")
39+
@SuppressWarnings({"deprecation", "removal"})
4040
class SettableListenableFutureTests {
4141

4242
private final SettableListenableFuture<String> settableListenableFuture = new SettableListenableFuture<>();

Diff for: spring-messaging/src/test/java/org/springframework/messaging/simp/annotation/support/SimpAnnotationMethodMessageHandlerTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ public void handleFoo() {
571571

572572
@Controller
573573
@MessageMapping("listenable-future")
574-
@SuppressWarnings("removal")
574+
@SuppressWarnings({"deprecation", "removal"})
575575
private static class ListenableFutureController {
576576

577577
org.springframework.util.concurrent.ListenableFutureTask<String> future;

Diff for: spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/AsyncTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ DeferredResult<Person> getDeferredResultWithDelayedError() {
194194
}
195195

196196
@GetMapping(params = "listenableFuture")
197-
@SuppressWarnings("deprecation")
197+
@SuppressWarnings({ "deprecation", "removal" })
198198
org.springframework.util.concurrent.ListenableFuture<Person> getListenableFuture() {
199199
org.springframework.util.concurrent.ListenableFutureTask<Person> futureTask =
200200
new org.springframework.util.concurrent.ListenableFutureTask<>(() -> new Person("Joe"));

Diff for: spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/AsyncTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ DeferredResult<Person> getDeferredResultWithDelayedError() {
334334
}
335335

336336
@RequestMapping(params = "listenableFuture")
337-
@SuppressWarnings("deprecation")
337+
@SuppressWarnings({"deprecation", "removal"})
338338
org.springframework.util.concurrent.ListenableFuture<Person> getListenableFuture() {
339339
org.springframework.util.concurrent.ListenableFutureTask<Person> futureTask =
340340
new org.springframework.util.concurrent.ListenableFutureTask<>(() -> new Person("Joe"));

Diff for: spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/DeferredResultMethodReturnValueHandler.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
*/
3838
public class DeferredResultMethodReturnValueHandler implements HandlerMethodReturnValueHandler {
3939

40-
@SuppressWarnings("removal")
40+
@SuppressWarnings({"deprecation", "removal"})
4141
@Override
4242
public boolean supportsReturnType(MethodParameter returnType) {
4343
Class<?> type = returnType.getParameterType();
@@ -46,7 +46,7 @@ public boolean supportsReturnType(MethodParameter returnType) {
4646
CompletionStage.class.isAssignableFrom(type));
4747
}
4848

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

78-
@SuppressWarnings("removal")
78+
@SuppressWarnings({"deprecation", "removal"})
7979
private DeferredResult<Object> adaptListenableFuture(org.springframework.util.concurrent.ListenableFuture<?> future) {
8080
DeferredResult<Object> result = new DeferredResult<>();
8181
future.addCallback(new org.springframework.util.concurrent.ListenableFutureCallback<Object>() {

Diff for: spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/DeferredResultReturnValueHandlerTests.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void setup() throws Exception {
6363

6464

6565
@Test
66-
@SuppressWarnings("removal")
66+
@SuppressWarnings({"deprecation", "removal"})
6767
public void supportsReturnType() throws Exception {
6868
assertThat(this.handler.supportsReturnType(
6969
on(TestController.class).resolveReturnType(DeferredResult.class, String.class))).isTrue();
@@ -88,7 +88,7 @@ void deferredResult() throws Exception {
8888
}
8989

9090
@Test
91-
@SuppressWarnings("removal")
91+
@SuppressWarnings({"deprecation", "removal"})
9292
public void listenableFuture() throws Exception {
9393
org.springframework.util.concurrent.SettableListenableFuture<String> future =
9494
new org.springframework.util.concurrent.SettableListenableFuture<>();
@@ -109,7 +109,7 @@ void deferredResultWithError() throws Exception {
109109
}
110110

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

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

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

156156
CompletableFuture<String> handleCompletableFuture() { return null; }

Diff for: spring-websocket/src/main/java/org/springframework/web/socket/sockjs/client/DefaultTransportRequest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public void setFallbackRequest(DefaultTransportRequest fallbackRequest) {
147147

148148

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

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

Diff for: spring-websocket/src/test/java/org/springframework/web/socket/sockjs/client/XhrTransportTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ void sendMessageError() {
8484
}
8585

8686
@Test
87-
@SuppressWarnings("deprecation")
87+
@SuppressWarnings({"deprecation", "removal"})
8888
void connect() {
8989
HttpHeaders handshakeHeaders = new HttpHeaders();
9090
handshakeHeaders.setOrigin("foo");

0 commit comments

Comments
 (0)