diff --git a/spring-web/src/main/java/org/springframework/web/context/request/async/AsyncTask.java b/spring-web/src/main/java/org/springframework/web/context/request/async/AsyncTask.java index 453ac62b27..2383bf4c5f 100644 --- a/spring-web/src/main/java/org/springframework/web/context/request/async/AsyncTask.java +++ b/spring-web/src/main/java/org/springframework/web/context/request/async/AsyncTask.java @@ -27,9 +27,9 @@ import org.springframework.util.Assert; * @author Rossen Stoyanchev * @since 3.2 */ -public class AsyncTask { +public class AsyncTask { - private final Callable callable; + private final Callable callable; private final Long timeout; @@ -45,7 +45,7 @@ public class AsyncTask { * @param timeout timeout value in milliseconds * @param callable the callable for concurrent handling */ - public AsyncTask(long timeout, Callable callable) { + public AsyncTask(long timeout, Callable callable) { this(timeout, null, null, callable); Assert.notNull(timeout, "Timeout must not be null"); } @@ -55,7 +55,7 @@ public class AsyncTask { * @param timeout timeout value in milliseconds; ignored if {@code null} * @param callable the callable for concurrent handling */ - public AsyncTask(Long timeout, String executorName, Callable callable) { + public AsyncTask(Long timeout, String executorName, Callable callable) { this(timeout, null, executorName, callable); Assert.notNull(executor, "Executor name must not be null"); } @@ -65,12 +65,12 @@ public class AsyncTask { * @param timeout timeout value in milliseconds; ignored if {@code null} * @param callable the callable for concurrent handling */ - public AsyncTask(Long timeout, AsyncTaskExecutor executor, Callable callable) { + public AsyncTask(Long timeout, AsyncTaskExecutor executor, Callable callable) { this(timeout, executor, null, callable); Assert.notNull(executor, "Executor must not be null"); } - private AsyncTask(Long timeout, AsyncTaskExecutor executor, String executorName, Callable callable) { + private AsyncTask(Long timeout, AsyncTaskExecutor executor, String executorName, Callable callable) { Assert.notNull(callable, "Callable must not be null"); this.callable = callable; this.timeout = timeout; diff --git a/spring-web/src/main/java/org/springframework/web/context/request/async/WebAsyncManager.java b/spring-web/src/main/java/org/springframework/web/context/request/async/WebAsyncManager.java index 384199bdad..75def1e8f7 100644 --- a/spring-web/src/main/java/org/springframework/web/context/request/async/WebAsyncManager.java +++ b/spring-web/src/main/java/org/springframework/web/context/request/async/WebAsyncManager.java @@ -260,7 +260,7 @@ public final class WebAsyncManager { * @param processingContext additional context to save that can be accessed * via {@link #getConcurrentResultContext()} */ - public void startCallableProcessing(AsyncTask asyncTask, Object... processingContext) { + public void startCallableProcessing(AsyncTask asyncTask, Object... processingContext) { Assert.notNull(asyncTask, "AsyncTask must not be null"); Long timeout = asyncTask.getTimeout(); diff --git a/spring-web/src/test/java/org/springframework/web/context/request/async/WebAsyncManagerTests.java b/spring-web/src/test/java/org/springframework/web/context/request/async/WebAsyncManagerTests.java index 91e0f07964..0645a7df85 100644 --- a/spring-web/src/test/java/org/springframework/web/context/request/async/WebAsyncManagerTests.java +++ b/spring-web/src/test/java/org/springframework/web/context/request/async/WebAsyncManagerTests.java @@ -124,7 +124,8 @@ public class WebAsyncManagerTests { this.asyncWebRequest.startAsync(); replay(this.asyncWebRequest); - AsyncTask asyncTask = new AsyncTask(1000L, executor, createMock(Callable.class)); + @SuppressWarnings("unchecked") + AsyncTask asyncTask = new AsyncTask(1000L, executor, createMock(Callable.class)); this.asyncManager.startCallableProcessing(asyncTask); verify(executor, this.asyncWebRequest); diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/AsyncTaskMethodReturnValueHandler.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/AsyncTaskMethodReturnValueHandler.java index 3fda5349b8..c438394b65 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/AsyncTaskMethodReturnValueHandler.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/AsyncTaskMethodReturnValueHandler.java @@ -52,9 +52,9 @@ public class AsyncTaskMethodReturnValueHandler implements HandlerMethodReturnVal return; } - AsyncTask asyncTask = (AsyncTask) returnValue; + AsyncTask asyncTask = (AsyncTask) returnValue; asyncTask.setBeanFactory(this.beanFactory); - WebAsyncUtils.getAsyncManager(webRequest).startCallableProcessing(asyncTask.getCallable(), mavContainer); + WebAsyncUtils.getAsyncManager(webRequest).startCallableProcessing(asyncTask, mavContainer); } }