[struts] branch WW-5078-removes-xwork-dtds created (now b4bc5dc)

2020-11-29 Thread lukaszlenart
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a change to branch WW-5078-removes-xwork-dtds
in repository https://gitbox.apache.org/repos/asf/struts.git.


  at b4bc5dc  WW-5078 Removes support for  DTDs

This branch includes the following new commits:

 new b4bc5dc  WW-5078 Removes support for  DTDs

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[struts] branch WW-5078-removes-xwork-dtds updated: WW-5078 Uses more informative name for XWorkConfigurationProvider

2020-11-29 Thread lukaszlenart
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a commit to branch WW-5078-removes-xwork-dtds
in repository https://gitbox.apache.org/repos/asf/struts.git


The following commit(s) were added to refs/heads/WW-5078-removes-xwork-dtds by 
this push:
 new 8a0cdb4  WW-5078 Uses more informative name for 
XWorkConfigurationProvider
8a0cdb4 is described below

commit 8a0cdb4da15a758329b2b6d78cdb5a9fde0e59ae
Author: Lukasz Lenart 
AuthorDate: Sun Nov 29 16:00:51 2020 +0100

WW-5078 Uses more informative name for XWorkConfigurationProvider
---
 .../com/opensymphony/xwork2/config/ConfigurationManager.java   |  8 
 .../com/opensymphony/xwork2/config/impl/MockConfiguration.java |  4 ++--
 ...onProvider.java => StrutsDefaultConfigurationProvider.java} |  2 +-
 .../java/com/opensymphony/xwork2/util/XWorkTestCaseHelper.java |  6 +++---
 .../opensymphony/xwork2/config/ConfigurationManagerTest.java   |  4 ++--
 .../XmlConfigurationProviderGlobalResultInheritenceTest.java   |  2 +-
 ...XmlConfigurationProviderInterceptorParamOverridingTest.java |  2 +-
 ...nfigurationProviderInterceptorStackParamOverridingTest.java |  2 +-
 .../xwork2/interceptor/ParametersInterceptorTest.java  | 10 +-
 9 files changed, 20 insertions(+), 20 deletions(-)

diff --git 
a/core/src/main/java/com/opensymphony/xwork2/config/ConfigurationManager.java 
b/core/src/main/java/com/opensymphony/xwork2/config/ConfigurationManager.java
index c5dcae1..41e24b1 100644
--- 
a/core/src/main/java/com/opensymphony/xwork2/config/ConfigurationManager.java
+++ 
b/core/src/main/java/com/opensymphony/xwork2/config/ConfigurationManager.java
@@ -19,7 +19,7 @@
 package com.opensymphony.xwork2.config;
 
 import com.opensymphony.xwork2.config.impl.DefaultConfiguration;
-import com.opensymphony.xwork2.config.providers.XWorkConfigurationProvider;
+import 
com.opensymphony.xwork2.config.providers.StrutsDefaultConfigurationProvider;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import org.apache.struts2.StrutsConstants;
@@ -85,8 +85,8 @@ public class ConfigurationManager {
 /**
  * 
  * 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.
+ * will return a list containing only a default ConfigurationProvider, 
{@link StrutsDefaultConfigurationProvider}.
+ * If a custom ConfigurationProvider has been added, then the 
StrutsDefaultConfigurationProvider must be added by hand.
  * 
  *
  * 
@@ -100,7 +100,7 @@ public class ConfigurationManager {
 providerLock.lock();
 try {
 if (containerProviders.size() == 0) {
-containerProviders.add(new XWorkConfigurationProvider());
+containerProviders.add(new 
StrutsDefaultConfigurationProvider());
 }
 
 return containerProviders;
diff --git 
a/core/src/main/java/com/opensymphony/xwork2/config/impl/MockConfiguration.java 
b/core/src/main/java/com/opensymphony/xwork2/config/impl/MockConfiguration.java
index b21dc45..997c5f1 100644
--- 
a/core/src/main/java/com/opensymphony/xwork2/config/impl/MockConfiguration.java
+++ 
b/core/src/main/java/com/opensymphony/xwork2/config/impl/MockConfiguration.java
@@ -21,7 +21,7 @@ package com.opensymphony.xwork2.config.impl;
 import com.opensymphony.xwork2.config.*;
 import com.opensymphony.xwork2.config.entities.PackageConfig;
 import com.opensymphony.xwork2.config.entities.UnknownHandlerConfig;
-import com.opensymphony.xwork2.config.providers.XWorkConfigurationProvider;
+import 
com.opensymphony.xwork2.config.providers.StrutsDefaultConfigurationProvider;
 import com.opensymphony.xwork2.inject.Container;
 import com.opensymphony.xwork2.inject.ContainerBuilder;
 import com.opensymphony.xwork2.inject.Scope;
@@ -50,7 +50,7 @@ public class MockConfiguration implements Configuration {
 //this cannot be done in the constructor, as it causes an infinite loop
 builder.factory(Configuration.class, MockConfiguration.class, 
Scope.SINGLETON);
 LocatableProperties props = new LocatableProperties();
-new XWorkConfigurationProvider().register(builder, props);
+new StrutsDefaultConfigurationProvider().register(builder, props);
 builder.constant(StrutsConstants.STRUTS_DEVMODE, "false");
 builder.constant(StrutsConstants.STRUTS_CONFIGURATION_XML_RELOAD, 
"true");
 builder.constant(StrutsConstants.STRUTS_ENABLE_OGNL_EXPRESSION_CACHE, 
"true");
diff --git 
a/core/src/main/java/com/opensymphony/xwork2/config/providers/XWorkConfigurationProvider.java
 
b/core/src/main/java/com/opensymphony/xwork2/config/providers/StrutsDefaultConfigurationProvider.java
similarity

[struts] branch WW-5078-removes-xwork-dtds updated: WW-5078 Drops unneeded DTDs

2020-11-29 Thread lukaszlenart
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a commit to branch WW-5078-removes-xwork-dtds
in repository https://gitbox.apache.org/repos/asf/struts.git


The following commit(s) were added to refs/heads/WW-5078-removes-xwork-dtds by 
this push:
 new b2fb778  WW-5078 Drops unneeded DTDs
b2fb778 is described below

commit b2fb778909e05379e25fd174e7b9e3619add9712
Author: Lukasz Lenart 
AuthorDate: Sun Nov 29 17:01:46 2020 +0100

WW-5078 Drops unneeded DTDs
---
 .../config/providers/XmlConfigurationProvider.java |  12 +-
 .../config/StrutsXmlConfigurationProvider.java |   3 +-
 .../org/apache/struts2/dispatcher/Dispatcher.java  |   2 +-
 core/src/main/resources/struts-default.xml |   8 +-
 core/src/main/resources/xwork-1.0.dtd  | 106 --
 core/src/main/resources/xwork-1.1.1.dtd| 123 
 core/src/main/resources/xwork-1.1.2.dtd| 131 -
 core/src/main/resources/xwork-1.1.dtd  | 115 ---
 core/src/main/resources/xwork-2.0.dtd  | 137 --
 core/src/main/resources/xwork-2.1.3.dtd| 146 ---
 core/src/main/resources/xwork-2.1.dtd  | 143 ---
 core/src/main/resources/xwork-2.3.dtd  | 149 ---
 core/src/main/resources/xwork-2.5.dtd  | 151 
 core/src/main/resources/xwork-2.6.dtd  | 157 -
 .../xwork2/util/ClassLoaderUtilTest.java   |  12 +-
 .../interceptor/FetchMetadataInterceptorTest.java  |   4 +-
 .../apache/struts2/dispatcher/ng/struts-no-op.xml  |   4 +-
 .../org/apache/struts2/views/jsp/WW3090-struts.xml |   4 +-
 .../resources/{xwork-1.0.dtd => struts-2.0.dtd}|   0
 core/src/test/resources/struts.xml |   4 +-
 20 files changed, 26 insertions(+), 1385 deletions(-)

diff --git 
a/core/src/main/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProvider.java
 
b/core/src/main/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProvider.java
index d2da197..e02338f 100644
--- 
a/core/src/main/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProvider.java
+++ 
b/core/src/main/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProvider.java
@@ -72,6 +72,7 @@ import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 import java.util.Set;
 import java.util.Vector;
 
@@ -106,7 +107,7 @@ public abstract class XmlConfigurationProvider implements 
ConfigurationProvider
 private ValueSubstitutor valueSubstitutor;
 
 public XmlConfigurationProvider() {
-this("xwork.xml", true);
+this("struts.xml", true);
 }
 
 public XmlConfigurationProvider(String filename) {
@@ -170,11 +171,7 @@ public abstract class XmlConfigurationProvider implements 
ConfigurationProvider
 
 final XmlConfigurationProvider xmlConfigurationProvider = 
(XmlConfigurationProvider) o;
 
-if ((configFileName != null) ? 
(!configFileName.equals(xmlConfigurationProvider.configFileName)) : 
(xmlConfigurationProvider.configFileName != null)) {
-return false;
-}
-
-return true;
+return Objects.equals(configFileName, 
xmlConfigurationProvider.configFileName);
 }
 
 @Override
@@ -1066,7 +1063,8 @@ public abstract class XmlConfigurationProvider implements 
ConfigurationProvider
 }
 
 if (urls == null || !urls.hasNext()) {
-throw new ConfigurationException("Could not open file: " + 
fileName, ioException);
+LOG.debug("Ignoring file that does not exist: " + fileName, 
ioException);
+return docs;
 }
 
 URL url = null;
diff --git 
a/core/src/main/java/org/apache/struts2/config/StrutsXmlConfigurationProvider.java
 
b/core/src/main/java/org/apache/struts2/config/StrutsXmlConfigurationProvider.java
index 3461c75..f876d06 100644
--- 
a/core/src/main/java/org/apache/struts2/config/StrutsXmlConfigurationProvider.java
+++ 
b/core/src/main/java/org/apache/struts2/config/StrutsXmlConfigurationProvider.java
@@ -51,6 +51,7 @@ public class StrutsXmlConfigurationProvider extends 
XmlConfigurationProvider {
  *
  * @param errorIfMissing If we should throw an exception if the file can't 
be found
  */
+@Deprecated
 public StrutsXmlConfigurationProvider(boolean errorIfMissing) {
 this("struts.xml", errorIfMissing, null);
 }
@@ -75,7 +76,7 @@ public class StrutsXmlConfigurationProvider extends 
XmlConfigurationProvider {
 super(filename, errorIfMissing);
 this.servletContext = ctx;
 this.filename = filename;
-reloadKey = "configurationReload-"+filename;
+reloadKey = "configurationReload-" + filename;
 Map dtdMappings = new 
HashMap(getDtdMappings());