geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xuhaih...@apache.org
Subject svn commit: r953946 - in /geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat: ./ model/ security/authentication/
Date Sat, 12 Jun 2010 06:37:14 GMT
Author: xuhaihong
Date: Sat Jun 12 06:37:13 2010
New Revision: 953946

URL: http://svn.apache.org/viewvc?rev=953946&view=rev
Log:
a. Use Map.Entry for the loop
b. Remove some excess cast action

Modified:
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/BaseGBean.java
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/ManagerGBean.java
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatServerConfigManager.java
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatServerGBean.java
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/model/EngineType.java
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/model/HostType.java
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/model/ServerType.java
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/model/ServiceType.java
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/security/authentication/DigestAuthenticator.java

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/BaseGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/BaseGBean.java?rev=953946&r1=953945&r2=953946&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/BaseGBean.java
(original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/BaseGBean.java
Sat Jun 12 06:37:13 2010
@@ -16,9 +16,8 @@
  */
 package org.apache.geronimo.tomcat;
 
-import java.util.Iterator;
 import java.util.Map;
-import java.util.Set;
+import java.util.Map.Entry;
 
 import org.apache.tomcat.util.IntrospectionUtils;
 
@@ -26,16 +25,11 @@ public abstract class BaseGBean {
 
     protected void setParameters(Object object, Map<String, String> map){
         if (map != null){
-            Set<String> keySet = map.keySet();
-            Iterator<String> iterator = keySet.iterator();
-            while(iterator.hasNext()){
-                String name = iterator.next();
-                String value = map.get(name);
-                
-                IntrospectionUtils.setProperty(object, name, value);                    
+            for(Entry<String,String> entry : map.entrySet()){
+                IntrospectionUtils.setProperty(object, entry.getKey(), entry.getValue());
             }
         }
-        
+
     }
-        
+
 }

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java?rev=953946&r1=953945&r2=953946&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java
(original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java
Sat Jun 12 06:37:13 2010
@@ -46,7 +46,6 @@ import org.apache.catalina.ContainerList
 import org.apache.catalina.Engine;
 import org.apache.catalina.Globals;
 import org.apache.catalina.InstanceListener;
-import org.apache.catalina.Lifecycle;
 import org.apache.catalina.LifecycleException;
 import org.apache.catalina.LifecycleListener;
 import org.apache.catalina.Loader;
@@ -347,8 +346,7 @@ public class GeronimoStandardContext ext
                 try {
                     LifecycleListener listener =
                       (LifecycleListener) getInstanceManager().newInstance(wrapperLifecycle);
-                    if (wrapper instanceof Lifecycle)
-                        ((Lifecycle) wrapper).addLifecycleListener(listener);
+                    wrapper.addLifecycleListener(listener);
                 } catch (Throwable t) {
                     getLogger().error("createWrapper", t);
                     return (null);

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/ManagerGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/ManagerGBean.java?rev=953946&r1=953945&r2=953946&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/ManagerGBean.java
(original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/ManagerGBean.java
Sat Jun 12 06:37:13 2010
@@ -19,6 +19,7 @@ package org.apache.geronimo.tomcat;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
+import java.util.Map.Entry;
 
 import org.apache.catalina.Manager;
 import org.apache.catalina.Store;
@@ -33,29 +34,29 @@ import org.slf4j.LoggerFactory;
 public class ManagerGBean extends BaseGBean implements GBeanLifecycle, ObjectRetriever{
 
     private static final Logger log = LoggerFactory.getLogger(ManagerGBean.class);
-    
+
     public static final String J2EE_TYPE = "Manager";
-    
+
     protected final Manager manager;
 
     // no-arg constructor required for gbean refs
     public ManagerGBean(){
         manager = null;
     }
-    
+
     protected ManagerGBean(String className) throws Exception{
-       super();     
+       super();
        manager = (Manager)Class.forName(className).newInstance();
     }
-    
-    public ManagerGBean(String className, 
+
+    public ManagerGBean(String className,
             Map initParams) throws Exception {
         super(); // TODO: make it an attribute
         //Validate
         if (className == null){
             className = "org.apache.catalina.session.StandardManager";
         }
-        
+
         //Create the Manager object
         manager = (Manager)Class.forName(className).newInstance();
 
@@ -66,7 +67,7 @@ public class ManagerGBean extends BaseGB
             CLASSNAME_PARAMETERHANDLER_MAP.get(DEFAULT_PARAMETER_HANDLER).handle(manager,
initParams);
         }
     }
-    
+
     public void doStart() throws Exception {
     }
 
@@ -79,7 +80,7 @@ public class ManagerGBean extends BaseGB
     public Object getInternalObject() {
         return manager;
     }
-    
+
     public static final GBeanInfo GBEAN_INFO;
 
     public static final Map<String, ParametersHandler> CLASSNAME_PARAMETERHANDLER_MAP
= new HashMap<String, ParametersHandler>();
@@ -91,8 +92,8 @@ public class ManagerGBean extends BaseGB
         infoFactory.addAttribute("className", String.class, true);
         infoFactory.addAttribute("initParams", Map.class, true);
         infoFactory.addOperation("getInternalObject");
-        infoFactory.setConstructor(new String[] { 
-                "className", 
+        infoFactory.setConstructor(new String[] {
+                "className",
                 "initParams"});
         GBEAN_INFO = infoFactory.getBeanInfo();
         //Initialize handler map
@@ -134,10 +135,10 @@ public class ManagerGBean extends BaseGB
             }
             Store store = (Store) Class.forName(nameValueMap.get(STORE_CLASSNAME).trim()).newInstance();
             nameValueMap.remove(STORE_CLASSNAME);
-            //Initialize store object            
-            for (Iterator<String> it = nameValueMap.keySet().iterator(); it.hasNext();)
{
-                String sCurrentParameterName = it.next();
-                String sCurrentParameterValue = nameValueMap.get(sCurrentParameterName);
+            //Initialize store object
+            for(Entry<String,String> entry : nameValueMap.entrySet()){
+                String sCurrentParameterName = entry.getKey();
+                String sCurrentParameterValue = entry.getValue();
                 if (sCurrentParameterValue != null) {
                     sCurrentParameterValue = sCurrentParameterValue.trim();
                 }

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java?rev=953946&r1=953945&r2=953946&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java
(original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java
Sat Jun 12 06:37:13 2010
@@ -31,7 +31,6 @@ import javax.security.auth.Subject;
 import org.apache.catalina.Container;
 import org.apache.catalina.Context;
 import org.apache.catalina.Engine;
-import org.apache.catalina.Lifecycle;
 import org.apache.catalina.LifecycleException;
 import org.apache.catalina.LifecycleListener;
 import org.apache.catalina.Service;
@@ -258,10 +257,7 @@ public class TomcatContainer implements 
     }
 
     public void doStop() throws Exception {
-        if (embedded instanceof Lifecycle) {
-            ((Lifecycle)embedded).stop();
-        }
-
+        embedded.stop();
     }
 
     /**

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatServerConfigManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatServerConfigManager.java?rev=953946&r1=953945&r2=953946&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatServerConfigManager.java
(original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatServerConfigManager.java
Sat Jun 12 06:37:13 2010
@@ -21,6 +21,7 @@ package org.apache.geronimo.tomcat;
 import java.io.File;
 import java.io.FileOutputStream;
 import java.util.Map;
+import java.util.Map.Entry;
 
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
@@ -45,7 +46,7 @@ import org.w3c.dom.NodeList;
  * @version $Rev$ $Date$
  */
 public class TomcatServerConfigManager {
-    
+
     private static final Logger log = LoggerFactory.getLogger(TomcatServerConfigManager.class);
 
     private Document server_xml_dom_doc;
@@ -86,7 +87,7 @@ public class TomcatServerConfigManager {
      * @param attributesToUpdate
      *                      The connector attributes that need to be updated.
      * @param uniqueConnectorName
-     *                      the name of connector to be updated. 
+     *                      the name of connector to be updated.
      * @param serviceName
      *                      the name attribute of <Service> that the connector resides
in.
      */
@@ -106,24 +107,20 @@ public class TomcatServerConfigManager {
 
             service.insertBefore(connector, lastConnectorNode);
         }
-        
 
-        // set attributes for the connector
 
-        for (String attributeName : attributesToUpdate.keySet()) {
-            
-            if(attributesToUpdate.get(attributeName)==null){
+        // set attributes for the connector
+        for (Entry<String, String> entry : attributesToUpdate.entrySet()) {
+            String attributeName = entry.getKey();
+            String attributeValue = entry.getValue();
+            if (attributeValue == null) {
                 continue;
             }
-            
             // must use "SSLEnabled" instead of "sslEnabled" because attribute is case-sensitive
in server.xml
             if (attributeName.equalsIgnoreCase("SSLEnabled")) {
-                
-                connector.setAttribute("SSLEnabled", attributesToUpdate.get(attributeName));
-                
+                connector.setAttribute("SSLEnabled", attributeValue);
             } else {
-
-                connector.setAttribute(attributeName, attributesToUpdate.get(attributeName));
+                connector.setAttribute(attributeName, attributeValue);
             }
         }
 
@@ -132,7 +129,7 @@ public class TomcatServerConfigManager {
         persistServerConfig();
 
     }
-    
+
 
 
     private Element findTargetConnector(String name) {
@@ -191,9 +188,9 @@ public class TomcatServerConfigManager {
     }
 
     private void persistServerConfig() {
-        
+
         TransformerFactory tf = TransformerFactory.newInstance();
-       
+
         Transformer transformer;
         try {
             transformer = tf.newTransformer();
@@ -205,7 +202,7 @@ public class TomcatServerConfigManager {
             StreamResult result = new StreamResult(fos);
             transformer.transform(source, result);
         } catch (Exception e1) {
-            
+
             log.error("Error when persist modified dom back to file:"+server_XML_File,e1);
         }
 

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatServerGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatServerGBean.java?rev=953946&r1=953945&r2=953946&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatServerGBean.java
(original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatServerGBean.java
Sat Jun 12 06:37:13 2010
@@ -51,6 +51,7 @@ import org.apache.geronimo.gbean.annotat
 import org.apache.geronimo.gbean.annotation.ParamSpecial;
 import org.apache.geronimo.gbean.annotation.SpecialAttributeType;
 import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.util.IOUtils;
 import org.apache.geronimo.system.configuration.PluginAttributeStore;
 import org.apache.geronimo.system.jmx.MBeanServerReference;
 import org.apache.geronimo.system.serverinfo.ServerInfo;
@@ -116,24 +117,30 @@ public class TomcatServerGBean implement
         if (serverConfig == null) {
             File serverConfigFile = serverInfo.resolveServer(serverConfigLocation);
             this.tomcatServerConfigManager = new TomcatServerConfigManager(serverConfigFile);
-            Reader in = new FileReader(serverConfigFile);
-            StringBuilder b = new StringBuilder();
-            char[] buf = new char[1024];
-            int i;
-            while ((i = in.read(buf)) > 0) {
-                b.append(buf, 0, i);
+            Reader in = null;
+            try {
+                in = new FileReader(serverConfigFile);
+                StringBuilder b = new StringBuilder();
+                char[] buf = new char[1024];
+                int i;
+                while ((i = in.read(buf)) > 0) {
+                    b.append(buf, 0, i);
+                }
+                serverConfig = b.toString();
+            } finally {
+                IOUtils.close(in);
             }
-            serverConfig = b.toString();
         }
         if (attributeStore != null) {
             serverConfig = attributeStore.substitute(serverConfig);
         }
-        Reader in = new StringReader(serverConfig);
+        Reader in = null;
         try {
+            in = new StringReader(serverConfig);
             ServerType serverType = loadServerType(in);
             server = serverType.build(classLoader, kernel);
         } finally {
-            in.close();
+            IOUtils.close(in);
         }
     }
 

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/model/EngineType.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/model/EngineType.java?rev=953946&r1=953945&r2=953946&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/model/EngineType.java
(original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/model/EngineType.java
Sat Jun 12 06:37:13 2010
@@ -33,7 +33,6 @@ import javax.xml.namespace.QName;
 
 import org.apache.catalina.Engine;
 import org.apache.catalina.Host;
-import org.apache.catalina.Lifecycle;
 import org.apache.catalina.LifecycleListener;
 import org.apache.catalina.Realm;
 import org.apache.catalina.core.StandardEngine;
@@ -357,13 +356,11 @@ public class EngineType {
             engine.setCluster(getCluster().getCluster(cl));
         }
         //listener
-        if (engine instanceof Lifecycle) {
-            Lifecycle lifecycle = (Lifecycle) engine;
-            for (ListenerType listenerType: getListener()) {
-                LifecycleListener listener = listenerType.getLifecycleListener(cl);
-                lifecycle.addLifecycleListener(listener);
-            }
+        for (ListenerType listenerType : getListener()) {
+            LifecycleListener listener = listenerType.getLifecycleListener(cl);
+            engine.addLifecycleListener(listener);
         }
+
         return engine;
     }
 }

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/model/HostType.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/model/HostType.java?rev=953946&r1=953945&r2=953946&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/model/HostType.java
(original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/model/HostType.java
Sat Jun 12 06:37:13 2010
@@ -32,7 +32,6 @@ import javax.xml.namespace.QName;
 
 import org.apache.catalina.Cluster;
 import org.apache.catalina.Host;
-import org.apache.catalina.Lifecycle;
 import org.apache.catalina.LifecycleListener;
 import org.apache.catalina.Pipeline;
 import org.apache.catalina.Realm;
@@ -550,13 +549,12 @@ public class HostType {
         ObjectRecipe recipe = new ObjectRecipe(className, properties);
         recipe.allow(Option.IGNORE_MISSING_PROPERTIES);
         Host host = (Host) recipe.create(cl);
-        if (host instanceof Lifecycle) {
-            Lifecycle lifecycle = host;
-            for (ListenerType listenerType : getListener()) {
-                LifecycleListener listener = listenerType.getLifecycleListener(cl);
-                lifecycle.addLifecycleListener(listener);
-            }
+
+        for (ListenerType listenerType : getListener()) {
+            LifecycleListener listener = listenerType.getLifecycleListener(cl);
+            host.addLifecycleListener(listener);
         }
+
         //alias
         for (String alias : getAlias()) {
             host.addAlias(alias);

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/model/ServerType.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/model/ServerType.java?rev=953946&r1=953945&r2=953946&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/model/ServerType.java
(original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/model/ServerType.java
Sat Jun 12 06:37:13 2010
@@ -30,7 +30,6 @@ import javax.xml.bind.annotation.XmlElem
 import javax.xml.bind.annotation.XmlType;
 import javax.xml.namespace.QName;
 
-import org.apache.catalina.Lifecycle;
 import org.apache.catalina.LifecycleListener;
 import org.apache.catalina.Server;
 import org.apache.catalina.Service;
@@ -76,7 +75,7 @@ import org.slf4j.LoggerFactory;
 public class ServerType {
 
     private static final Logger logger = LoggerFactory.getLogger(ServerType.class);
-    
+
     @XmlElement(name = "Listener")
     protected List<ListenerType> listener;
     @XmlElement(name = "GlobalNamingResources")
@@ -280,12 +279,10 @@ public class ServerType {
         Server instance = (Server) recipe.create(cl);
         instance.setPort(port);
         instance.setShutdown(shutdown);
-        if (instance instanceof Lifecycle) {
-            Lifecycle lifecycle = (Lifecycle) instance;
-            for (ListenerType listenerType: getListener()) {
-                LifecycleListener listener = listenerType.getLifecycleListener(cl);
-                lifecycle.addLifecycleListener(listener);
-            }
+
+        for (ListenerType listenerType : getListener()) {
+            LifecycleListener listener = listenerType.getLifecycleListener(cl);
+            instance.addLifecycleListener(listener);
         }
 
         NamingResources globalNamingResources = new NamingResources();
@@ -293,7 +290,7 @@ public class ServerType {
             logger.warn("All the resource settings in the server.xml are ignored, please
use Geronimo deployment plan to define those configurations");
         }
         /*
-        for (NamingResourcesType naming: getGlobalNamingResources()) {            
+        for (NamingResourcesType naming: getGlobalNamingResources()) {
             naming.merge(globalNamingResources, cl);
         }
         */

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/model/ServiceType.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/model/ServiceType.java?rev=953946&r1=953945&r2=953946&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/model/ServiceType.java
(original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/model/ServiceType.java
Sat Jun 12 06:37:13 2010
@@ -32,7 +32,6 @@ import javax.xml.namespace.QName;
 
 import org.apache.catalina.Service;
 import org.apache.catalina.Executor;
-import org.apache.catalina.Lifecycle;
 import org.apache.catalina.LifecycleListener;
 import org.apache.catalina.Engine;
 import org.apache.catalina.core.StandardService;
@@ -287,12 +286,9 @@ public class ServiceType {
             Connector connector = connectorType.getConnector(cl, service);
             service.addConnector(connector);
         }
-        if (service instanceof Lifecycle) {
-            Lifecycle lifecycle = (Lifecycle) service;
-            for (ListenerType listenerType: getListener()) {
-                LifecycleListener listener = listenerType.getLifecycleListener(cl);
-                lifecycle.addLifecycleListener(listener);
-            }
+        for (ListenerType listenerType : getListener()) {
+            LifecycleListener listener = listenerType.getLifecycleListener(cl);
+            service.addLifecycleListener(listener);
         }
 
         if (getEngine() != null) {

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/security/authentication/DigestAuthenticator.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/security/authentication/DigestAuthenticator.java?rev=953946&r1=953945&r2=953946&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/security/authentication/DigestAuthenticator.java
(original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/security/authentication/DigestAuthenticator.java
Sat Jun 12 06:37:13 2010
@@ -245,7 +245,7 @@ public class DigestAuthenticator impleme
         } else if (quotedString.length() > 2) {
             return quotedString.substring(1, quotedString.length() - 1);
         } else {
-            return new String();
+            return "";
         }
     }
 



Mime
View raw message