Remove return statements in finally blocks

This commit is contained in:
Rossen Stoyanchev
2014-08-19 15:27:59 -04:00
parent 0e49040707
commit bb8be509cd
@@ -877,15 +877,14 @@ public class DispatcherServlet extends FrameworkServlet {
doDispatch(request, response); doDispatch(request, response);
} }
finally { finally {
if (WebAsyncUtils.getAsyncManager(request).isConcurrentHandlingStarted()) { if (!WebAsyncUtils.getAsyncManager(request).isConcurrentHandlingStarted()) {
return;
}
// Restore the original attribute snapshot, in case of an include. // Restore the original attribute snapshot, in case of an include.
if (attributesSnapshot != null) { if (attributesSnapshot != null) {
restoreAttributesAfterInclude(request, attributesSnapshot); restoreAttributesAfterInclude(request, attributesSnapshot);
} }
} }
} }
}
/** /**
* Process the actual dispatching to the handler. * Process the actual dispatching to the handler.
@@ -940,15 +939,12 @@ public class DispatcherServlet extends FrameworkServlet {
return; return;
} }
try {
// Actually invoke the handler. // Actually invoke the handler.
mv = ha.handle(processedRequest, response, mappedHandler.getHandler()); mv = ha.handle(processedRequest, response, mappedHandler.getHandler());
}
finally {
if (asyncManager.isConcurrentHandlingStarted()) { if (asyncManager.isConcurrentHandlingStarted()) {
return; return;
} }
}
applyDefaultViewName(request, mv); applyDefaultViewName(request, mv);
mappedHandler.applyPostHandle(processedRequest, response, mv); mappedHandler.applyPostHandle(processedRequest, response, mv);
@@ -967,15 +963,18 @@ public class DispatcherServlet extends FrameworkServlet {
finally { finally {
if (asyncManager.isConcurrentHandlingStarted()) { if (asyncManager.isConcurrentHandlingStarted()) {
// Instead of postHandle and afterCompletion // Instead of postHandle and afterCompletion
if (mappedHandler != null) {
mappedHandler.applyAfterConcurrentHandlingStarted(processedRequest, response); mappedHandler.applyAfterConcurrentHandlingStarted(processedRequest, response);
return;
} }
}
else {
// Clean up any resources used by a multipart request. // Clean up any resources used by a multipart request.
if (multipartRequestParsed) { if (multipartRequestParsed) {
cleanupMultipart(processedRequest); cleanupMultipart(processedRequest);
} }
} }
} }
}
/** /**
* Do we need view name translation? * Do we need view name translation?