Commits

plightbo  committed 20237ed

use LinkedHashMap for some consistency

git-svn-id: http://svn.opensymphony.com/svn/xwork/branches/xwork_1-0_branch@729e221344d-f017-0410-9bd5-d282ab1896d7

  • Participants
  • Parent commits 33cda0a
  • Branches xwork_1-0_branch

Comments (0)

Files changed (7)

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

     //~ Constructors ///////////////////////////////////////////////////////////
 
     public ActionConfig() {
-        params = new HashMap();
-        results = new HashMap();
+        params = new LinkedHashMap();
+        results = new LinkedHashMap();
         interceptors = new ArrayList();
         externalRefs = new ArrayList();
     }
 
     public Map getParams() {
         if (params == null) {
-            params = new HashMap();
+            params = new LinkedHashMap();
         }
 
         return params;
 
     public Map getResults() {
         if (results == null) {
-            results = new HashMap();
+            results = new LinkedHashMap();
         }
 
         return results;

File src/java/com/opensymphony/xwork/config/entities/InterceptorConfig.java

  */
 package com.opensymphony.xwork.config.entities;
 
-import java.util.HashMap;
+import java.util.LinkedHashMap;
 import java.util.Map;
 
 
 
     public Map getParams() {
         if (params == null) {
-            params = new HashMap();
+            params = new LinkedHashMap();
         }
 
         return params;

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

 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import java.util.*;
 
 
 /**
     //~ Instance fields ////////////////////////////////////////////////////////
 
     private ExternalReferenceResolver externalRefResolver = null;
-    private Map actionConfigs = new HashMap();
-    private Map globalResultConfigs = new HashMap();
-    private Map interceptorConfigs = new HashMap();
-    private Map resultTypeConfigs = new HashMap();
+    private Map actionConfigs = new LinkedHashMap();
+    private Map globalResultConfigs = new LinkedHashMap();
+    private Map interceptorConfigs = new LinkedHashMap();
+    private Map resultTypeConfigs = new LinkedHashMap();
     private Set parents = new HashSet();
     private String defaultInterceptorRef;
     private String defaultResultType;
     * @see com.opensymphony.xwork.config.entities.ActionConfig
     */
     public Map getAllActionConfigs() {
-        Map retMap = new HashMap();
+        Map retMap = new LinkedHashMap();
 
         if (!parents.isEmpty()) {
             for (Iterator iterator = parents.iterator(); iterator.hasNext();) {
     * @see com.opensymphony.xwork.config.entities.ResultConfig
     */
     public Map getAllGlobalResults() {
-        Map retMap = new HashMap();
+        Map retMap = new LinkedHashMap();
 
         if (!parents.isEmpty()) {
             for (Iterator iterator = parents.iterator(); iterator.hasNext();) {
     * @see com.opensymphony.xwork.config.entities.InterceptorStackConfig
     */
     public Map getAllInterceptorConfigs() {
-        Map retMap = new HashMap();
+        Map retMap = new LinkedHashMap();
 
         if (!parents.isEmpty()) {
             for (Iterator iterator = parents.iterator(); iterator.hasNext();) {
     * @see com.opensymphony.xwork.config.entities.ResultTypeConfig
     */
     public Map getAllResultTypeConfigs() {
-        Map retMap = new HashMap();
+        Map retMap = new LinkedHashMap();
 
         if (!parents.isEmpty()) {
             for (Iterator iterator = parents.iterator(); iterator.hasNext();) {
     /**
     * gets the default interceptor-ref name. If this is not set on this PackageConfig, it searches the parent
     * PackageConfigs in order until it finds one.
-    * @return
     */
     public String getFullDefaultInterceptorRef() {
         if ((defaultInterceptorRef == null) && !parents.isEmpty()) {

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

 
 import java.util.HashMap;
 import java.util.Map;
+import java.util.LinkedHashMap;
 
 
 /**
     //~ Constructors ///////////////////////////////////////////////////////////
 
     public ResultConfig() {
-        params = new HashMap();
+        params = new LinkedHashMap();
     }
 
     public ResultConfig(String name, Class clazz) {
 
     public Map getParams() {
         if (params == null) {
-            params = new HashMap();
+            params = new LinkedHashMap();
         }
 
         return params;

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

     //~ Instance fields ////////////////////////////////////////////////////////
 
     // Programmatic Action Conifigurations
-    private Map packageContexts = new HashMap();
+    private Map packageContexts = new LinkedHashMap();
     private RuntimeConfiguration runtimeConfiguration;
 
     //~ Constructors ///////////////////////////////////////////////////////////
      * programmatic configuration data structures. All of the old runtime configuration will be discarded and rebuilt.
      */
     protected synchronized RuntimeConfiguration buildRuntimeConfiguration() throws ConfigurationException {
-        Map namespaceActionConfigs = new HashMap();
+        Map namespaceActionConfigs = new LinkedHashMap();
 
         for (Iterator iterator = packageContexts.values().iterator();
                 iterator.hasNext();) {
                 Map configs = (Map) namespaceActionConfigs.get(namespace);
 
                 if (configs == null) {
-                    configs = new HashMap();
+                    configs = new LinkedHashMap();
                 }
 
                 Map actionConfigs = packageContext.getAllActionConfigs();

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

     protected Map buildResults(Element element, PackageConfig packageContext) {
         NodeList resultEls = element.getElementsByTagName("result");
 
-        Map results = new HashMap();
+        Map results = new LinkedHashMap();
 
         for (int i = 0; i < resultEls.getLength(); i++) {
             Element resultElement = (Element) resultEls.item(i);
                  {
                     // if <result ...>something</result> then we add a parameter of 'something' as this is the most used result param
                     if ((resultElement.getChildNodes().getLength() == 1) && (resultElement.getChildNodes().item(0).getNodeType() == Node.TEXT_NODE)) {
-                        params = new HashMap();
+                        params = new LinkedHashMap();
 
                         try {
                             String paramName = (String) resultClass.getField("DEFAULT_PARAM").get(null);

File src/java/com/opensymphony/xwork/config/providers/XmlHelper.java

 import org.w3c.dom.NodeList;
 
 import java.util.HashMap;
+import java.util.LinkedHashMap;
 
 
 /**
     //~ Methods ////////////////////////////////////////////////////////////////
 
     public static HashMap getParams(Element paramsElement) {
-        HashMap params = new HashMap();
+        HashMap params = new LinkedHashMap();
 
         if (paramsElement == null) {
             return params;