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 2017/09/13 19:30:05 UTC

svn commit: r1808277 - in /tomcat/tc7.0.x/trunk: java/org/apache/catalina/core/ContainerBase.java webapps/docs/changelog.xml

Author: markt
Date: Wed Sep 13 19:30:05 2017
New Revision: 1808277

URL: http://svn.apache.org/viewvc?rev=1808277&view=rev
Log:
Correct a regression in 7.0.80 and 7.0.81 that wrapped the DirContext that represented the web application in a ProxyDirContext twice rather than just once.

Modified:
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ContainerBase.java
    tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ContainerBase.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ContainerBase.java?rev=1808277&r1=1808276&r2=1808277&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ContainerBase.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ContainerBase.java Wed Sep 13 19:30:05 2017
@@ -941,11 +941,17 @@ public abstract class ContainerBase exte
             oldResources = this.resources;
             if (oldResources == resources)
                 return;
-            Hashtable<String, String> env = new Hashtable<String, String>();
-            if (getParent() != null)
-                env.put(ProxyDirContext.HOST, getParent().getName());
-            env.put(ProxyDirContext.CONTEXT, getName());
-            this.resources = new ProxyDirContext(env, resources);
+            // null resources don't need to be wrapped. Neither do resources
+            // that are already wrapped.
+            if (resources == null || resources instanceof ProxyDirContext) {
+                this.resources = resources;
+            } else {
+                Hashtable<String, String> env = new Hashtable<String, String>();
+                if (getParent() != null)
+                    env.put(ProxyDirContext.HOST, getParent().getName());
+                env.put(ProxyDirContext.CONTEXT, getName());
+                this.resources = new ProxyDirContext(env, resources);
+            }
         } finally {
             writeLock.unlock();
         }

Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1808277&r1=1808276&r2=1808277&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Wed Sep 13 19:30:05 2017
@@ -85,6 +85,11 @@
         3875) optional. The feature is enabled by default for consistency with
         previous releases. Based on a patch by jm009. (markt)
       </add>
+      <fix>
+        Correct a regression in 7.0.80 and 7.0.81 that wrapped the
+        <code>DirContext</code> that represented the web application in a
+        <code>ProxyDirContext</code> twice rather than just once. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Coyote">



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