struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lukaszlen...@apache.org
Subject [struts] 01/03: WW-5047 Avoids confusion about scope's default value
Date Thu, 26 Dec 2019 08:44:54 GMT
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a commit to branch WW-5049-velocity-plugin
in repository https://gitbox.apache.org/repos/asf/struts.git

commit dddb380004b01470e9dbf357f749a46634c3da1c
Author: Lukasz Lenart <lukaszlenart@apache.org>
AuthorDate: Thu Dec 26 09:34:41 2019 +0100

    WW-5047 Avoids confusion about scope's default value
---
 .../xwork2/config/providers/XmlConfigurationProvider.java           | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

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 5fb5df6..ad742b9 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
@@ -242,15 +242,19 @@ public class XmlConfigurationProvider implements ConfigurationProvider
{
                         String onlyStatic = child.getAttribute("static");
                         String scopeStr = child.getAttribute("scope");
                         boolean optional = "true".equals(child.getAttribute("optional"));
-                        Scope scope = Scope.SINGLETON;
+                        Scope scope;
                         if ("prototype".equals(scopeStr)) {
                             scope = Scope.PROTOTYPE;
                         } else if ("request".equals(scopeStr)) {
                             scope = Scope.REQUEST;
                         } else if ("session".equals(scopeStr)) {
                             scope = Scope.SESSION;
+                        } else if ("singleton".equals(scopeStr)) {
+                            scope = Scope.SINGLETON;
                         } else if ("thread".equals(scopeStr)) {
                             scope = Scope.THREAD;
+                        } else {
+                            scope = Scope.SINGLETON;
                         }
 
                         if (StringUtils.isEmpty(name)) {


Mime
View raw message