WW-4067 Skips package reloading to avoid double initialisation of actions, interceptors, and so on

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1483648 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Lukasz Lenart
2013-05-17 05:24:39 +00:00
parent 64328943bd
commit 8d2c5ce474
@@ -507,6 +507,15 @@ public class XmlConfigurationProvider implements ConfigurationProvider {
* Create a PackageConfig from an XML element representing it.
*/
protected PackageConfig addPackage(Element packageElement) throws ConfigurationException {
String packageName = packageElement.getAttribute("name");
PackageConfig packageConfig = configuration.getPackageConfig(packageName);
if (packageConfig != null) {
if (LOG.isDebugEnabled()) {
LOG.debug("Package [#0] already loaded, skipping re-loading it and using existing PackageConfig [#1]", packageName, packageConfig);
}
return packageConfig;
}
PackageConfig.Builder newPackage = buildPackageContext(packageElement);
if (newPackage.isNeedsRefresh()) {