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

View File

@@ -877,12 +877,11 @@ 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.
} if (attributesSnapshot != null) {
// Restore the original attribute snapshot, in case of an include. restoreAttributesAfterInclude(request, attributesSnapshot);
if (attributesSnapshot != null) { }
restoreAttributesAfterInclude(request, attributesSnapshot);
} }
} }
} }
@@ -940,14 +939,11 @@ 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());
} if (asyncManager.isConcurrentHandlingStarted()) {
finally { return;
if (asyncManager.isConcurrentHandlingStarted()) {
return;
}
} }
applyDefaultViewName(request, mv); applyDefaultViewName(request, mv);
@@ -967,12 +963,15 @@ public class DispatcherServlet extends FrameworkServlet {
finally { finally {
if (asyncManager.isConcurrentHandlingStarted()) { if (asyncManager.isConcurrentHandlingStarted()) {
// Instead of postHandle and afterCompletion // Instead of postHandle and afterCompletion
mappedHandler.applyAfterConcurrentHandlingStarted(processedRequest, response); if (mappedHandler != null) {
return; mappedHandler.applyAfterConcurrentHandlingStarted(processedRequest, response);
}
} }
// Clean up any resources used by a multipart request. else {
if (multipartRequestParsed) { // Clean up any resources used by a multipart request.
cleanupMultipart(processedRequest); if (multipartRequestParsed) {
cleanupMultipart(processedRequest);
}
} }
} }
} }