You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2016/02/12 13:28:29 UTC
svn commit: r1730012 -
/tomcat/trunk/java/org/apache/catalina/core/ApplicationFilterChain.java
Author: markt
Date: Fri Feb 12 12:28:29 2016
New Revision: 1730012
URL: http://svn.apache.org/viewvc?rev=1730012&view=rev
Log:
Clean-up.
Modified:
tomcat/trunk/java/org/apache/catalina/core/ApplicationFilterChain.java
Modified: tomcat/trunk/java/org/apache/catalina/core/ApplicationFilterChain.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ApplicationFilterChain.java?rev=1730012&r1=1730011&r2=1730012&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/ApplicationFilterChain.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/ApplicationFilterChain.java Fri Feb 12 12:28:29 2016
@@ -173,9 +173,8 @@ final class ApplicationFilterChain imple
// Call the next filter if there is one
if (pos < n) {
ApplicationFilterConfig filterConfig = filters[pos++];
- Filter filter = null;
try {
- filter = filterConfig.getFilter();
+ Filter filter = filterConfig.getFilter();
if (request.isAsyncSupported() && "false".equalsIgnoreCase(
filterConfig.getFilterDef().getAsyncSupported())) {
@@ -215,42 +214,33 @@ final class ApplicationFilterChain imple
}
// Use potentially wrapped request from this point
if ((request instanceof HttpServletRequest) &&
- (response instanceof HttpServletResponse)) {
-
- if( Globals.IS_SECURITY_ENABLED ) {
- final ServletRequest req = request;
- final ServletResponse res = response;
- Principal principal =
- ((HttpServletRequest) req).getUserPrincipal();
- Object[] args = new Object[]{req, res};
- SecurityUtil.doAsPrivilege("service",
- servlet,
- classTypeUsedInService,
- args,
- principal);
- } else {
- servlet.service(request, response);
- }
+ (response instanceof HttpServletResponse) &&
+ Globals.IS_SECURITY_ENABLED ) {
+ final ServletRequest req = request;
+ final ServletResponse res = response;
+ Principal principal =
+ ((HttpServletRequest) req).getUserPrincipal();
+ Object[] args = new Object[]{req, res};
+ SecurityUtil.doAsPrivilege("service",
+ servlet,
+ classTypeUsedInService,
+ args,
+ principal);
} else {
servlet.service(request, response);
}
- } catch (IOException e) {
- throw e;
- } catch (ServletException e) {
- throw e;
- } catch (RuntimeException e) {
+ } catch (IOException | ServletException | RuntimeException e) {
throw e;
} catch (Throwable e) {
+ e = ExceptionUtils.unwrapInvocationTargetException(e);
ExceptionUtils.handleThrowable(e);
- throw new ServletException
- (sm.getString("filterChain.servlet"), e);
+ throw new ServletException(sm.getString("filterChain.servlet"), e);
} finally {
if (ApplicationDispatcher.WRAP_SAME_OBJECT) {
lastServicedRequest.set(null);
lastServicedResponse.set(null);
}
}
-
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org