From e870c9a39251898f0747f9a591595134bbd16278 Mon Sep 17 00:00:00 2001 From: Rossen Stoyanchev Date: Mon, 2 Jul 2012 17:56:39 -0400 Subject: [PATCH] Reduce logging in HandlerExecutionChain Before this change the HandlerExecitionChain logged errors each time a an AsyncHandlerInterceptor returned a null async Callable, a condition which is acceptable. SPR-9524 --- .../web/servlet/HandlerExecutionChain.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/HandlerExecutionChain.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/HandlerExecutionChain.java index d078e1706f..68c8ff96c6 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/HandlerExecutionChain.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/HandlerExecutionChain.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,6 +26,7 @@ import javax.servlet.http.HttpServletResponse; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.util.CollectionUtils; +import org.springframework.web.context.request.async.AbstractDelegatingCallable; import org.springframework.web.context.request.async.AsyncExecutionChain; /** @@ -170,7 +171,10 @@ public class HandlerExecutionChain { try { AsyncHandlerInterceptor asyncInterceptor = (AsyncHandlerInterceptor) interceptor; AsyncExecutionChain chain = AsyncExecutionChain.getForCurrentRequest(request); - chain.addDelegatingCallable(asyncInterceptor.getAsyncCallable(request, response, this.handler)); + AbstractDelegatingCallable callable = asyncInterceptor.getAsyncCallable(request, response, this.handler); + if (callable != null) { + chain.addDelegatingCallable(callable); + } } catch (Throwable ex) { logger.error("HandlerInterceptor.addAsyncCallables threw exception", ex);