geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r1440176 - /geronimo/external/trunk/tomcat-parent-7.0.27/jasper/src/main/java/org/apache/jasper/runtime/JspContextWrapper.java
Date Tue, 29 Jan 2013 22:02:25 GMT
Author: gawor
Date: Tue Jan 29 22:02:24 2013
New Revision: 1440176

URL: http://svn.apache.org/viewvc?rev=1440176&view=rev
Log:
Apply optimization for JspContextWrapper: https://issues.apache.org/bugzilla/show_bug.cgi?id=53869
(updated patch)

Modified:
    geronimo/external/trunk/tomcat-parent-7.0.27/jasper/src/main/java/org/apache/jasper/runtime/JspContextWrapper.java

Modified: geronimo/external/trunk/tomcat-parent-7.0.27/jasper/src/main/java/org/apache/jasper/runtime/JspContextWrapper.java
URL: http://svn.apache.org/viewvc/geronimo/external/trunk/tomcat-parent-7.0.27/jasper/src/main/java/org/apache/jasper/runtime/JspContextWrapper.java?rev=1440176&r1=1440175&r2=1440176&view=diff
==============================================================================
--- geronimo/external/trunk/tomcat-parent-7.0.27/jasper/src/main/java/org/apache/jasper/runtime/JspContextWrapper.java
(original)
+++ geronimo/external/trunk/tomcat-parent-7.0.27/jasper/src/main/java/org/apache/jasper/runtime/JspContextWrapper.java
Tue Jan 29 22:02:24 2013
@@ -14,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.jasper.runtime;
 
 import java.io.IOException;
@@ -76,11 +75,11 @@ public class JspContextWrapper extends P
     private Map<String,String> aliases;
 
     private HashMap<String, Object> originalNestedVars;
-    
-    private ServletContext servletContext;
-    
-    private ELContext elContext;
-    
+
+    private ServletContext servletContext = null;
+
+    private ELContext elContext = null;
+
     private PageContext rootJspCtxt;
 
     public JspContextWrapper(JspContext jspContext,
@@ -88,12 +87,11 @@ public class JspContextWrapper extends P
             ArrayList<String> atEndVars, Map<String,String> aliases) {
         this.invokingJspCtxt = (PageContext) jspContext;
         if (jspContext instanceof JspContextWrapper) {
-            rootJspCtxt = ((JspContextWrapper) jspContext).rootJspCtxt;
-        } else {
+            rootJspCtxt = ((JspContextWrapper)jspContext).rootJspCtxt;
+        }
+        else {
             rootJspCtxt = invokingJspCtxt;
         }
-        this.servletContext = rootJspCtxt.getServletContext();
-        this.elContext = rootJspCtxt.getELContext();
         this.nestedVars = nestedVars;
         this.atBeginVars = atBeginVars;
         this.atEndVars = atEndVars;
@@ -294,6 +292,9 @@ public class JspContextWrapper extends P
 
     @Override
     public ServletContext getServletContext() {
+        if (servletContext == null) {
+            servletContext = rootJspCtxt.getServletContext();
+        }
         return servletContext;
     }
 
@@ -494,6 +495,9 @@ public class JspContextWrapper extends P
     public ELContext getELContext() {
         // instead decorate!!!
         
+        if (elContext == null) {
+            elContext = rootJspCtxt.getELContext();
+        }
         return elContext;
         
         /*



Mime
View raw message