Commits

Anonymous committed 9b58210

Cleaned up global result inheritance logic

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

  • Participants
  • Parent commits 8114d3b

Comments (0)

Files changed (1)

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

      */
     private ActionConfig buildFullActionConfig(PackageConfig packageContext, ActionConfig baseConfig) throws ConfigurationException {
         Map<String, Object> params = new TreeMap<String, Object>(baseConfig.getParams());
-        Map<String, ResultConfig> results = new TreeMap<String, ResultConfig>(packageContext.getAllGlobalResults());
-        if (baseConfig.getPackageName().equals(packageContext.getName())) {
-        	results = new TreeMap<String, ResultConfig>(packageContext.getAllGlobalResults());
-        	results.putAll(baseConfig.getResults());
+        Map<String, ResultConfig> results = new TreeMap<String, ResultConfig>();
+
+        if (!baseConfig.getPackageName().equals(packageContext.getName()) && packageContexts.containsKey(baseConfig.getPackageName())) {
+            results.putAll(packageContexts.get(baseConfig.getPackageName()).getGlobalResultConfigs());
+        } else {
+            results.putAll(packageContext.getAllGlobalResults());
         }
-        else {
-        	PackageConfig baseConfigPackageConfig = (PackageConfig) packageContexts.get(baseConfig.getPackageName());
-            if ( baseConfigPackageConfig != null) {
-                results = new TreeMap<String, ResultConfig>(baseConfigPackageConfig.getAllGlobalResults());
-            }
 
-        	results.putAll(baseConfig.getResults());
-        }        
+       	results.putAll(baseConfig.getResults());
 
         setDefaultResults(results, packageContext);