(Re)suppress deprecation warnings

See gh-33780
This commit is contained in:
Sam Brannen
2024-10-30 10:43:27 +01:00
parent 79cf554850
commit f427ac383d
23 changed files with 48 additions and 48 deletions

View File

@@ -37,7 +37,7 @@ import org.springframework.web.method.support.ModelAndViewContainer;
*/
public class DeferredResultMethodReturnValueHandler implements HandlerMethodReturnValueHandler {
@SuppressWarnings("removal")
@SuppressWarnings({"deprecation", "removal"})
@Override
public boolean supportsReturnType(MethodParameter returnType) {
Class<?> type = returnType.getParameterType();
@@ -46,7 +46,7 @@ public class DeferredResultMethodReturnValueHandler implements HandlerMethodRetu
CompletionStage.class.isAssignableFrom(type));
}
@SuppressWarnings("removal")
@SuppressWarnings({"deprecation", "removal"})
@Override
public void handleReturnValue(@Nullable Object returnValue, MethodParameter returnType,
ModelAndViewContainer mavContainer, NativeWebRequest webRequest) throws Exception {
@@ -75,7 +75,7 @@ public class DeferredResultMethodReturnValueHandler implements HandlerMethodRetu
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>() {

View File

@@ -63,7 +63,7 @@ class DeferredResultReturnValueHandlerTests {
@Test
@SuppressWarnings("removal")
@SuppressWarnings({"deprecation", "removal"})
public void supportsReturnType() throws Exception {
assertThat(this.handler.supportsReturnType(
on(TestController.class).resolveReturnType(DeferredResult.class, String.class))).isTrue();
@@ -88,7 +88,7 @@ class DeferredResultReturnValueHandlerTests {
}
@Test
@SuppressWarnings("removal")
@SuppressWarnings({"deprecation", "removal"})
public void listenableFuture() throws Exception {
org.springframework.util.concurrent.SettableListenableFuture<String> future =
new org.springframework.util.concurrent.SettableListenableFuture<>();
@@ -109,7 +109,7 @@ class DeferredResultReturnValueHandlerTests {
}
@Test
@SuppressWarnings("removal")
@SuppressWarnings({"deprecation", "removal"})
public void listenableFutureWithError() throws Exception {
org.springframework.util.concurrent.SettableListenableFuture<String> future =
new org.springframework.util.concurrent.SettableListenableFuture<>();
@@ -150,7 +150,7 @@ class DeferredResultReturnValueHandlerTests {
DeferredResult<String> handleDeferredResult() { return null; }
@SuppressWarnings("removal")
@SuppressWarnings({"deprecation", "removal"})
org.springframework.util.concurrent.ListenableFuture<String> handleListenableFuture() { return null; }
CompletableFuture<String> handleCompletableFuture() { return null; }