tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1241028 - /tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java
Date Mon, 06 Feb 2012 14:49:01 GMT
Author: markt
Date: Mon Feb  6 14:49:00 2012
New Revision: 1241028

URL: http://svn.apache.org/viewvc?rev=1241028&view=rev
Log:
Remove some unnecessary casts

Modified:
    tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java

Modified: tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java?rev=1241028&r1=1241027&r2=1241028&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java Mon Feb  6 14:49:00 2012
@@ -65,7 +65,6 @@ import org.apache.catalina.Server;
 import org.apache.catalina.Service;
 import org.apache.catalina.Valve;
 import org.apache.catalina.Wrapper;
-import org.apache.catalina.core.ContainerBase;
 import org.apache.catalina.core.StandardContext;
 import org.apache.catalina.core.StandardHost;
 import org.apache.catalina.deploy.ErrorPage;
@@ -360,10 +359,6 @@ public class ContextConfig implements Li
             return;
         }
 
-        if (!(context instanceof ContainerBase)) {
-            return;     // Cannot install a Valve even if it would be needed
-        }
-
         // Has a Realm been configured for us to authenticate against?
         if (context.getRealm() == null) {
             log.error(sm.getString("contextConfig.missingRealm"));
@@ -428,10 +423,10 @@ public class ContextConfig implements Li
             }
         }
 
-        if (authenticator != null && context instanceof ContainerBase) {
-            Pipeline pipeline = ((ContainerBase) context).getPipeline();
+        if (authenticator != null) {
+            Pipeline pipeline = context.getPipeline();
             if (pipeline != null) {
-                ((ContainerBase) context).getPipeline().addValve(authenticator);
+                pipeline.addValve(authenticator);
                 if (log.isDebugEnabled()) {
                     log.debug(sm.getString(
                                     "contextConfig.authenticatorConfigured",
@@ -439,7 +434,6 @@ public class ContextConfig implements Li
                 }
             }
         }
-
     }
 
 
@@ -816,9 +810,9 @@ public class ContextConfig implements Li
         }
 
         // Dump the contents of this pipeline if requested
-        if ((log.isDebugEnabled()) && (context instanceof ContainerBase)) {
+        if (log.isDebugEnabled()) {
             log.debug("Pipeline Configuration:");
-            Pipeline pipeline = ((ContainerBase) context).getPipeline();
+            Pipeline pipeline = context.getPipeline();
             Valve valves[] = null;
             if (pipeline != null) {
                 valves = pipeline.getValves();



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


Mime
View raw message