From: remm Date: Sat, 10 Feb 2007 01:53:06 +0000 (+0000) Subject: - Indent (sorry, the class was too hard to work with). X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=443664e173b8533dcadffc59ba015cc4d692e0ae;p=tomcat7.0 - Indent (sorry, the class was too hard to work with). git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@505610 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/jasper/runtime/JspFactoryImpl.java b/java/org/apache/jasper/runtime/JspFactoryImpl.java index 49b667fa5..c3a77ad5d 100644 --- a/java/org/apache/jasper/runtime/JspFactoryImpl.java +++ b/java/org/apache/jasper/runtime/JspFactoryImpl.java @@ -46,56 +46,50 @@ public class JspFactoryImpl extends JspFactory { private static final String SPEC_VERSION = "2.1"; private static final boolean USE_POOL = Boolean.valueOf(System.getProperty("org.apache.jasper.runtime.JspFactoryImpl.USE_POOL", "true")).booleanValue(); + private static final boolean THREAD_LOCAL_POOL = + Boolean.valueOf(System.getProperty("org.apache.jasper.runtime.JspFactoryImpl.THREAD_LOCAL_POOL", "true")).booleanValue(); private SimplePool pool = new SimplePool( 100 ); - - public PageContext getPageContext(Servlet servlet, - ServletRequest request, - ServletResponse response, - String errorPageURL, - boolean needsSession, - int bufferSize, - boolean autoflush) { - - if( Constants.IS_SECURITY_ENABLED ) { - PrivilegedGetPageContext dp = new PrivilegedGetPageContext( - (JspFactoryImpl)this, servlet, request, response, errorPageURL, - needsSession, bufferSize, autoflush); - return (PageContext)AccessController.doPrivileged(dp); - } else { - return internalGetPageContext(servlet, request, response, - errorPageURL, needsSession, - bufferSize, autoflush); - } + + public PageContext getPageContext(Servlet servlet, ServletRequest request, + ServletResponse response, String errorPageURL, boolean needsSession, + int bufferSize, boolean autoflush) { + + if( Constants.IS_SECURITY_ENABLED ) { + PrivilegedGetPageContext dp = new PrivilegedGetPageContext( + (JspFactoryImpl)this, servlet, request, response, errorPageURL, + needsSession, bufferSize, autoflush); + return (PageContext)AccessController.doPrivileged(dp); + } else { + return internalGetPageContext(servlet, request, response, + errorPageURL, needsSession, + bufferSize, autoflush); + } } public void releasePageContext(PageContext pc) { - if( pc == null ) - return; + if( pc == null ) + return; if( Constants.IS_SECURITY_ENABLED ) { PrivilegedReleasePageContext dp = new PrivilegedReleasePageContext( - (JspFactoryImpl)this,pc); + (JspFactoryImpl)this,pc); AccessController.doPrivileged(dp); } else { internalReleasePageContext(pc); - } + } } public JspEngineInfo getEngineInfo() { return new JspEngineInfo() { - public String getSpecificationVersion() { - return SPEC_VERSION; - } - }; + public String getSpecificationVersion() { + return SPEC_VERSION; + } + }; } - private PageContext internalGetPageContext(Servlet servlet, - ServletRequest request, - ServletResponse response, - String errorPageURL, - boolean needsSession, - int bufferSize, - boolean autoflush) { + private PageContext internalGetPageContext(Servlet servlet, ServletRequest request, + ServletResponse response, String errorPageURL, boolean needsSession, + int bufferSize, boolean autoflush) { try { PageContext pc; if( USE_POOL ) { @@ -118,69 +112,59 @@ public class JspFactoryImpl extends JspFactory { private void internalReleasePageContext(PageContext pc) { pc.release(); - if (USE_POOL && (pc instanceof PageContextImpl)) { - pool.put( pc ); - } + if (USE_POOL && (pc instanceof PageContextImpl)) { + pool.put( pc ); + } } private class PrivilegedGetPageContext implements PrivilegedAction { - private JspFactoryImpl factory; - private Servlet servlet; - private ServletRequest request; - private ServletResponse response; - private String errorPageURL; - private boolean needsSession; - private int bufferSize; - private boolean autoflush; - - PrivilegedGetPageContext(JspFactoryImpl factory, - Servlet servlet, - ServletRequest request, - ServletResponse response, - String errorPageURL, - boolean needsSession, - int bufferSize, - boolean autoflush) { - this.factory = factory; - this.servlet = servlet; - this.request = request; - this.response = response; - this.errorPageURL = errorPageURL; - this.needsSession = needsSession; - this.bufferSize = bufferSize; - this.autoflush = autoflush; - } - - public Object run() { - return factory.internalGetPageContext(servlet, - request, - response, - errorPageURL, - needsSession, - bufferSize, - autoflush); - } + private JspFactoryImpl factory; + private Servlet servlet; + private ServletRequest request; + private ServletResponse response; + private String errorPageURL; + private boolean needsSession; + private int bufferSize; + private boolean autoflush; + + PrivilegedGetPageContext(JspFactoryImpl factory, Servlet servlet, + ServletRequest request, ServletResponse response, String errorPageURL, + boolean needsSession, int bufferSize, boolean autoflush) { + this.factory = factory; + this.servlet = servlet; + this.request = request; + this.response = response; + this.errorPageURL = errorPageURL; + this.needsSession = needsSession; + this.bufferSize = bufferSize; + this.autoflush = autoflush; + } + + public Object run() { + return factory.internalGetPageContext(servlet, request, response, + errorPageURL, needsSession, bufferSize, autoflush); + } } private class PrivilegedReleasePageContext implements PrivilegedAction { private JspFactoryImpl factory; - private PageContext pageContext; + private PageContext pageContext; PrivilegedReleasePageContext(JspFactoryImpl factory, - PageContext pageContext) { + PageContext pageContext) { this.factory = factory; this.pageContext = pageContext; } public Object run() { factory.internalReleasePageContext(pageContext); - return null; + return null; } } - - public JspApplicationContext getJspApplicationContext(ServletContext context) { + + public JspApplicationContext getJspApplicationContext(ServletContext context) { return JspApplicationContextImpl.getInstance(context); - } + } }