Commits

Anonymous committed d74ad69

Moved static instance out of ConfigurationManager into new XWorkStatic and started doing 1.5 updates with generics and enhanced for-loops.

git-svn-id: http://svn.opensymphony.com/svn/xwork/trunk@1023e221344d-f017-0410-9bd5-d282ab1896d7

  • Participants
  • Parent commits 6c1cbb6

Comments (0)

Files changed (47)

     <!-- NOTE: this property is purely here to make a clear distinction in IDEA where the common build is -->
     <property name="------common-properties-below------" value="Common properties below:"/>
 
-    <property name="compile.version" value="1.3"/>
-    <property name="test.compile.version" value="1.3"/>
+    <property name="compile.version" value="1.5"/>
+    <property name="test.compile.version" value="1.5"/>
 
     <dirname property="common.dir" file="${ant.file.common}"/>
     <property file="build.properties"/>
 
         <mkdir dir="${build.clover}"/>
         <clover-setup initString="${build.clover}/coverage.db">
-            <statementContext name="logIsDebugEnabled" regexp="[\s]*if[\s]*\([\s]*(log|_log|LOG|_LOG)\.isDebugEnabled.*"/>
+            <statementContext name="logIsDebugEnabled"
+                              regexp="[\s]*if[\s]*\([\s]*(log|_log|LOG|_LOG)\.isDebugEnabled.*"/>
             <statementContext name="logDebug" regexp="[\s]*(log|_log|LOG|_LOG)\.debug[\s]*\(.*"/>
             <files>
                 <exclude name="${src.test}/**/*.java"/>
 
     <target name="test" depends="junit-check, clover-check, compile, test-compile" description="run tests"
             unless="skip.tests">
-        <run-junit />
+        <run-junit/>
     </target>
 
     <macrodef name="run-junit">
-        <attribute name="classpathref" default="junit.cp" />
+        <attribute name="classpathref" default="junit.cp"/>
         <sequential>
-          <mkdir dir="${dist.docs}/junit"/>
-          <junit haltonfailure="no" haltonerror="yes" fork="yes" forkmode="once" failureproperty="test.failure">
-              <jvmarg value="-Djava.awt.headless=true"/>
-              <jvmarg value="-Dorg.xml.sax.driver=org.apache.crimson.parser.XMLReaderImpl"/>
-              <classpath>
-                  <path refid="@{classpathref}"/>
-              </classpath>
-
-              <formatter type="plain" useFile="false"/>
-              <formatter type="xml"/>
-
-              <batchtest todir="${dist.docs}/junit">
-                  <fileset dir="${src.test}">
-                      <patternset refid="src.test.pattern"/>
-                  </fileset>
-              </batchtest>
-          </junit>          
+            <mkdir dir="${dist.docs}/junit"/>
+            <junit haltonfailure="no" haltonerror="yes" fork="yes" forkmode="once" failureproperty="test.failure">
+                <jvmarg value="-Djava.awt.headless=true"/>
+                <jvmarg value="-Dorg.xml.sax.driver=org.apache.crimson.parser.XMLReaderImpl"/>
+                <classpath>
+                    <path refid="@{classpathref}"/>
+                </classpath>
+
+                <formatter type="plain" useFile="false"/>
+                <formatter type="xml"/>
+
+                <batchtest todir="${dist.docs}/junit">
+                    <fileset dir="${src.test}">
+                        <patternset refid="src.test.pattern"/>
+                    </fileset>
+                </batchtest>
+            </junit>
         </sequential>
     </macrodef>
-  
+
     <target name="javadocs" description="generate javadocs" depends="init">
         <mkdir dir="${dist.docs}/api"/>
         <javadoc sourcepath="${src.java}"
         <copy todir="${dist}/tiger">
             <fileset dir="tiger">
                 <exclude name="build/"/>
-                <exclude name="*.i*"/>                
+                <exclude name="*.i*"/>
             </fileset>
         </copy>
 
                 <exclude name="docs/junit/**/*"/>
             </zipfileset>
         </zip>
-        
-        <move file="${build}/${name}-${version}.zip" todir="${dist}" />
+
+        <move file="${build}/${name}-${version}.zip" todir="${dist}"/>
     </target>
 
     <target name="website" depends="javadocs, docs.impl"/>
                       **/*.dtd,
                       **/*.xsl,
                       **/*.xslt,
-                      **/*.html" />
-        
+                      **/*.html"/>
+
         <fixcrlf eol="lf" srcdir="${basedir}/tiger/src"
                  includes="**/*.sh,
                       **/*.properties,
                       **/*.dtd,
                       **/*.xsl,
                       **/*.xslt,
-                      **/*.html" />
+                      **/*.html"/>
     </target>
 
 
-
     <target name="ivyrep" depends="jar, ivyrep.impl"/>
 
     <target name="ivyrep.impl">
                 </configuration>
             </plugin>
             <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>1.5</source>
+                    <target>1.5</target>
+                </configuration>
+            </plugin>
+            <plugin>
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
                     <includes>

src/java/com/opensymphony/xwork/DefaultActionInvocation.java

 package com.opensymphony.xwork;
 
 import com.opensymphony.xwork.config.entities.ActionConfig;
-import com.opensymphony.xwork.config.entities.ResultConfig;
 import com.opensymphony.xwork.config.entities.InterceptorMapping;
+import com.opensymphony.xwork.config.entities.ResultConfig;
 import com.opensymphony.xwork.interceptor.PreResultListener;
 import com.opensymphony.xwork.util.OgnlValueStack;
 import com.opensymphony.xwork.util.XWorkContinuationConfig;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.lang.reflect.Proxy;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
 
 
 /**
                 resultConfig = (ResultConfig) results.get(resultCode);
             } catch (NullPointerException e) {
             }
-            if (resultConfig == null ) {
+            if (resultConfig == null) {
                 // If no result is found for the given resultCode, try to get a wildcard '*' match.
                 resultConfig = (ResultConfig) results.get("*");
             }
             gripe += (((" -- " + e.getMessage()) != null) ? e.getMessage() : " [no message in exception]");
             throw new XworkException(gripe, e, proxy.getConfig());
         }
-        
+
         if (ObjectFactory.getContinuationPackage() != null) prepareContinuation();
     }
 
 
                 return result;
             } else if (t instanceof Exception) {
-                throw (Exception) t;
+                throw(Exception) t;
             } else {
                 throw e;
             }

src/java/com/opensymphony/xwork/DefaultActionProxy.java

  */
 package com.opensymphony.xwork;
 
+import com.opensymphony.util.TextUtils;
 import com.opensymphony.xwork.config.ConfigurationException;
-import com.opensymphony.xwork.config.ConfigurationManager;
 import com.opensymphony.xwork.config.entities.ActionConfig;
 import com.opensymphony.xwork.util.LocalizedTextUtil;
-import com.opensymphony.util.TextUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
         this.executeResult = executeResult;
         this.extraContext = extraContext;
 
-        config = ConfigurationManager.getConfiguration().getRuntimeConfiguration().getActionConfig(namespace, actionName);
+        config = XWorkStatic.getConfigurationManager().getConfiguration().getRuntimeConfiguration().getActionConfig(namespace, actionName);
 
         if (config == null) {
             String message;

src/java/com/opensymphony/xwork/XWorkStatic.java

+package com.opensymphony.xwork;
+
+import com.opensymphony.xwork.config.ConfigurationManager;
+
+/**
+ * XWorkStatic
+ * <p/>
+ * Created : May 20, 2006 3:25:15 PM
+ *
+ * @author Jason Carreira <jcarreira@eplus.com>
+ */
+public class XWorkStatic {
+    private static ConfigurationManager configurationManager = new ConfigurationManager();
+
+    static {
+        configurationManager.destroyConfiguration();
+    }
+
+    public static ConfigurationManager getConfigurationManager() {
+        return configurationManager;
+    }
+
+    public static void setConfigurationManager(ConfigurationManager configurationManager) {
+        XWorkStatic.configurationManager = configurationManager;
+    }
+}

src/java/com/opensymphony/xwork/XWorkTestCase.java

 
 package com.opensymphony.xwork;
 
-import com.opensymphony.xwork.config.ConfigurationManager;
 import com.opensymphony.xwork.util.LocalizedTextUtil;
 import com.opensymphony.xwork.util.OgnlValueStack;
 import com.opensymphony.xwork.util.XWorkConverter;
  * @author plightbo
  */
 public abstract class XWorkTestCase extends TestCase {
-    
+
     protected void setUp() throws Exception {
         // Reset the value stack
         OgnlValueStack stack = new OgnlValueStack();
         ActionContext.setContext(new ActionContext(stack.getContext()));
 
         //  clear out configuration
-        ConfigurationManager.destroyConfiguration();
+        XWorkStatic.getConfigurationManager().destroyConfiguration();
 
         // clear out localization
         LocalizedTextUtil.reset();
     protected void tearDown() throws Exception {
         // reset the old object factory
         ObjectFactory.setObjectFactory(new ObjectFactory());
-        
+
         //  clear out configuration
-        ConfigurationManager.destroyConfiguration();
+        XWorkStatic.getConfigurationManager().destroyConfiguration();
     }
 }

src/java/com/opensymphony/xwork/config/ConfigurationManager.java

 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
 
 
 /**
- * ConfigurationManager - central for XWork Configuration management, including 
+ * ConfigurationManager - central for XWork Configuration management, including
  * its ConfigurationProvider.
  *
  * @author Jason Carreira
 public class ConfigurationManager {
 
     protected static final Log LOG = LogFactory.getLog(ConfigurationManager.class);
-    protected static Configuration configurationInstance;
-    private static List configurationProviders = new ArrayList();
+    protected Configuration configuration;
+    protected Lock providerLock = new ReentrantLock();
+    private List<ConfigurationProvider> configurationProviders = new CopyOnWriteArrayList<ConfigurationProvider>();
 
-    static {
-        destroyConfiguration();
-    }
-
-
-    private ConfigurationManager() {
-    }
-
-
-    public static synchronized void setConfiguration(Configuration configuration) {
-        configurationInstance = configuration;
+    public ConfigurationManager() {
     }
 
     /**
      *
      * @see com.opensymphony.xwork.config.impl.DefaultConfiguration
      */
-    public static synchronized Configuration getConfiguration() {
-        if (configurationInstance == null) {
-            configurationInstance = new DefaultConfiguration();
+    public synchronized Configuration getConfiguration() {
+        if (configuration == null) {
+            setConfiguration(new DefaultConfiguration());
             try {
-                configurationInstance.reload();
+                configuration.reload();
             } catch (ConfigurationException e) {
-                configurationInstance = null;
+                setConfiguration(null);
                 throw e;
             }
         } else {
             conditionalReload();
         }
 
-        return configurationInstance;
+        return configuration;
+    }
+
+    public synchronized void setConfiguration(Configuration configuration) {
+        this.configuration = configuration;
     }
 
     /**
-     * <p/>
-     * get the current list of ConfigurationProviders.
-     * </p>
-     * <p/>
-     * if no custom ConfigurationProviders have been added, this method
+     * Get the current list of ConfigurationProviders. If no custom ConfigurationProviders have been added, this method
      * will return a list containing only the default ConfigurationProvider, XMLConfigurationProvider.  if a custom
      * ConfigurationProvider has been added, then the XmlConfigurationProvider must be added by hand.
      * </p>
-     *
+     * <p/>
      * TODO: the lazy instantiation of XmlConfigurationProvider should be refactored to be elsewhere.  the behavior described above seems unintuitive.
      *
      * @return the list of registered ConfigurationProvider objects
-     * @see com.opensymphony.xwork.config.ConfigurationProvider
+     * @see ConfigurationProvider
      */
-    public static List getConfigurationProviders() {
-        synchronized (configurationProviders) {
+    public List<ConfigurationProvider> getConfigurationProviders() {
+        providerLock.lock();
+        try {
             if (configurationProviders.size() == 0) {
                 configurationProviders.add(new XmlConfigurationProvider());
             }
 
             return configurationProviders;
+        } finally {
+            providerLock.unlock();
         }
     }
 
     /**
-     * adds a configuration provider to the List of ConfigurationProviders.  a given ConfigurationProvider may be added
-     * more than once
+     * Set the list of configuration providers
      *
-     * @param provider the ConfigurationProvider to register
+     * @param configurationProviders
      */
-    public static void addConfigurationProvider(ConfigurationProvider provider) {
-        synchronized (configurationProviders) {
-            if (!configurationProviders.contains(provider)) {
-                configurationProviders.add(provider);
-            }
+    public void setConfigurationProviders(List<ConfigurationProvider> configurationProviders) {
+        providerLock.lock();
+        try {
+            this.configurationProviders = new CopyOnWriteArrayList<ConfigurationProvider>(configurationProviders);
+        } finally {
+            providerLock.unlock();
         }
     }
 
     /**
-     * clears the registered ConfigurationProviders.  this method will call destroy() on each of the registered
-     * ConfigurationProviders
+     * adds a configuration provider to the List of ConfigurationProviders.  a given ConfigurationProvider may be added
+     * more than once
      *
-     * @see com.opensymphony.xwork.config.ConfigurationProvider#destroy
+     * @param provider the ConfigurationProvider to register
      */
-    public static void clearConfigurationProviders() {
-        synchronized (configurationProviders) {
-            for (Iterator iterator = configurationProviders.iterator();
-                 iterator.hasNext();) {
-                ConfigurationProvider provider = (ConfigurationProvider) iterator.next();
-                provider.destroy();
-            }
-
-            configurationProviders.clear();
+    public void addConfigurationProvider(ConfigurationProvider provider) {
+        if (!configurationProviders.contains(provider)) {
+            configurationProviders.add(provider);
         }
     }
 
-    public static synchronized void destroyConfiguration() {
-        synchronized (configurationProviders) {
-        	clearConfigurationProviders(); // let's destroy the ConfigurationProvider first
-            configurationProviders = new ArrayList();
-            
-            if (configurationInstance != null)
-            	configurationInstance.destroy(); // let's destroy it first, before nulling it.
-            configurationInstance = null;
-        }
-    }
 
     /**
      * reloads the Configuration files if the configuration files indicate that they need to be reloaded.
-     *
+     * <p/>
      * <B>NOTE:</b> FileManager could be configured through webwork.properties through
      * webwork.configuration.xml.reload  property.
      */
-    private static synchronized void conditionalReload() {
+    public synchronized void conditionalReload() {
         if (FileManager.isReloadingConfigs()) {
             boolean reload;
 
-            synchronized (configurationProviders) {
-                if (LOG.isDebugEnabled()) {
-                    LOG.debug("Checking ConfigurationProviders for reload.");
-                }
-
-                reload = false;
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("Checking ConfigurationProviders for reload.");
+            }
 
-                for (Iterator iterator = getConfigurationProviders().iterator();
-                     iterator.hasNext();) {
-                    ConfigurationProvider provider = (ConfigurationProvider) iterator.next();
+            reload = false;
 
-                    if (provider.needsReload()) {
-                        reload = true;
+            for (ConfigurationProvider provider : configurationProviders) {
+                if (provider.needsReload()) {
+                    reload = true;
 
-                        break;
-                    }
+                    break;
                 }
             }
 
             if (reload) {
-                configurationInstance.reload();
+                configuration.reload();
             }
         }
     }
+
+    /**
+     * clears the registered ConfigurationProviders.  this method will call destroy() on each of the registered
+     * ConfigurationProviders
+     *
+     * @see com.opensymphony.xwork.config.ConfigurationProvider#destroy
+     */
+    public void clearConfigurationProviders() {
+        for (ConfigurationProvider configurationProvider : configurationProviders) {
+            configurationProvider.destroy();
+        }
+
+        configurationProviders.clear();
+    }
+
+    public synchronized void destroyConfiguration() {
+        clearConfigurationProviders(); // let's destroy the ConfigurationProvider first
+        setConfigurationProviders(new CopyOnWriteArrayList<ConfigurationProvider>());
+        if (configuration != null)
+            configuration.destroy(); // let's destroy it first, before nulling it.
+        configuration = null;
+    }
 }

src/java/com/opensymphony/xwork/config/entities/ActionConfig.java

 package com.opensymphony.xwork.config.entities;
 
 import com.opensymphony.xwork.util.location.Located;
+
 import java.io.Serializable;
 import java.util.*;
 
  */
 public class ActionConfig extends Located implements InterceptorListHolder, Parameterizable, Serializable {
 
-    protected List externalRefs;
-    protected List interceptors;
-    protected Map params;
-    protected Map results;
-    protected List exceptionMappings;
+    protected List<ExternalReference> externalRefs;
+    protected List<InterceptorMapping> interceptors;
+    protected Map<String, Object> params;
+    protected Map<String, ResultConfig> results;
+    protected List<ExceptionMappingConfig> exceptionMappings;
     protected String className;
     protected String methodName;
     protected String packageName;
 
 
     public ActionConfig() {
-        params = new LinkedHashMap();
-        results = new LinkedHashMap();
-        interceptors = new ArrayList();
-        externalRefs = new ArrayList();
-        exceptionMappings = new ArrayList();
+        params = new LinkedHashMap<String, Object>();
+        results = new LinkedHashMap<String, ResultConfig>();
+        interceptors = new ArrayList<InterceptorMapping>();
+        externalRefs = new ArrayList<ExternalReference>();
+        exceptionMappings = new ArrayList<ExceptionMappingConfig>();
     }
 
     //Helper constuctor to maintain backward compatibility with objects that create ActionConfigs
     //TODO this should be removed if these changes are rolled in to xwork CVS
-    public ActionConfig(String methodName, Class clazz, Map parameters, Map results, List interceptors) {
+    public ActionConfig(String methodName, Class clazz, Map<String, Object> parameters, Map<String, ResultConfig> results, List<InterceptorMapping> interceptors) {
         this(methodName, clazz.getName(), parameters, results, interceptors);
     }
 
-    public ActionConfig(String methodName, Class clazz, Map parameters, Map results, List interceptors, List exceptionMappings) {
+    public ActionConfig(String methodName, Class clazz, Map<String, Object> parameters, Map<String, ResultConfig> results, List<InterceptorMapping> interceptors, List<ExceptionMappingConfig> exceptionMappings) {
         this(methodName, clazz.getName(), parameters, results, interceptors, exceptionMappings);
     }
 
-    public ActionConfig(String methodName, String className, Map parameters, Map results, List interceptors) {
-        this(methodName, className, parameters, results, interceptors, Collections.EMPTY_LIST, new String());
+    public ActionConfig(String methodName, String className, Map<String, Object> parameters, Map<String, ResultConfig> results, List<InterceptorMapping> interceptors) {
+        this(methodName, className, parameters, results, interceptors, Collections.EMPTY_LIST, "");
     }
 
-    public ActionConfig(String methodName, String className, Map parameters, Map results, List interceptors, List exceptionMappings) {
-        this(methodName, className, parameters, results, interceptors, Collections.EMPTY_LIST, exceptionMappings, new String());
+    public ActionConfig(String methodName, String className, Map<String, Object> parameters, Map<String, ResultConfig> results, List<InterceptorMapping> interceptors, List<ExceptionMappingConfig> exceptionMappings) {
+        this(methodName, className, parameters, results, interceptors, Collections.EMPTY_LIST, exceptionMappings, "");
     }
 
     //TODO If this is commited to CVS we should put the package arg at the front of the ctor and fix
     //code that uses it
-    public ActionConfig(String methodName, String className, Map parameters, Map results, List interceptors, List externalRefs, String packageName) {
+    public ActionConfig(String methodName, String className, Map<String, Object> parameters, Map<String, ResultConfig> results, List<InterceptorMapping> interceptors, List<ExternalReference> externalRefs, String packageName) {
         this(methodName, className, parameters, results, interceptors, externalRefs, Collections.EMPTY_LIST, packageName);
     }
 
-    public ActionConfig(String methodName, String className, Map parameters, Map results, List interceptors, List externalRefs, List exceptionMappings, String packageName) {
+    public ActionConfig(String methodName, String className, Map<String, Object> parameters, Map<String, ResultConfig> results,
+                        List<InterceptorMapping> interceptors, List<ExternalReference> externalRefs,
+                        List<ExceptionMappingConfig> exceptionMappings, String packageName) {
         this.methodName = methodName;
         this.interceptors = interceptors;
         this.params = parameters;
         this.packageName = packageName;
     }
 
-
     public void setClassName(String className) {
         this.className = className;
     }
         return className;
     }
 
-    public List getExternalRefs() {
+    public List<ExternalReference> getExternalRefs() {
         return externalRefs;
     }
 
-    public List getExceptionMappings() {
+    public List<ExceptionMappingConfig> getExceptionMappings() {
         return exceptionMappings;
     }
 
-    public List getInterceptors() {
+    public List<InterceptorMapping> getInterceptors() {
         if (interceptors == null) {
-            interceptors = new ArrayList();
+            interceptors = new ArrayList<InterceptorMapping>();
         }
 
         return interceptors;
         return packageName;
     }
 
-    public void setParams(Map params) {
+    public void setParams(Map<String, Object> params) {
         this.params = params;
     }
 
-    public Map getParams() {
+    public Map<String, Object> getParams() {
         if (params == null) {
-            params = new LinkedHashMap();
+            params = new LinkedHashMap<String, Object>();
         }
 
         return params;
     }
 
-    public void setResults(Map results) {
+    public void setResults(Map<String, ResultConfig> results) {
         this.results = results;
     }
 
-    public Map getResults() {
+    public Map<String, ResultConfig> getResults() {
         if (results == null) {
-            results = new LinkedHashMap();
+            results = new LinkedHashMap<String, ResultConfig>();
         }
 
         return results;
         getExternalRefs().add(reference);
     }
 
-    public void addExternalRefs(List externalRefs) {
-        getExternalRefs().addAll(externalRefs);
+    public void addExternalRefs(List<ExternalReference> refs) {
+        getExternalRefs().addAll(refs);
     }
 
     public void addExceptionMapping(ExceptionMappingConfig exceptionMapping) {
         getExceptionMappings().add(exceptionMapping);
     }
 
-    public void addExceptionMappings(List exceptionMappings) {
-        getExceptionMappings().addAll(exceptionMappings);
+    public void addExceptionMappings(List<? extends ExceptionMappingConfig> mappings) {
+        getExceptionMappings().addAll(mappings);
     }
 
     public void addInterceptor(InterceptorMapping interceptor) {
         getInterceptors().add(interceptor);
     }
 
-    public void addInterceptors(List interceptors) {
+    public void addInterceptors(List<InterceptorMapping> interceptors) {
         getInterceptors().addAll(interceptors);
     }
 
             return false;
         }
 
-        if ((results != null) ? (!results.equals(actionConfig.results)) : (actionConfig.results != null)) {
-            return false;
-        }
+        return !((results != null) ? (!results.equals(actionConfig.results)) : (actionConfig.results != null));
 
-        return true;
     }
 
     public int hashCode() {
         sb.append(className);
         if (methodName != null) {
             sb.append(".").append(methodName).append("()");
-        } 
+        }
         sb.append(" - ").append(location);
         sb.append("}");
         return sb.toString();

src/java/com/opensymphony/xwork/config/entities/InterceptorListHolder.java

 
     void addInterceptor(InterceptorMapping interceptor);
 
-    void addInterceptors(List interceptors);
+    void addInterceptors(List<InterceptorMapping> interceptors);
 }

src/java/com/opensymphony/xwork/config/entities/InterceptorStackConfig.java

  */
 package com.opensymphony.xwork.config.entities;
 
+import com.opensymphony.xwork.util.location.Located;
+
+import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
-import java.io.Serializable;
-
-import com.opensymphony.xwork.util.location.Located;
 
 
 /**
  */
 public class InterceptorStackConfig extends Located implements InterceptorListHolder, Serializable {
 
-    private List interceptors;
+    private List<InterceptorMapping> interceptors;
     private String name;
 
 
     public InterceptorStackConfig() {
-        this.interceptors = new ArrayList();
+        this.interceptors = new ArrayList<InterceptorMapping>();
     }
 
     public InterceptorStackConfig(String name) {
     }
 
 
-    public Collection getInterceptors() {
+    public Collection<InterceptorMapping> getInterceptors() {
         return interceptors;
     }
 
         this.interceptors.add(interceptor);
     }
 
-    public void addInterceptors(List interceptors) {
+    public void addInterceptors(List<InterceptorMapping> interceptors) {
         this.interceptors.addAll(interceptors);
     }
 

src/java/com/opensymphony/xwork/config/entities/PackageConfig.java

 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-import java.util.*;
 import java.io.Serializable;
+import java.util.*;
 
 
 /**
 
 
     private ExternalReferenceResolver externalRefResolver = null;
-    private Map actionConfigs = new LinkedHashMap();
-    private Map globalResultConfigs = new LinkedHashMap();
+    private Map<String, ActionConfig> actionConfigs = new LinkedHashMap<String, ActionConfig>();
+    private Map<String, ResultConfig> globalResultConfigs = new LinkedHashMap<String, ResultConfig>();
     private Map interceptorConfigs = new LinkedHashMap();
-    private Map resultTypeConfigs = new LinkedHashMap();
+    private Map<String, ResultTypeConfig> resultTypeConfigs = new LinkedHashMap<String, ResultTypeConfig>();
     private List globalExceptionMappingConfigs = new ArrayList();
-    private Set parents = new HashSet();
+    private Set<PackageConfig> parents = new HashSet<PackageConfig>();
     private String defaultInterceptorRef;
     private String defaultActionRef;
     private String defaultResultType;
     private boolean isAbstract = false;
 
 
-
-
     public PackageConfig() {
     }
 
         return isAbstract;
     }
 
-    public Map getActionConfigs() {
+    public Map<String, ActionConfig> getActionConfigs() {
         return actionConfigs;
     }
 
      * @return a Map of ActionConfig Objects with the action name as the key
      * @see ActionConfig
      */
-    public Map getAllActionConfigs() {
-        Map retMap = new LinkedHashMap();
+    public Map<String, ActionConfig> getAllActionConfigs() {
+        Map<String, ActionConfig> retMap = new LinkedHashMap<String, ActionConfig>();
 
         if (!parents.isEmpty()) {
-            for (Iterator iterator = parents.iterator(); iterator.hasNext();) {
-                PackageConfig parentContext = (PackageConfig) iterator.next();
-                retMap.putAll(parentContext.getAllActionConfigs());
+            for (PackageConfig parent : parents) {
+                retMap.putAll(parent.getAllActionConfigs());
             }
         }
 
      * @return a Map of Result Objects with the result name as the key
      * @see ResultConfig
      */
-    public Map getAllGlobalResults() {
-        Map retMap = new LinkedHashMap();
+    public Map<String, ResultConfig> getAllGlobalResults() {
+        Map<String, ResultConfig> retMap = new LinkedHashMap<String, ResultConfig>();
 
         if (!parents.isEmpty()) {
-            for (Iterator iterator = parents.iterator(); iterator.hasNext();) {
-                PackageConfig parentContext = (PackageConfig) iterator.next();
-                retMap.putAll(parentContext.getAllGlobalResults());
+            for (PackageConfig parentConfig : parents) {
+                retMap.putAll(parentConfig.getAllGlobalResults());
             }
         }
 
         Map retMap = new LinkedHashMap();
 
         if (!parents.isEmpty()) {
-            for (Iterator iterator = parents.iterator(); iterator.hasNext();) {
-                PackageConfig parentContext = (PackageConfig) iterator.next();
+            for (Iterator<PackageConfig> iterator = parents.iterator(); iterator.hasNext();) {
+                PackageConfig parentContext = iterator.next();
                 retMap.putAll(parentContext.getAllInterceptorConfigs());
             }
         }
      * @return a Map of ResultTypeConfig Objects with the result type name as the key
      * @see ResultTypeConfig
      */
-    public Map getAllResultTypeConfigs() {
-        Map retMap = new LinkedHashMap();
+    public Map<String, ResultTypeConfig> getAllResultTypeConfigs() {
+        Map<String, ResultTypeConfig> retMap = new LinkedHashMap<String, ResultTypeConfig>();
 
         if (!parents.isEmpty()) {
-            for (Iterator iterator = parents.iterator(); iterator.hasNext();) {
-                PackageConfig parentContext = (PackageConfig) iterator.next();
+            for (Iterator<PackageConfig> iterator = parents.iterator(); iterator.hasNext();) {
+                PackageConfig parentContext = iterator.next();
                 retMap.putAll(parentContext.getAllResultTypeConfigs());
             }
         }
      * @return a List of ExceptionMappingConfigs Objects with the result type name as the key
      * @see ExceptionMappingConfig
      */
-    public List getAllExceptionMappingConfigs() {
-        List allExceptionMappings = new ArrayList();
+    public List<ExceptionMappingConfig> getAllExceptionMappingConfigs() {
+        List<ExceptionMappingConfig> allExceptionMappings = new ArrayList<ExceptionMappingConfig>();
 
         if (!parents.isEmpty()) {
-            for (Iterator iterator = parents.iterator(); iterator.hasNext();) {
-                PackageConfig parentContext = (PackageConfig) iterator.next();
+            for (Iterator<PackageConfig> iterator = parents.iterator(); iterator.hasNext();) {
+                PackageConfig parentContext = iterator.next();
                 allExceptionMappings.addAll(parentContext.getAllExceptionMappingConfigs());
             }
         }
         if (externalRefResolver == null) {
             PackageConfig packageConfig;
 
-            for (Iterator iter = getParents().iterator(); iter.hasNext();) {
-                packageConfig = (PackageConfig) iter.next();
+            for (Iterator<PackageConfig> iter = getParents().iterator(); iter.hasNext();) {
+                packageConfig = iter.next();
 
                 if (packageConfig.getExternalRefResolver() != null) {
                     externalRefResolver = packageConfig.getExternalRefResolver();
      */
     public String getFullDefaultInterceptorRef() {
         if ((defaultInterceptorRef == null) && !parents.isEmpty()) {
-            for (Iterator iterator = parents.iterator(); iterator.hasNext();) {
-                PackageConfig parent = (PackageConfig) iterator.next();
+            for (Iterator<PackageConfig> iterator = parents.iterator(); iterator.hasNext();) {
+                PackageConfig parent = iterator.next();
                 String parentDefault = parent.getFullDefaultInterceptorRef();
 
                 if (parentDefault != null) {
      */
     public String getFullDefaultActionRef() {
         if ((defaultActionRef == null) && !parents.isEmpty()) {
-            for (Iterator iterator = parents.iterator(); iterator.hasNext();) {
-                PackageConfig parent = (PackageConfig) iterator.next();
+            for (Iterator<PackageConfig> iterator = parents.iterator(); iterator.hasNext();) {
+                PackageConfig parent = iterator.next();
                 String parentDefault = parent.getFullDefaultActionRef();
 
                 if (parentDefault != null) {
      */
     public String getFullDefaultResultType() {
         if ((defaultResultType == null) && !parents.isEmpty()) {
-            for (Iterator iterator = parents.iterator(); iterator.hasNext();) {
-                PackageConfig parent = (PackageConfig) iterator.next();
+            for (Iterator<PackageConfig> iterator = parents.iterator(); iterator.hasNext();) {
+                PackageConfig parent = iterator.next();
                 String parentDefault = parent.getFullDefaultResultType();
 
                 if (parentDefault != null) {
      * @return a Map of ResultConfig objects keyed by result name
      * @see ResultConfig
      */
-    public Map getGlobalResultConfigs() {
+    public Map<String, ResultConfig> getGlobalResultConfigs() {
         return globalResultConfigs;
     }
 
         return namespace;
     }
 
-    public List getParents() {
-        return new ArrayList(parents);
+    public List<PackageConfig> getParents() {
+        return new ArrayList<PackageConfig>(parents);
     }
 
     /**
      * @return a Map of ResultTypeConfig objects keyed by result name
      * @see ResultTypeConfig
      */
-    public Map getResultTypeConfigs() {
+    public Map<String, ResultTypeConfig> getResultTypeConfigs() {
         return resultTypeConfigs;
     }
 
      * @return a Map of ExceptionMappingConfig objects keyed by result name
      * @see ExceptionMappingConfig
      */
-    public List getGlobalExceptionMappingConfigs() {
+    public List<ExceptionMappingConfig> getGlobalExceptionMappingConfigs() {
         return globalExceptionMappingConfigs;
     }
 
         actionConfigs.put(name, action);
     }
 
-    public void addAllParents(List parents) {
-        for (Iterator iterator = parents.iterator(); iterator.hasNext();) {
-            PackageConfig config = (PackageConfig) iterator.next();
+    public void addAllParents(List<PackageConfig> parents) {
+        for (PackageConfig config : parents) {
             addParent(config);
         }
     }

src/java/com/opensymphony/xwork/config/entities/Parameterizable.java

 
 /**
  * <!-- START SNIPPET: javadoc -->
- *
+ * <p/>
  * Actions implementing Parameterizable will receive a map of the static parameters defined in the action
  * configuration.
- *
+ * <p/>
  * <p/> The {@link com.opensymphony.xwork.interceptor.StaticParametersInterceptor} must be in the action's interceptor
  * queue for this to work.
- *
+ * <p/>
  * <!-- END SNIPPET: javadoc -->
  *
  * @author Jason Carreira
 
     public void addParam(String name, Object value);
 
-    void setParams(Map params);
+    void setParams(Map<String, Object> params);
 
     Map getParams();
 }

src/java/com/opensymphony/xwork/config/entities/ResultConfig.java

  */
 package com.opensymphony.xwork.config.entities;
 
-import java.util.Map;
-import java.util.LinkedHashMap;
-import java.io.Serializable;
-
 import com.opensymphony.xwork.util.location.Located;
 
+import java.io.Serializable;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
 
 /**
  * Configuration for Result.
  * <p/>
  * In the xml configuration file this is defined as the <code>result</code> tag.
- * 
+ *
  * @author Mike
  */
 public class ResultConfig extends Located implements Parameterizable, Serializable {

src/java/com/opensymphony/xwork/config/impl/DefaultConfiguration.java

  */
 package com.opensymphony.xwork.config.impl;
 
-import com.opensymphony.xwork.config.*;
-import com.opensymphony.xwork.config.entities.ActionConfig;
-import com.opensymphony.xwork.config.entities.PackageConfig;
-import com.opensymphony.xwork.config.entities.ResultTypeConfig;
+import com.opensymphony.xwork.XWorkStatic;
+import com.opensymphony.xwork.config.Configuration;
+import com.opensymphony.xwork.config.ConfigurationException;
+import com.opensymphony.xwork.config.ConfigurationProvider;
+import com.opensymphony.xwork.config.RuntimeConfiguration;
+import com.opensymphony.xwork.config.entities.*;
 import com.opensymphony.xwork.config.providers.InterceptorBuilder;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
 
     // Programmatic Action Conifigurations
-    private Map packageContexts = new LinkedHashMap();
+    private Map<String, PackageConfig> packageContexts = new LinkedHashMap<String, PackageConfig>();
     private RuntimeConfiguration runtimeConfiguration;
 
 
 
 
     public PackageConfig getPackageConfig(String name) {
-        return (PackageConfig) packageContexts.get(name);
+        return packageContexts.get(name);
     }
 
     public Set getPackageConfigNames() {
     }
 
     public void addPackageConfig(String name, PackageConfig packageContext) {
-      PackageConfig check = (PackageConfig) packageContexts.get(name);
+        PackageConfig check = packageContexts.get(name);
         if (check != null) {
-             LOG.error("The package name '" + name + "' is already been used by another package: " + check);
+            LOG.error("The package name '" + name + "' is already been used by another package: " + check);
             // would be better to throw ConfigurationException("name already used");
         }
         packageContexts.put(name, packageContext);
     public synchronized void reload() throws ConfigurationException {
         packageContexts.clear();
 
-        for (Iterator iterator = ConfigurationManager.getConfigurationProviders().iterator();
-             iterator.hasNext();) {
-            ConfigurationProvider provider = (ConfigurationProvider) iterator.next();
-            provider.init(this);
+        for (ConfigurationProvider configurationProvider : XWorkStatic.getConfigurationManager().getConfigurationProviders())
+        {
+            configurationProvider.init(this);
         }
 
         rebuildRuntimeConfiguration();
     }
 
     public void removePackageConfig(String name) {
-        PackageConfig toBeRemoved = (PackageConfig) packageContexts.get(name);
+        PackageConfig toBeRemoved = packageContexts.get(name);
 
         if (toBeRemoved != null) {
-            for (Iterator iterator = packageContexts.values().iterator();
-                 iterator.hasNext();) {
-                PackageConfig packageContext = (PackageConfig) iterator.next();
-                packageContext.removeParent(toBeRemoved);
+            for (PackageConfig packageConfig : packageContexts.values()) {
+                packageConfig.removeParent(toBeRemoved);
             }
         }
     }
      * programmatic configuration data structures. All of the old runtime configuration will be discarded and rebuilt.
      */
     protected synchronized RuntimeConfiguration buildRuntimeConfiguration() throws ConfigurationException {
-        Map namespaceActionConfigs = new LinkedHashMap();
-        Map namespaceConfigs = new LinkedHashMap();
+        Map<String, Map<String, ActionConfig>> namespaceActionConfigs = new LinkedHashMap<String, Map<String, ActionConfig>>();
+        Map<String, String> namespaceConfigs = new LinkedHashMap<String, String>();
 
-        for (Iterator iterator = packageContexts.values().iterator();
-             iterator.hasNext();) {
-            PackageConfig packageContext = (PackageConfig) iterator.next();
+        for (PackageConfig packageConfig : packageContexts.values()) {
 
-            if (!packageContext.isAbstract()) {
-                String namespace = packageContext.getNamespace();                
-                Map configs = (Map) namespaceActionConfigs.get(namespace);
+            if (!packageConfig.isAbstract()) {
+                String namespace = packageConfig.getNamespace();
+                Map<String, ActionConfig> configs = namespaceActionConfigs.get(namespace);
 
                 if (configs == null) {
-                    configs = new LinkedHashMap();
+                    configs = new LinkedHashMap<String, ActionConfig>();
                 }
 
-                Map actionConfigs = packageContext.getAllActionConfigs();
+                Map actionConfigs = packageConfig.getAllActionConfigs();
 
-                for (Iterator actionIterator = actionConfigs.keySet().iterator();
-                     actionIterator.hasNext();) {
-                    String actionName = (String) actionIterator.next();
+                for (Object o : actionConfigs.keySet()) {
+                    String actionName = (String) o;
                     ActionConfig baseConfig = (ActionConfig) actionConfigs.get(actionName);
-                    configs.put(actionName, buildFullActionConfig(packageContext, baseConfig));
+                    configs.put(actionName, buildFullActionConfig(packageConfig, baseConfig));
                 }
 
                 namespaceActionConfigs.put(namespace, configs);
-                if (packageContext.getFullDefaultActionRef() != null) {
-                	namespaceConfigs.put(namespace, packageContext.getFullDefaultActionRef());
+                if (packageConfig.getFullDefaultActionRef() != null) {
+                    namespaceConfigs.put(namespace, packageConfig.getFullDefaultActionRef());
                 }
             }
         }
         return new RuntimeConfigurationImpl(namespaceActionConfigs, namespaceConfigs);
     }
 
-    private void setDefaultResults(Map results, PackageConfig packageContext) {
+    private void setDefaultResults(Map<String, ResultConfig> results, PackageConfig packageContext) {
         String defaultResult = packageContext.getFullDefaultResultType();
 
-        for (Iterator iterator = results.entrySet().iterator();
-             iterator.hasNext();) {
-            Map.Entry entry = (Map.Entry) iterator.next();
+        for (Map.Entry<String, ResultConfig> entry : results.entrySet()) {
 
             if (entry.getValue() == null) {
-                ResultTypeConfig resultTypeConfig = (ResultTypeConfig) packageContext.getAllResultTypeConfigs().get(defaultResult);
-                entry.setValue(resultTypeConfig.getClazz());
+                ResultTypeConfig resultTypeConfig = packageContext.getAllResultTypeConfigs().get(defaultResult);
+                entry.setValue(new ResultConfig(null, resultTypeConfig.getClazz()));
             }
         }
     }
      * @param baseConfig     the ActionConfig which holds only the configuration specific to itself, without the defaults
      *                       and inheritance
      * @return a full ActionConfig for runtime configuration with all of the inherited and default params
+     * @throws com.opensymphony.xwork.config.ConfigurationException
+     *
      */
     private ActionConfig buildFullActionConfig(PackageConfig packageContext, ActionConfig baseConfig) throws ConfigurationException {
-        Map params = new TreeMap(baseConfig.getParams());
-        Map results = new TreeMap(packageContext.getAllGlobalResults());
+        Map<String, Object> params = new TreeMap<String, Object>(baseConfig.getParams());
+        Map<String, ResultConfig> results = new TreeMap<String, ResultConfig>(packageContext.getAllGlobalResults());
         results.putAll(baseConfig.getResults());
 
         setDefaultResults(results, packageContext);
 
-        List interceptors = new ArrayList(baseConfig.getInterceptors());
+        List<InterceptorMapping> interceptors = new ArrayList<InterceptorMapping>(baseConfig.getInterceptors());
 
         if (interceptors.size() <= 0) {
             String defaultInterceptorRefName = packageContext.getFullDefaultInterceptorRef();
             }
         }
 
-        List externalRefs = baseConfig.getExternalRefs();
+        List<ExternalReference> externalRefs = baseConfig.getExternalRefs();
 
-        List exceptionMappings = baseConfig.getExceptionMappings();
+        List<ExceptionMappingConfig> exceptionMappings = baseConfig.getExceptionMappings();
         exceptionMappings.addAll(packageContext.getAllExceptionMappingConfigs());
 
-        ActionConfig config = new ActionConfig(baseConfig.getMethodName(), baseConfig.getClassName(), params, results, interceptors, externalRefs, exceptionMappings, packageContext.getName());
-
-        return config;
+        return new ActionConfig(baseConfig.getMethodName(), baseConfig.getClassName(), params, results, interceptors,
+                externalRefs, exceptionMappings, packageContext.getName());
     }
 
 
     private class RuntimeConfigurationImpl implements RuntimeConfiguration {
-        private Map namespaceActionConfigs;
-        private Map namespaceConfigs;
+        private Map<String, Map<String, ActionConfig>> namespaceActionConfigs;
+        private Map<String, String> namespaceConfigs;
 
-        public RuntimeConfigurationImpl(Map namespaceActionConfigs, Map namespaceConfigs) {
+        public RuntimeConfigurationImpl(Map<String, Map<String, ActionConfig>> namespaceActionConfigs, Map<String, String> namespaceConfigs) {
             this.namespaceActionConfigs = namespaceActionConfigs;
             this.namespaceConfigs = namespaceConfigs;
         }
-        
-        
+
 
         /**
          * Gets the configuration information for an action name, or returns null if the
          */
         public synchronized ActionConfig getActionConfig(String namespace, String name) {
             ActionConfig config = null;
-            Map actions = (Map) namespaceActionConfigs.get((namespace == null) ? "" : namespace);
+            Map<String, ActionConfig> actions = namespaceActionConfigs.get((namespace == null) ? "" : namespace);
 
             if (actions != null) {
-                config = (ActionConfig) actions.get(name);
+                config = actions.get(name);
                 // fail over to default action
                 if (config == null) {
-                	String defaultActionRef = (String) namespaceConfigs.get((namespace == null) ? "" : namespace);
-                	if (defaultActionRef != null) {
-                		config = (ActionConfig) actions.get(defaultActionRef);
-                	}
+                    String defaultActionRef = namespaceConfigs.get((namespace == null) ? "" : namespace);
+                    if (defaultActionRef != null) {
+                        config = actions.get(defaultActionRef);
+                    }
                 }
             }
 
             // fail over to empty namespace
             if ((config == null) && (namespace != null) && (!namespace.trim().equals(""))) {
-                actions = (Map) namespaceActionConfigs.get("");
+                actions = namespaceActionConfigs.get("");
 
                 if (actions != null) {
-                    config = (ActionConfig) actions.get(name);
+                    config = actions.get(name);
                     // fail over to default action
                     if (config == null) {
-                    	String defaultActionRef = (String) namespaceConfigs.get("");
-                    	if (defaultActionRef != null) {
-                    		config = (ActionConfig) actions.get(defaultActionRef);
-                    	}
+                        String defaultActionRef = namespaceConfigs.get("");
+                        if (defaultActionRef != null) {
+                            config = actions.get(defaultActionRef);
+                        }
                     }
                 }
             }
-            
+
 
             return config;
         }
         public String toString() {
             StringBuffer buff = new StringBuffer("RuntimeConfiguration - actions are\n");
 
-            for (Iterator iterator = namespaceActionConfigs.keySet().iterator();
-                 iterator.hasNext();) {
-                String namespace = (String) iterator.next();
-                Map actionConfigs = (Map) namespaceActionConfigs.get(namespace);
+            for (String namespace : namespaceActionConfigs.keySet()) {
+                Map<String, ActionConfig> actionConfigs = namespaceActionConfigs.get(namespace);
 
-                for (Iterator iterator2 = actionConfigs.keySet().iterator();
-                     iterator2.hasNext();) {
-                    buff.append(namespace + "/" + iterator2.next() + "\n");
+                for (String s : actionConfigs.keySet()) {
+                    buff.append(namespace).append("/").append(s).append("\n");
                 }
             }
 

src/java/com/opensymphony/xwork/config/providers/InterceptorBuilder.java

 package com.opensymphony.xwork.config.providers;
 
 import com.opensymphony.xwork.ObjectFactory;
-import com.opensymphony.xwork.interceptor.Interceptor;
 import com.opensymphony.xwork.config.ConfigurationException;
 import com.opensymphony.xwork.config.entities.InterceptorConfig;
+import com.opensymphony.xwork.config.entities.InterceptorMapping;
 import com.opensymphony.xwork.config.entities.InterceptorStackConfig;
 import com.opensymphony.xwork.config.entities.PackageConfig;
-import com.opensymphony.xwork.config.entities.InterceptorMapping;
+import com.opensymphony.xwork.interceptor.Interceptor;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
 
 /**
  * Builds a list of interceptors referenced by the refName in the supplied PackageConfig.
- * 
+ *
  * @author Mike
  * @author Rainer Hermanns
  */
      * @return list of interceptors referenced by the refName in the supplied PackageConfig.
      * @throws ConfigurationException
      */
-    public static List constructInterceptorReference(PackageConfig packageConfig, String refName, Map refParams) throws ConfigurationException {
+    public static List<InterceptorMapping> constructInterceptorReference(PackageConfig packageConfig, String refName, Map refParams) throws ConfigurationException {
         Object referencedConfig = packageConfig.getAllInterceptorConfigs().get(refName);
-        List result = new ArrayList();
+        List<InterceptorMapping> result = new ArrayList<InterceptorMapping>();
 
         if (referencedConfig == null) {
             LOG.error("Unable to find interceptor class referenced by ref-name " + refName);
     /**
      * Builds a list of interceptors referenced by the refName in the supplied PackageConfig overriding the properties
      * of the referenced interceptor with refParams.
-     * 
+     *
      * @param packageConfig
      * @param stackConfig
-     * @param refParams The overridden interceptor properies
+     * @param refParams     The overridden interceptor properies
      * @return list of interceptors referenced by the refName in the supplied PackageConfig overridden with refParams.
      */
-    private static List constructParameterizedInterceptorReferences(PackageConfig packageConfig, InterceptorStackConfig stackConfig, Map refParams) {
-        List result;
-        Map params = new HashMap();
+    private static List<InterceptorMapping> constructParameterizedInterceptorReferences(PackageConfig packageConfig, InterceptorStackConfig stackConfig, Map refParams) {
+        List<InterceptorMapping> result;
+        Map<String, Map<Object, String>> params = new HashMap<String, Map<Object, String>>();
 
-        for ( Iterator iter = refParams.keySet().iterator(); iter.hasNext();) {
+        for (Iterator iter = refParams.keySet().iterator(); iter.hasNext();) {
             String key = (String) iter.next();
             String value = (String) refParams.get(key);
 
             try {
                 String name = key.substring(0, key.indexOf('.'));
-                key = key.substring(key.indexOf('.')  + 1);
+                key = key.substring(key.indexOf('.') + 1);
 
-                Map map;
-                if ( params.containsKey(name)) {
-                    map = (Map) params.get(name);
+                Map<Object, String> map;
+                if (params.containsKey(name)) {
+                    map = params.get(name);
                 } else {
-                    map = new HashMap();
+                    map = new HashMap<Object, String>();
                 }
 
                 map.put(key, value);
             }
         }
 
-        result = (ArrayList) stackConfig.getInterceptors();
+        result = (ArrayList<InterceptorMapping>) stackConfig.getInterceptors();
 
-        for ( Iterator iter = params.keySet().iterator(); iter.hasNext();) {
+        for (String key : params.keySet()) {
 
-            String key = (String) iter.next();
-            Map map = (Map) params.get(key);
+            Map<Object, String> map = params.get(key);
 
             InterceptorConfig cfg = (InterceptorConfig) packageConfig.getAllInterceptorConfigs().get(key);
             Interceptor interceptor = ObjectFactory.getObjectFactory().buildInterceptor(cfg, map);
 
             InterceptorMapping mapping = new InterceptorMapping(key, interceptor);
-            if ( result != null && result.contains(mapping)) {
+            if (result != null && result.contains(mapping)) {
                 int index = result.indexOf(mapping);
                 result.set(index, mapping);
             } else {

src/java/com/opensymphony/xwork/config/providers/XmlConfigurationProvider.java

  */
 package com.opensymphony.xwork.config.providers;
 
-import com.opensymphony.util.FileManager;
 import com.opensymphony.util.ClassLoaderUtil;
+import com.opensymphony.util.FileManager;
 import com.opensymphony.util.TextUtils;
 import com.opensymphony.xwork.Action;
 import com.opensymphony.xwork.ActionSupport;
 import com.opensymphony.xwork.config.entities.*;
 import com.opensymphony.xwork.util.DomHelper;
 import com.opensymphony.xwork.util.location.Location;
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
-import org.xml.sax.*;
+import org.xml.sax.InputSource;
 
 import java.io.IOException;
 import java.io.InputStream;
-import java.util.*;
 import java.lang.reflect.Modifier;
+import java.util.*;
 
 
 /**
         List exceptionMappings = buildExceptionMappings(actionElement, packageContext);
 
         ActionConfig actionConfig = new ActionConfig(methodName, className, actionParams, results, interceptorList, externalrefs, exceptionMappings,
-        packageContext.getName());
+                packageContext.getName());
         actionConfig.setLocation(location);
         packageContext.addActionConfig(name, actionConfig);
 
                     LOG.error("Action class [" + className + "] is not public, skipping action [" + name + "]");
                     return false;
                 }
-                clazz.getConstructor(new Class[] {});
+                clazz.getConstructor(new Class[]{});
             }
             return true;
         } catch (ClassNotFoundException e) {
             LOG.error("Action class [" + className + "] not found, skipping action [" + name + "] at "
-                + loc, e);
+                    + loc, e);
             return false;
         } catch (NoSuchMethodException e) {
             LOG.error("Action class [" + className + "] does not have a public no-arg constructor,"
             return false;
         } catch (Exception ex) {
             throw new ConfigurationException(ex, loc);
-        }    
+        }
     }
 
     /**
             Element actionElement = (Element) actionList.item(i);
             addAction(actionElement, newPackage);
         }
-        
+
         // load the default action reference for this package
         loadDefaultActionRef(newPackage, packageElement);
 
             if (clazz != null) {
                 ResultTypeConfig resultType = new ResultTypeConfig(name, clazz);
                 resultType.setLocation(DomHelper.getLocationObject(resultTypeElement));
-                
+
                 Map params = XmlHelper.getParams(resultTypeElement);
-    
+
                 if (!params.isEmpty()) {
                     resultType.setParams(params);
                 }
                 packageContext.addResultTypeConfig(resultType);
-                
+
                 // set the default result type
                 if ("true".equals(def)) {
                     packageContext.setDefaultResultType(name);
             return ObjectFactory.getObjectFactory().getClassInstance(className);
         } catch (ClassNotFoundException e) {
             LOG.warn("Result class [" + className + "] doesn't exist (ClassNotFoundException) at " +
-                loc.toString() + ", ignoring", e);
+                    loc.toString() + ", ignoring", e);
         } catch (NoClassDefFoundError e) {
             LOG.warn("Result class [" + className + "] doesn't exist (NoClassDefFoundError) at " +
-                loc.toString() + ", ignoring", e);
+                    loc.toString() + ", ignoring", e);
         }
 
         return null;
                 cfg = new PackageConfig(name, namespace, isAbstract, erResolver, parents);
             }
         }
-        
+
         if (cfg != null) {
             cfg.setLocation(DomHelper.getLocationObject(packageElement));
         }
                 }
 
 
-                ResultTypeConfig config = (ResultTypeConfig) packageContext.getAllResultTypeConfigs().get(resultType);
+                ResultTypeConfig config = packageContext.getAllResultTypeConfigs().get(resultType);
 
                 if (config == null) {
                     throw new ConfigurationException("There is no result type defined for type '" + resultType + "' mapped with name '" + resultName + "'", resultElement);
             packageContext.setDefaultInterceptorRef(defaultRefElement.getAttribute("name"));
         }
     }
-    
+
     protected void loadDefaultActionRef(PackageConfig packageContext, Element element) {
         NodeList resultTypeList = element.getElementsByTagName("default-action-ref");
 
                 }
 
                 InputSource in = new InputSource(is);
-                
+
                 //FIXME: we shouldn't be doing this lookup twice
                 in.setSystemId(ClassLoaderUtil.getResource(fileName, getClass()).toString());
-                
+
                 Map dtdMappings = new HashMap();
                 dtdMappings.put("-//OpenSymphony Group//XWork 1.1.1//EN", "xwork-1.1.1.dtd");
                 dtdMappings.put("-//OpenSymphony Group//XWork 1.1//EN", "xwork-1.1.dtd");
                 dtdMappings.put("-//OpenSymphony Group//XWork 1.0//EN", "xwork-1.0.dtd");
-                
+
                 doc = DomHelper.parse(in, dtdMappings);
             } catch (XworkException e) {
                 if (includeElement != null) {

src/java/com/opensymphony/xwork/interceptor/ExternalReferencesInterceptor.java

 package com.opensymphony.xwork.interceptor;
 
 import com.opensymphony.xwork.ActionInvocation;
-import com.opensymphony.xwork.config.ConfigurationManager;
+import com.opensymphony.xwork.XWorkStatic;
 import com.opensymphony.xwork.config.ExternalReferenceResolver;
 import com.opensymphony.xwork.config.entities.PackageConfig;
 
  * <!-- START SNIPPET: description -->
  * TODO: Give a description of the Interceptor.
  * <!-- END SNIPPET: description -->
- *
+ * <p/>
  * <!-- START SNIPPET: parameters -->
  * TODO: Describe the paramters for this Interceptor.
  * <!-- END SNIPPET: parameters -->
- *
+ * <p/>
  * <!-- START SNIPPET: extending -->
  * TODO: Discuss some possible extension of the Interceptor.
  * <!-- END SNIPPET: extending -->
- *
+ * <p/>
  * <pre>
  * <!-- START SNIPPET: example -->
  * &lt;!-- TODO: Describe how the Interceptor reference will effect execution --&gt;
 
     protected void before(ActionInvocation invocation) throws Exception {
         String packageName = invocation.getProxy().getConfig().getPackageName();
-        PackageConfig packageConfig = ConfigurationManager.getConfiguration().getPackageConfig(packageName);
+        PackageConfig packageConfig = XWorkStatic.getConfigurationManager().getConfiguration().getPackageConfig(packageName);
 
         if (packageConfig != null) {
             ExternalReferenceResolver erResolver = packageConfig.getExternalRefResolver();

src/java/com/opensymphony/xwork/util/OgnlValueStack.java

 import java.io.Serializable;
 import java.util.*;
 
-
 /**
  * OgnlValueStack allows multiple beans to be pushed in and dynamic Ognl expressions to be evaluated against it. When
  * evaluating an expression, the stack will be searched down the stack, from the latest objects pushed in to the
 
     /**
      * Determine whether devMode is enabled.
+     *
      * @return true if devMode was enabled, false otherwise.
      */
     public boolean isDevModeEnabled() {
         Boolean devMode = (Boolean) context.get(ActionContext.DEV_MODE);
         if (devMode != null) {
-        	return devMode.booleanValue();
+            return devMode.booleanValue();
         } else {
             return false;
         }
      * Log a failed lookup, being more verbose when devMode=true.
      *
      * @param expr The failed expression
-     * @param e The thrown exception.
+     * @param e    The thrown exception.
      */
     private void logLookupFailure(String expr, Exception e) {
         StringBuffer msg = new StringBuffer();
         msg.append("Caught an exception while evaluating expression '").append(expr).append("' against value stack");
         if (isDevModeEnabled() && LOG.isWarnEnabled()) {
-            LOG.warn( msg , e);
+            LOG.warn(msg, e);
             LOG.warn("NOTE: Previous warning message was issued due to devMode set to true.");
-        } else if ( LOG.isDebugEnabled() ) {
-            LOG.debug( msg , e);
+        } else if (LOG.isDebugEnabled()) {
+            LOG.debug(msg, e);
         }
     }
 

src/test/com/opensymphony/xwork/ActionInvocationTest.java

  */
 package com.opensymphony.xwork;
 
-import com.opensymphony.xwork.config.ConfigurationManager;
 import junit.framework.TestCase;
 
 import java.util.HashMap;
         super.setUp();
 
         // ensure we're using the default configuration, not simple config
-        ConfigurationManager.clearConfigurationProviders();
-        ConfigurationManager.getConfiguration().reload();
+        XWorkStatic.getConfigurationManager().clearConfigurationProviders();
+        XWorkStatic.getConfigurationManager().getConfiguration().reload();
     }
 }

src/test/com/opensymphony/xwork/ActionNestingTest.java

 package com.opensymphony.xwork;
 
 import com.opensymphony.xwork.config.Configuration;
-import com.opensymphony.xwork.config.ConfigurationManager;
 import com.opensymphony.xwork.config.ConfigurationProvider;
 import com.opensymphony.xwork.config.entities.ActionConfig;
 import com.opensymphony.xwork.config.entities.PackageConfig;
 
     public void setUp() throws Exception {
         super.setUp();
-        ConfigurationManager.addConfigurationProvider(new NestedTestConfigurationProvider());
-        ConfigurationManager.getConfiguration().reload();
+        XWorkStatic.getConfigurationManager().addConfigurationProvider(new NestedTestConfigurationProvider());
+        XWorkStatic.getConfigurationManager().getConfiguration().reload();
 
         OgnlValueStack stack = new OgnlValueStack();
 
 
     protected void tearDown() throws Exception {
         super.tearDown();
-        ConfigurationManager.clearConfigurationProviders();
-        ConfigurationManager.destroyConfiguration();
+        XWorkStatic.getConfigurationManager().clearConfigurationProviders();
+        XWorkStatic.getConfigurationManager().destroyConfiguration();
         ActionContext.setContext(null);
     }
 

src/test/com/opensymphony/xwork/ChainResultTest.java

 package com.opensymphony.xwork;
 
 import com.mockobjects.dynamic.Mock;
-import com.opensymphony.xwork.config.ConfigurationManager;
 import com.opensymphony.xwork.util.OgnlValueStack;
 import junit.framework.TestCase;
 
         super.setUp();
 
         // ensure we're using the default configuration, not simple config
-        ConfigurationManager.clearConfigurationProviders();
-        ConfigurationManager.getConfiguration().reload();
+        XWorkStatic.getConfigurationManager().clearConfigurationProviders();
+        XWorkStatic.getConfigurationManager().getConfiguration().reload();
     }
 
     public void testNamespaceAndActionExpressionEvaluation() throws Exception {