Browse Source

Remove return statements in finally blocks

pull/629/head
Rossen Stoyanchev 12 years ago
parent
commit
bb8be509cd
  1. 37
      spring-webmvc/src/main/java/org/springframework/web/servlet/DispatcherServlet.java

37
spring-webmvc/src/main/java/org/springframework/web/servlet/DispatcherServlet.java

@ -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);
}
} }
} }
} }

Loading…
Cancel
Save