Polishing

(cherry picked from commit edf7f3cd43)
This commit is contained in:
Juergen Hoeller
2024-12-04 16:41:07 +01:00
parent 3635ff0c17
commit aaf2e8fbe6
10 changed files with 29 additions and 36 deletions

View File

@@ -67,6 +67,7 @@ final class DefaultAsyncServerResponse extends ErrorHandlingServerResponse imple
this.timeout = timeout;
}
@Override
public ServerResponse block() {
try {
@@ -114,8 +115,8 @@ final class DefaultAsyncServerResponse extends ErrorHandlingServerResponse imple
}
}
@Nullable
@Override
@Nullable
public ModelAndView writeTo(HttpServletRequest request, HttpServletResponse response, Context context)
throws ServletException, IOException {
@@ -169,6 +170,7 @@ final class DefaultAsyncServerResponse extends ErrorHandlingServerResponse imple
return result;
}
@SuppressWarnings({"rawtypes", "unchecked"})
public static AsyncServerResponse create(Object obj, @Nullable Duration timeout) {
Assert.notNull(obj, "Argument to async must not be null");
@@ -192,5 +194,4 @@ final class DefaultAsyncServerResponse extends ErrorHandlingServerResponse imple
throw new IllegalArgumentException("Asynchronous type not supported: " + obj.getClass());
}
}

View File

@@ -54,6 +54,7 @@ class DefaultServerResponseBuilderTests {
static final ServerResponse.Context EMPTY_CONTEXT = Collections::emptyList;
@Test
@SuppressWarnings("removal")
void status() {
@@ -75,7 +76,6 @@ class DefaultServerResponseBuilderTests {
assertThat(result.cookies().getFirst("foo")).isEqualTo(cookie);
}
@Test
void ok() {
ServerResponse response = ServerResponse.ok().build();