You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2007/02/10 03:30:04 UTC
svn commit: r505618 -
/tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/StandardWrapperFacade.java
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