From 96156dfa17811e4b15c97030d4cdc9684900e096 Mon Sep 17 00:00:00 2001 From: Lukasz Lenart Date: Fri, 11 Apr 2014 07:23:57 +0200 Subject: [PATCH] WW-4321 Adds missing location property during copy --- .../opensymphony/xwork2/config/entities/ActionConfig.java | 1 + .../xwork2/config/entities/ExceptionMappingConfig.java | 1 + .../xwork2/config/entities/InterceptorConfig.java | 1 + .../xwork2/config/entities/InterceptorStackConfig.java | 1 + .../xwork2/config/entities/PackageConfig.java | 1 + .../opensymphony/xwork2/config/entities/ResultConfig.java | 1 + .../xwork2/config/entities/ResultTypeConfig.java | 1 + .../xwork2/config/entities/UnknownHandlerConfig.java | 8 ++++++-- .../xwork2/config/providers/XmlConfigurationProvider.java | 3 ++- 9 files changed, 15 insertions(+), 3 deletions(-) diff --git a/xwork-core/src/main/java/com/opensymphony/xwork2/config/entities/ActionConfig.java b/xwork-core/src/main/java/com/opensymphony/xwork2/config/entities/ActionConfig.java index 7494d437a3..0bc9363b94 100644 --- a/xwork-core/src/main/java/com/opensymphony/xwork2/config/entities/ActionConfig.java +++ b/xwork-core/src/main/java/com/opensymphony/xwork2/config/entities/ActionConfig.java @@ -87,6 +87,7 @@ protected ActionConfig(ActionConfig orig) { this.results = new LinkedHashMap(orig.results); this.exceptionMappings = new ArrayList(orig.exceptionMappings); this.allowedMethods = new HashSet(orig.allowedMethods); + this.location = orig.location; } public String getName() { diff --git a/xwork-core/src/main/java/com/opensymphony/xwork2/config/entities/ExceptionMappingConfig.java b/xwork-core/src/main/java/com/opensymphony/xwork2/config/entities/ExceptionMappingConfig.java index 52b31666c5..5dcd2668af 100644 --- a/xwork-core/src/main/java/com/opensymphony/xwork2/config/entities/ExceptionMappingConfig.java +++ b/xwork-core/src/main/java/com/opensymphony/xwork2/config/entities/ExceptionMappingConfig.java @@ -49,6 +49,7 @@ protected ExceptionMappingConfig(ExceptionMappingConfig target) { this.exceptionClassName = target.exceptionClassName; this.result = target.result; this.params = new LinkedHashMap(target.params); + this.location = target.location; } public String getName() { diff --git a/xwork-core/src/main/java/com/opensymphony/xwork2/config/entities/InterceptorConfig.java b/xwork-core/src/main/java/com/opensymphony/xwork2/config/entities/InterceptorConfig.java index dc81e57bb9..288fa552d6 100644 --- a/xwork-core/src/main/java/com/opensymphony/xwork2/config/entities/InterceptorConfig.java +++ b/xwork-core/src/main/java/com/opensymphony/xwork2/config/entities/InterceptorConfig.java @@ -46,6 +46,7 @@ protected InterceptorConfig(InterceptorConfig orig) { this.name = orig.name; this.className = orig.className; this.params = new LinkedHashMap(orig.params); + this.location = orig.location; } public String getClassName() { diff --git a/xwork-core/src/main/java/com/opensymphony/xwork2/config/entities/InterceptorStackConfig.java b/xwork-core/src/main/java/com/opensymphony/xwork2/config/entities/InterceptorStackConfig.java index 330e716380..d3e41f93af 100644 --- a/xwork-core/src/main/java/com/opensymphony/xwork2/config/entities/InterceptorStackConfig.java +++ b/xwork-core/src/main/java/com/opensymphony/xwork2/config/entities/InterceptorStackConfig.java @@ -58,6 +58,7 @@ protected InterceptorStackConfig() { protected InterceptorStackConfig(InterceptorStackConfig orig) { this.name = orig.name; this.interceptors = new ArrayList(orig.interceptors); + this.location = orig.location; } diff --git a/xwork-core/src/main/java/com/opensymphony/xwork2/config/entities/PackageConfig.java b/xwork-core/src/main/java/com/opensymphony/xwork2/config/entities/PackageConfig.java index 1619645e3f..eeb530ee7f 100644 --- a/xwork-core/src/main/java/com/opensymphony/xwork2/config/entities/PackageConfig.java +++ b/xwork-core/src/main/java/com/opensymphony/xwork2/config/entities/PackageConfig.java @@ -80,6 +80,7 @@ protected PackageConfig(PackageConfig orig) { this.resultTypeConfigs = new LinkedHashMap(orig.resultTypeConfigs); this.globalExceptionMappingConfigs = new ArrayList(orig.globalExceptionMappingConfigs); this.parents = new ArrayList(orig.parents); + this.location = orig.location; } public boolean isAbstract() { diff --git a/xwork-core/src/main/java/com/opensymphony/xwork2/config/entities/ResultConfig.java b/xwork-core/src/main/java/com/opensymphony/xwork2/config/entities/ResultConfig.java index 4b4c79cca9..3c7ab2dfe5 100644 --- a/xwork-core/src/main/java/com/opensymphony/xwork2/config/entities/ResultConfig.java +++ b/xwork-core/src/main/java/com/opensymphony/xwork2/config/entities/ResultConfig.java @@ -47,6 +47,7 @@ protected ResultConfig(ResultConfig orig) { this.params = orig.params; this.name = orig.name; this.className = orig.className; + this.location = orig.location; } public String getClassName() { diff --git a/xwork-core/src/main/java/com/opensymphony/xwork2/config/entities/ResultTypeConfig.java b/xwork-core/src/main/java/com/opensymphony/xwork2/config/entities/ResultTypeConfig.java index cb9cc9e423..85ef0232f9 100644 --- a/xwork-core/src/main/java/com/opensymphony/xwork2/config/entities/ResultTypeConfig.java +++ b/xwork-core/src/main/java/com/opensymphony/xwork2/config/entities/ResultTypeConfig.java @@ -51,6 +51,7 @@ protected ResultTypeConfig(ResultTypeConfig orig) { this.className = orig.className; this.defaultResultParam = orig.defaultResultParam; this.params = orig.params; + this.location = orig.location; } public void setDefaultResultParam(String defaultResultParam) { diff --git a/xwork-core/src/main/java/com/opensymphony/xwork2/config/entities/UnknownHandlerConfig.java b/xwork-core/src/main/java/com/opensymphony/xwork2/config/entities/UnknownHandlerConfig.java index 802280bf70..3d6692f0ce 100644 --- a/xwork-core/src/main/java/com/opensymphony/xwork2/config/entities/UnknownHandlerConfig.java +++ b/xwork-core/src/main/java/com/opensymphony/xwork2/config/entities/UnknownHandlerConfig.java @@ -15,12 +15,16 @@ */ package com.opensymphony.xwork2.config.entities; -public class UnknownHandlerConfig { +import com.opensymphony.xwork2.util.location.Located; +import com.opensymphony.xwork2.util.location.Location; + +public class UnknownHandlerConfig extends Located { private String name; - public UnknownHandlerConfig(String name) { + public UnknownHandlerConfig(String name, Location location) { this.name = name; + this.location = location; } public String getName() { diff --git a/xwork-core/src/main/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProvider.java b/xwork-core/src/main/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProvider.java index 7a0a4e32e4..6f9508b662 100644 --- a/xwork-core/src/main/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProvider.java +++ b/xwork-core/src/main/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProvider.java @@ -260,7 +260,8 @@ public void register(ContainerBuilder containerBuilder, LocatableProperties prop for (int k = 0; k < unknownHandlersSize; k++) { Element unknownHandler = (Element) unknownHandlers.item(k); - unknownHandlerStack.add(new UnknownHandlerConfig(unknownHandler.getAttribute("name"))); + Location location = LocationUtils.getLocation(unknownHandler); + unknownHandlerStack.add(new UnknownHandlerConfig(unknownHandler.getAttribute("name"), location)); } if (!unknownHandlerStack.isEmpty())