tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject svn commit: r505618 - /tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/StandardWrapperFacade.java
Date Sat, 10 Feb 2007 02:30:04 GMT
Author: remm
Date: Fri Feb  9 18:30:04 2007
New Revision: 505618

URL: http://svn.apache.org/viewvc?view=rev&rev=505618
Log:
- Set of minor optimizations.
- getServletContext is used often.
- Submitted by Arvind Srinivasan.

Modified:
    tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/StandardWrapperFacade.java

Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/StandardWrapperFacade.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/StandardWrapperFacade.java?view=diff&rev=505618&r1=505617&r2=505618
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/StandardWrapperFacade.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/StandardWrapperFacade.java Fri Feb
 9 18:30:04 2007
@@ -59,6 +59,12 @@
     private ServletConfig config = null;
 
 
+    /**
+     * Wrapped context (facade).
+     */
+    private ServletContext context = null;
+
+
     // -------------------------------------------------- ServletConfig Methods
 
 
@@ -68,11 +74,12 @@
 
 
     public ServletContext getServletContext() {
-        ServletContext theContext = config.getServletContext();
-        if ((theContext != null) &&
-            (theContext instanceof ApplicationContext))
-            theContext = ((ApplicationContext) theContext).getFacade();
-        return (theContext);
+        if (context == null) {
+            context = config.getServletContext();
+            if ((context != null) && (context instanceof ApplicationContext))
+                context = ((ApplicationContext) context).getFacade();
+        }
+        return (context);
     }
 
 



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message