(struts) branch fix/WW-5422-trimable updated (adec73ea7 -> 0a57cac6d)

2024-05-12 Thread lukaszlenart
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a change to branch fix/WW-5422-trimable
in repository https://gitbox.apache.org/repos/asf/struts.git


 discard adec73ea7 WW-5422 Adds dedicate unit test to cover 
DefaultLocaleProvider
 new 0a57cac6d WW-5422 Adds dedicate unit test to cover 
DefaultLocaleProvider

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (adec73ea7)
\
 N -- N -- N   refs/heads/fix/WW-5422-trimable (0a57cac6d)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

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.


Summary of changes:
 .../xwork2/DefaultLocaleProviderTest.java  | 40 +++---
 .../opensymphony/xwork2/LocaleProviderTest.java| 12 +++
 2 files changed, 26 insertions(+), 26 deletions(-)



(struts) 01/01: WW-5422 Adds dedicate unit test to cover DefaultLocaleProvider

2024-05-12 Thread lukaszlenart
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a commit to branch fix/WW-5422-trimable
in repository https://gitbox.apache.org/repos/asf/struts.git

commit 0a57cac6d6645789e36597fa0282d86f93455849
Author: Lukasz Lenart 
AuthorDate: Sat May 11 07:23:22 2024 +0200

WW-5422 Adds dedicate unit test to cover DefaultLocaleProvider
---
 .../com/opensymphony/xwork2/ActionSupport.java |   5 +
 .../opensymphony/xwork2/DefaultLocaleProvider.java |  18 ++-
 .../com/opensymphony/xwork2/LocaleProvider.java|  16 ++
 .../validator/DelegatingValidatorContext.java  |  12 +-
 .../struts2/interceptor/I18nInterceptor.java   |  25 ++-
 .../xwork2/DefaultLocaleProviderTest.java  | 174 +
 .../opensymphony/xwork2/LocaleProviderTest.java}   |  70 ++---
 .../struts2/interceptor/I18nInterceptorTest.java   |  20 +++
 8 files changed, 292 insertions(+), 48 deletions(-)

diff --git a/core/src/main/java/com/opensymphony/xwork2/ActionSupport.java 
b/core/src/main/java/com/opensymphony/xwork2/ActionSupport.java
index 8c7e15e60..ab1a18099 100644
--- a/core/src/main/java/com/opensymphony/xwork2/ActionSupport.java
+++ b/core/src/main/java/com/opensymphony/xwork2/ActionSupport.java
@@ -90,6 +90,11 @@ public class ActionSupport implements Action, Validateable, 
ValidationAware, Tex
 return getLocaleProvider().isValidLocale(locale);
 }
 
+@Override
+public Locale toLocale(String localeStr) {
+return getLocaleProvider().toLocale(localeStr);
+}
+
 @Override
 public boolean hasKey(String key) {
 return getTextProvider().hasKey(key);
diff --git 
a/core/src/main/java/com/opensymphony/xwork2/DefaultLocaleProvider.java 
b/core/src/main/java/com/opensymphony/xwork2/DefaultLocaleProvider.java
index da89306c0..35f16191a 100644
--- a/core/src/main/java/com/opensymphony/xwork2/DefaultLocaleProvider.java
+++ b/core/src/main/java/com/opensymphony/xwork2/DefaultLocaleProvider.java
@@ -46,17 +46,23 @@ public class DefaultLocaleProvider implements 
LocaleProvider {
 
 @Override
 public boolean isValidLocaleString(String localeStr) {
+Locale locale = this.toLocale(localeStr);
+return isValidLocale(locale);
+}
+
+@Override
+public boolean isValidLocale(Locale locale) {
+return locale != null && LocaleUtils.isAvailableLocale(locale);
+}
+
+@Override
+public Locale toLocale(String localeStr) {
 Locale locale = null;
 try {
 locale = LocaleUtils.toLocale(StringUtils.trimToNull(localeStr));
 } catch (IllegalArgumentException e) {
 LOG.warn(new ParameterizedMessage("Cannot convert [{}] to proper 
locale", localeStr), e);
 }
-return isValidLocale(locale);
-}
-
-@Override
-public boolean isValidLocale(Locale locale) {
-return LocaleUtils.isAvailableLocale(locale);
+return locale;
 }
 }
diff --git a/core/src/main/java/com/opensymphony/xwork2/LocaleProvider.java 
b/core/src/main/java/com/opensymphony/xwork2/LocaleProvider.java
index 67972af34..00a41a25b 100644
--- a/core/src/main/java/com/opensymphony/xwork2/LocaleProvider.java
+++ b/core/src/main/java/com/opensymphony/xwork2/LocaleProvider.java
@@ -18,6 +18,9 @@
  */
 package com.opensymphony.xwork2;
 
+import org.apache.commons.lang3.LocaleUtils;
+import org.apache.commons.lang3.StringUtils;
+
 import java.util.Locale;
 
 
@@ -58,4 +61,17 @@ public interface LocaleProvider {
  */
 boolean isValidLocale(Locale locale);
 
+/**
+ * Tries to convert provided locale string into {@link Locale} or returns 
null
+ * @param localeStr a String representing locale, e.g.: en_EN
+ * @return instance of {@link Locale} or null
+ * @since Struts 6.5.0
+ */
+default Locale toLocale(String localeStr) {
+try {
+return LocaleUtils.toLocale(StringUtils.trimToNull(localeStr));
+} catch (IllegalArgumentException e) {
+return null;
+}
+}
 }
diff --git 
a/core/src/main/java/com/opensymphony/xwork2/validator/DelegatingValidatorContext.java
 
b/core/src/main/java/com/opensymphony/xwork2/validator/DelegatingValidatorContext.java
index 5c7f2c136..bc8c88875 100644
--- 
a/core/src/main/java/com/opensymphony/xwork2/validator/DelegatingValidatorContext.java
+++ 
b/core/src/main/java/com/opensymphony/xwork2/validator/DelegatingValidatorContext.java
@@ -122,10 +122,15 @@ public class DelegatingValidatorContext implements 
ValidatorContext {
 return localeProvider.isValidLocale(locale);
 }
 
+@Override
+public Locale toLocale(String localeStr) {
+return localeProvider.toLocale(localeStr);
+}
+
 public boolean hasKey(String key) {
return textProvider.hasKey(key);
 }
-
+
 public String getText(String aTextName) {
 return textProvider.getText(aTextName);
 }
@@ -280,6 +285,11 @@ public class DelegatingValidatorContext 

(struts) branch fix/WW-5422-trimable updated (38d11f4b4 -> adec73ea7)

2024-05-12 Thread lukaszlenart
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a change to branch fix/WW-5422-trimable
in repository https://gitbox.apache.org/repos/asf/struts.git


 discard 38d11f4b4 WW-5422 Adds dedicate unit test to cover 
DefaultLocaleProvider
 new adec73ea7 WW-5422 Adds dedicate unit test to cover 
DefaultLocaleProvider

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (38d11f4b4)
\
 N -- N -- N   refs/heads/fix/WW-5422-trimable (adec73ea7)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

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.


Summary of changes:
 .../opensymphony/xwork2/LocaleProviderTest.java| 82 ++
 1 file changed, 82 insertions(+)
 create mode 100644 
core/src/test/java/com/opensymphony/xwork2/LocaleProviderTest.java



(struts) 01/01: WW-5422 Adds dedicate unit test to cover DefaultLocaleProvider

2024-05-12 Thread lukaszlenart
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a commit to branch fix/WW-5422-trimable
in repository https://gitbox.apache.org/repos/asf/struts.git

commit adec73ea753f2a5e15090544e7876a4a1a3a2700
Author: Lukasz Lenart 
AuthorDate: Sat May 11 07:23:22 2024 +0200

WW-5422 Adds dedicate unit test to cover DefaultLocaleProvider
---
 .../com/opensymphony/xwork2/ActionSupport.java |   5 +
 .../opensymphony/xwork2/DefaultLocaleProvider.java |  18 ++-
 .../com/opensymphony/xwork2/LocaleProvider.java|  16 ++
 .../validator/DelegatingValidatorContext.java  |  12 +-
 .../struts2/interceptor/I18nInterceptor.java   |  25 ++-
 .../xwork2/DefaultLocaleProviderTest.java  | 174 +
 .../opensymphony/xwork2/LocaleProviderTest.java}   |  70 ++---
 .../struts2/interceptor/I18nInterceptorTest.java   |  20 +++
 8 files changed, 292 insertions(+), 48 deletions(-)

diff --git a/core/src/main/java/com/opensymphony/xwork2/ActionSupport.java 
b/core/src/main/java/com/opensymphony/xwork2/ActionSupport.java
index 8c7e15e60..ab1a18099 100644
--- a/core/src/main/java/com/opensymphony/xwork2/ActionSupport.java
+++ b/core/src/main/java/com/opensymphony/xwork2/ActionSupport.java
@@ -90,6 +90,11 @@ public class ActionSupport implements Action, Validateable, 
ValidationAware, Tex
 return getLocaleProvider().isValidLocale(locale);
 }
 
+@Override
+public Locale toLocale(String localeStr) {
+return getLocaleProvider().toLocale(localeStr);
+}
+
 @Override
 public boolean hasKey(String key) {
 return getTextProvider().hasKey(key);
diff --git 
a/core/src/main/java/com/opensymphony/xwork2/DefaultLocaleProvider.java 
b/core/src/main/java/com/opensymphony/xwork2/DefaultLocaleProvider.java
index da89306c0..35f16191a 100644
--- a/core/src/main/java/com/opensymphony/xwork2/DefaultLocaleProvider.java
+++ b/core/src/main/java/com/opensymphony/xwork2/DefaultLocaleProvider.java
@@ -46,17 +46,23 @@ public class DefaultLocaleProvider implements 
LocaleProvider {
 
 @Override
 public boolean isValidLocaleString(String localeStr) {
+Locale locale = this.toLocale(localeStr);
+return isValidLocale(locale);
+}
+
+@Override
+public boolean isValidLocale(Locale locale) {
+return locale != null && LocaleUtils.isAvailableLocale(locale);
+}
+
+@Override
+public Locale toLocale(String localeStr) {
 Locale locale = null;
 try {
 locale = LocaleUtils.toLocale(StringUtils.trimToNull(localeStr));
 } catch (IllegalArgumentException e) {
 LOG.warn(new ParameterizedMessage("Cannot convert [{}] to proper 
locale", localeStr), e);
 }
-return isValidLocale(locale);
-}
-
-@Override
-public boolean isValidLocale(Locale locale) {
-return LocaleUtils.isAvailableLocale(locale);
+return locale;
 }
 }
diff --git a/core/src/main/java/com/opensymphony/xwork2/LocaleProvider.java 
b/core/src/main/java/com/opensymphony/xwork2/LocaleProvider.java
index 67972af34..00a41a25b 100644
--- a/core/src/main/java/com/opensymphony/xwork2/LocaleProvider.java
+++ b/core/src/main/java/com/opensymphony/xwork2/LocaleProvider.java
@@ -18,6 +18,9 @@
  */
 package com.opensymphony.xwork2;
 
+import org.apache.commons.lang3.LocaleUtils;
+import org.apache.commons.lang3.StringUtils;
+
 import java.util.Locale;
 
 
@@ -58,4 +61,17 @@ public interface LocaleProvider {
  */
 boolean isValidLocale(Locale locale);
 
+/**
+ * Tries to convert provided locale string into {@link Locale} or returns 
null
+ * @param localeStr a String representing locale, e.g.: en_EN
+ * @return instance of {@link Locale} or null
+ * @since Struts 6.5.0
+ */
+default Locale toLocale(String localeStr) {
+try {
+return LocaleUtils.toLocale(StringUtils.trimToNull(localeStr));
+} catch (IllegalArgumentException e) {
+return null;
+}
+}
 }
diff --git 
a/core/src/main/java/com/opensymphony/xwork2/validator/DelegatingValidatorContext.java
 
b/core/src/main/java/com/opensymphony/xwork2/validator/DelegatingValidatorContext.java
index 5c7f2c136..bc8c88875 100644
--- 
a/core/src/main/java/com/opensymphony/xwork2/validator/DelegatingValidatorContext.java
+++ 
b/core/src/main/java/com/opensymphony/xwork2/validator/DelegatingValidatorContext.java
@@ -122,10 +122,15 @@ public class DelegatingValidatorContext implements 
ValidatorContext {
 return localeProvider.isValidLocale(locale);
 }
 
+@Override
+public Locale toLocale(String localeStr) {
+return localeProvider.toLocale(localeStr);
+}
+
 public boolean hasKey(String key) {
return textProvider.hasKey(key);
 }
-
+
 public String getText(String aTextName) {
 return textProvider.getText(aTextName);
 }
@@ -280,6 +285,11 @@ public class DelegatingValidatorContext 

(struts) 01/01: WW-5422 Adds dedicate unit test to cover DefaultLocaleProvider

2024-05-12 Thread lukaszlenart
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a commit to branch fix/WW-5422-trimable
in repository https://gitbox.apache.org/repos/asf/struts.git

commit 38d11f4b43cc6ed6203a72ed7e312fde57bb53b2
Author: Lukasz Lenart 
AuthorDate: Sat May 11 07:23:22 2024 +0200

WW-5422 Adds dedicate unit test to cover DefaultLocaleProvider
---
 .../com/opensymphony/xwork2/ActionSupport.java |   5 +
 .../opensymphony/xwork2/DefaultLocaleProvider.java |  18 ++-
 .../com/opensymphony/xwork2/LocaleProvider.java|  16 ++
 .../validator/DelegatingValidatorContext.java  |  12 +-
 .../struts2/interceptor/I18nInterceptor.java   |  25 ++-
 .../xwork2/DefaultLocaleProviderTest.java  | 174 +
 .../struts2/interceptor/I18nInterceptorTest.java   |  20 +++
 7 files changed, 247 insertions(+), 23 deletions(-)

diff --git a/core/src/main/java/com/opensymphony/xwork2/ActionSupport.java 
b/core/src/main/java/com/opensymphony/xwork2/ActionSupport.java
index 8c7e15e60..ab1a18099 100644
--- a/core/src/main/java/com/opensymphony/xwork2/ActionSupport.java
+++ b/core/src/main/java/com/opensymphony/xwork2/ActionSupport.java
@@ -90,6 +90,11 @@ public class ActionSupport implements Action, Validateable, 
ValidationAware, Tex
 return getLocaleProvider().isValidLocale(locale);
 }
 
+@Override
+public Locale toLocale(String localeStr) {
+return getLocaleProvider().toLocale(localeStr);
+}
+
 @Override
 public boolean hasKey(String key) {
 return getTextProvider().hasKey(key);
diff --git 
a/core/src/main/java/com/opensymphony/xwork2/DefaultLocaleProvider.java 
b/core/src/main/java/com/opensymphony/xwork2/DefaultLocaleProvider.java
index da89306c0..35f16191a 100644
--- a/core/src/main/java/com/opensymphony/xwork2/DefaultLocaleProvider.java
+++ b/core/src/main/java/com/opensymphony/xwork2/DefaultLocaleProvider.java
@@ -46,17 +46,23 @@ public class DefaultLocaleProvider implements 
LocaleProvider {
 
 @Override
 public boolean isValidLocaleString(String localeStr) {
+Locale locale = this.toLocale(localeStr);
+return isValidLocale(locale);
+}
+
+@Override
+public boolean isValidLocale(Locale locale) {
+return locale != null && LocaleUtils.isAvailableLocale(locale);
+}
+
+@Override
+public Locale toLocale(String localeStr) {
 Locale locale = null;
 try {
 locale = LocaleUtils.toLocale(StringUtils.trimToNull(localeStr));
 } catch (IllegalArgumentException e) {
 LOG.warn(new ParameterizedMessage("Cannot convert [{}] to proper 
locale", localeStr), e);
 }
-return isValidLocale(locale);
-}
-
-@Override
-public boolean isValidLocale(Locale locale) {
-return LocaleUtils.isAvailableLocale(locale);
+return locale;
 }
 }
diff --git a/core/src/main/java/com/opensymphony/xwork2/LocaleProvider.java 
b/core/src/main/java/com/opensymphony/xwork2/LocaleProvider.java
index 67972af34..00a41a25b 100644
--- a/core/src/main/java/com/opensymphony/xwork2/LocaleProvider.java
+++ b/core/src/main/java/com/opensymphony/xwork2/LocaleProvider.java
@@ -18,6 +18,9 @@
  */
 package com.opensymphony.xwork2;
 
+import org.apache.commons.lang3.LocaleUtils;
+import org.apache.commons.lang3.StringUtils;
+
 import java.util.Locale;
 
 
@@ -58,4 +61,17 @@ public interface LocaleProvider {
  */
 boolean isValidLocale(Locale locale);
 
+/**
+ * Tries to convert provided locale string into {@link Locale} or returns 
null
+ * @param localeStr a String representing locale, e.g.: en_EN
+ * @return instance of {@link Locale} or null
+ * @since Struts 6.5.0
+ */
+default Locale toLocale(String localeStr) {
+try {
+return LocaleUtils.toLocale(StringUtils.trimToNull(localeStr));
+} catch (IllegalArgumentException e) {
+return null;
+}
+}
 }
diff --git 
a/core/src/main/java/com/opensymphony/xwork2/validator/DelegatingValidatorContext.java
 
b/core/src/main/java/com/opensymphony/xwork2/validator/DelegatingValidatorContext.java
index 5c7f2c136..bc8c88875 100644
--- 
a/core/src/main/java/com/opensymphony/xwork2/validator/DelegatingValidatorContext.java
+++ 
b/core/src/main/java/com/opensymphony/xwork2/validator/DelegatingValidatorContext.java
@@ -122,10 +122,15 @@ public class DelegatingValidatorContext implements 
ValidatorContext {
 return localeProvider.isValidLocale(locale);
 }
 
+@Override
+public Locale toLocale(String localeStr) {
+return localeProvider.toLocale(localeStr);
+}
+
 public boolean hasKey(String key) {
return textProvider.hasKey(key);
 }
-
+
 public String getText(String aTextName) {
 return textProvider.getText(aTextName);
 }
@@ -280,6 +285,11 @@ public class DelegatingValidatorContext implements 
ValidatorContext {
 public boolean 

(struts) branch fix/WW-5422-trimable updated (67eb1aac4 -> 38d11f4b4)

2024-05-12 Thread lukaszlenart
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a change to branch fix/WW-5422-trimable
in repository https://gitbox.apache.org/repos/asf/struts.git


 discard 67eb1aac4 WW-5422 Adds dedicate unit test to cover 
DefaultLocaleProvider
 new 38d11f4b4 WW-5422 Adds dedicate unit test to cover 
DefaultLocaleProvider

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (67eb1aac4)
\
 N -- N -- N   refs/heads/fix/WW-5422-trimable (38d11f4b4)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

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.


Summary of changes:
 .../xwork2/DefaultLocaleProviderTest.java| 20 +++-
 1 file changed, 19 insertions(+), 1 deletion(-)



(struts) 01/01: WW-5422 Adds dedicate unit test to cover DefaultLocaleProvider

2024-05-12 Thread lukaszlenart
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a commit to branch fix/WW-5422-trimable
in repository https://gitbox.apache.org/repos/asf/struts.git

commit 67eb1aac4a45f753bc179d7e1990df02142a3edd
Author: Lukasz Lenart 
AuthorDate: Sat May 11 07:23:22 2024 +0200

WW-5422 Adds dedicate unit test to cover DefaultLocaleProvider
---
 .../com/opensymphony/xwork2/ActionSupport.java |   5 +
 .../opensymphony/xwork2/DefaultLocaleProvider.java |  18 ++-
 .../com/opensymphony/xwork2/LocaleProvider.java|  16 +++
 .../validator/DelegatingValidatorContext.java  |  12 +-
 .../struts2/interceptor/I18nInterceptor.java   |  25 ++--
 .../xwork2/DefaultLocaleProviderTest.java  | 156 +
 .../struts2/interceptor/I18nInterceptorTest.java   |  20 +++
 7 files changed, 229 insertions(+), 23 deletions(-)

diff --git a/core/src/main/java/com/opensymphony/xwork2/ActionSupport.java 
b/core/src/main/java/com/opensymphony/xwork2/ActionSupport.java
index 8c7e15e60..ab1a18099 100644
--- a/core/src/main/java/com/opensymphony/xwork2/ActionSupport.java
+++ b/core/src/main/java/com/opensymphony/xwork2/ActionSupport.java
@@ -90,6 +90,11 @@ public class ActionSupport implements Action, Validateable, 
ValidationAware, Tex
 return getLocaleProvider().isValidLocale(locale);
 }
 
+@Override
+public Locale toLocale(String localeStr) {
+return getLocaleProvider().toLocale(localeStr);
+}
+
 @Override
 public boolean hasKey(String key) {
 return getTextProvider().hasKey(key);
diff --git 
a/core/src/main/java/com/opensymphony/xwork2/DefaultLocaleProvider.java 
b/core/src/main/java/com/opensymphony/xwork2/DefaultLocaleProvider.java
index da89306c0..35f16191a 100644
--- a/core/src/main/java/com/opensymphony/xwork2/DefaultLocaleProvider.java
+++ b/core/src/main/java/com/opensymphony/xwork2/DefaultLocaleProvider.java
@@ -46,17 +46,23 @@ public class DefaultLocaleProvider implements 
LocaleProvider {
 
 @Override
 public boolean isValidLocaleString(String localeStr) {
+Locale locale = this.toLocale(localeStr);
+return isValidLocale(locale);
+}
+
+@Override
+public boolean isValidLocale(Locale locale) {
+return locale != null && LocaleUtils.isAvailableLocale(locale);
+}
+
+@Override
+public Locale toLocale(String localeStr) {
 Locale locale = null;
 try {
 locale = LocaleUtils.toLocale(StringUtils.trimToNull(localeStr));
 } catch (IllegalArgumentException e) {
 LOG.warn(new ParameterizedMessage("Cannot convert [{}] to proper 
locale", localeStr), e);
 }
-return isValidLocale(locale);
-}
-
-@Override
-public boolean isValidLocale(Locale locale) {
-return LocaleUtils.isAvailableLocale(locale);
+return locale;
 }
 }
diff --git a/core/src/main/java/com/opensymphony/xwork2/LocaleProvider.java 
b/core/src/main/java/com/opensymphony/xwork2/LocaleProvider.java
index 67972af34..00a41a25b 100644
--- a/core/src/main/java/com/opensymphony/xwork2/LocaleProvider.java
+++ b/core/src/main/java/com/opensymphony/xwork2/LocaleProvider.java
@@ -18,6 +18,9 @@
  */
 package com.opensymphony.xwork2;
 
+import org.apache.commons.lang3.LocaleUtils;
+import org.apache.commons.lang3.StringUtils;
+
 import java.util.Locale;
 
 
@@ -58,4 +61,17 @@ public interface LocaleProvider {
  */
 boolean isValidLocale(Locale locale);
 
+/**
+ * Tries to convert provided locale string into {@link Locale} or returns 
null
+ * @param localeStr a String representing locale, e.g.: en_EN
+ * @return instance of {@link Locale} or null
+ * @since Struts 6.5.0
+ */
+default Locale toLocale(String localeStr) {
+try {
+return LocaleUtils.toLocale(StringUtils.trimToNull(localeStr));
+} catch (IllegalArgumentException e) {
+return null;
+}
+}
 }
diff --git 
a/core/src/main/java/com/opensymphony/xwork2/validator/DelegatingValidatorContext.java
 
b/core/src/main/java/com/opensymphony/xwork2/validator/DelegatingValidatorContext.java
index 5c7f2c136..bc8c88875 100644
--- 
a/core/src/main/java/com/opensymphony/xwork2/validator/DelegatingValidatorContext.java
+++ 
b/core/src/main/java/com/opensymphony/xwork2/validator/DelegatingValidatorContext.java
@@ -122,10 +122,15 @@ public class DelegatingValidatorContext implements 
ValidatorContext {
 return localeProvider.isValidLocale(locale);
 }
 
+@Override
+public Locale toLocale(String localeStr) {
+return localeProvider.toLocale(localeStr);
+}
+
 public boolean hasKey(String key) {
return textProvider.hasKey(key);
 }
-
+
 public String getText(String aTextName) {
 return textProvider.getText(aTextName);
 }
@@ -280,6 +285,11 @@ public class DelegatingValidatorContext implements 
ValidatorContext {
 public boolean 

(struts) branch fix/WW-5422-trimable updated (3e3111c74 -> 67eb1aac4)

2024-05-12 Thread lukaszlenart
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a change to branch fix/WW-5422-trimable
in repository https://gitbox.apache.org/repos/asf/struts.git


omit 3e3111c74 WW-5422 Fixes support for trimable locale string in request
 new 67eb1aac4 WW-5422 Adds dedicate unit test to cover 
DefaultLocaleProvider

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (3e3111c74)
\
 N -- N -- N   refs/heads/fix/WW-5422-trimable (67eb1aac4)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

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.


Summary of changes:
 .../opensymphony/xwork2/DefaultLocaleProvider.java |   9 +-
 .../xwork2/DefaultLocaleProviderTest.java  | 156 +
 2 files changed, 158 insertions(+), 7 deletions(-)
 create mode 100644 
core/src/test/java/com/opensymphony/xwork2/DefaultLocaleProviderTest.java



(struts) branch dependabot/github_actions/ossf/scorecard-action-2.3.3 deleted (was 039c5f8d4)

2024-05-12 Thread lukaszlenart
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a change to branch 
dependabot/github_actions/ossf/scorecard-action-2.3.3
in repository https://gitbox.apache.org/repos/asf/struts.git


 was 039c5f8d4 Bump ossf/scorecard-action from 2.3.1 to 2.3.3

The revisions that were on this branch are still contained in
other references; therefore, this change does not discard any commits
from the repository.



(struts) 01/01: Merge pull request #939 from apache/dependabot/github_actions/ossf/scorecard-action-2.3.3

2024-05-12 Thread lukaszlenart
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/struts.git

commit 195b0e59d00e0c9451fb19dd44f0a1a79e1aeaea
Merge: 03126c01b 039c5f8d4
Author: Lukasz Lenart 
AuthorDate: Mon May 13 06:50:39 2024 +0200

Merge pull request #939 from 
apache/dependabot/github_actions/ossf/scorecard-action-2.3.3

Bump ossf/scorecard-action from 2.3.1 to 2.3.3

 .github/workflows/scorecards-analysis.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



(struts) branch master updated (03126c01b -> 195b0e59d)

2024-05-12 Thread lukaszlenart
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/struts.git


from 03126c01b Merge pull request #938 from 
apache/dependabot/maven/org.apache.maven.plugins-maven-project-info-reports-plugin-3.5.0
 add 039c5f8d4 Bump ossf/scorecard-action from 2.3.1 to 2.3.3
 new 195b0e59d Merge pull request #939 from 
apache/dependabot/github_actions/ossf/scorecard-action-2.3.3

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.


Summary of changes:
 .github/workflows/scorecards-analysis.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



(struts) branch dependabot/maven/org.apache.maven.plugins-maven-project-info-reports-plugin-3.5.0 deleted (was 6e12c25ac)

2024-05-12 Thread lukaszlenart
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a change to branch 
dependabot/maven/org.apache.maven.plugins-maven-project-info-reports-plugin-3.5.0
in repository https://gitbox.apache.org/repos/asf/struts.git


 was 6e12c25ac Bump 
org.apache.maven.plugins:maven-project-info-reports-plugin

The revisions that were on this branch are still contained in
other references; therefore, this change does not discard any commits
from the repository.



(struts) branch master updated (73be382a9 -> 03126c01b)

2024-05-12 Thread lukaszlenart
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/struts.git


from 73be382a9 Merge pull request #936 from 
apache/dependabot/maven/slf4j.version-2.0.13
 add 6e12c25ac Bump 
org.apache.maven.plugins:maven-project-info-reports-plugin
 new 03126c01b Merge pull request #938 from 
apache/dependabot/maven/org.apache.maven.plugins-maven-project-info-reports-plugin-3.5.0

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.


Summary of changes:
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



(struts) 01/01: Merge pull request #938 from apache/dependabot/maven/org.apache.maven.plugins-maven-project-info-reports-plugin-3.5.0

2024-05-12 Thread lukaszlenart
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/struts.git

commit 03126c01bfd07c88f0594275b1dd1b5d73ba8ea1
Merge: 73be382a9 6e12c25ac
Author: Lukasz Lenart 
AuthorDate: Mon May 13 06:50:20 2024 +0200

Merge pull request #938 from 
apache/dependabot/maven/org.apache.maven.plugins-maven-project-info-reports-plugin-3.5.0

Bump org.apache.maven.plugins:maven-project-info-reports-plugin from 3.0.0 
to 3.5.0

 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)




(struts) branch dependabot/maven/ognl-ognl-3.4.3 deleted (was f3108a438)

2024-05-12 Thread lukaszlenart
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a change to branch dependabot/maven/ognl-ognl-3.4.3
in repository https://gitbox.apache.org/repos/asf/struts.git


 was f3108a438 Bump ognl:ognl from 3.3.5 to 3.4.3

The revisions that were on this branch are still contained in
other references; therefore, this change does not discard any commits
from the repository.



(struts) branch dependabot/maven/slf4j.version-2.0.13 deleted (was c6b53d488)

2024-05-12 Thread lukaszlenart
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a change to branch dependabot/maven/slf4j.version-2.0.13
in repository https://gitbox.apache.org/repos/asf/struts.git


 was c6b53d488 Bump slf4j.version from 2.0.12 to 2.0.13

The revisions that were on this branch are still contained in
other references; therefore, this change does not discard any commits
from the repository.



(struts) branch master updated (f338fda6d -> 73be382a9)

2024-05-12 Thread lukaszlenart
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/struts.git


from f338fda6d Merge pull request #934 from 
apache/dependabot/maven/org.apache.maven.plugins-maven-source-plugin-3.3.1
 add c6b53d488 Bump slf4j.version from 2.0.12 to 2.0.13
 new 73be382a9 Merge pull request #936 from 
apache/dependabot/maven/slf4j.version-2.0.13

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.


Summary of changes:
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



(struts) 01/01: Merge pull request #936 from apache/dependabot/maven/slf4j.version-2.0.13

2024-05-12 Thread lukaszlenart
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/struts.git

commit 73be382a96ac24fe3c3f8e314d74c45fa412f54a
Merge: f338fda6d c6b53d488
Author: Lukasz Lenart 
AuthorDate: Mon May 13 06:49:43 2024 +0200

Merge pull request #936 from apache/dependabot/maven/slf4j.version-2.0.13

Bump slf4j.version from 2.0.12 to 2.0.13

 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)




(struts) branch dependabot/maven/spring.platformVersion-6.1.6 deleted (was 04fa3f015)

2024-05-12 Thread lukaszlenart
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a change to branch 
dependabot/maven/spring.platformVersion-6.1.6
in repository https://gitbox.apache.org/repos/asf/struts.git


 was 04fa3f015 Bump spring.platformVersion from 5.3.31 to 6.1.6

The revisions that were on this branch are still contained in
other references; therefore, this change does not discard any commits
from the repository.



(struts) branch dependabot/maven/org.apache.maven.plugins-maven-source-plugin-3.3.1 deleted (was 942fbd67e)

2024-05-12 Thread lukaszlenart
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a change to branch 
dependabot/maven/org.apache.maven.plugins-maven-source-plugin-3.3.1
in repository https://gitbox.apache.org/repos/asf/struts.git


 was 942fbd67e Bump org.apache.maven.plugins:maven-source-plugin from 3.3.0 
to 3.3.1

The revisions that were on this branch are still contained in
other references; therefore, this change does not discard any commits
from the repository.



(struts) branch master updated (649760d8b -> f338fda6d)

2024-05-12 Thread lukaszlenart
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/struts.git


from 649760d8b Merge pull request #913 from eschulma/master
 add 942fbd67e Bump org.apache.maven.plugins:maven-source-plugin from 3.3.0 
to 3.3.1
 add f338fda6d Merge pull request #934 from 
apache/dependabot/maven/org.apache.maven.plugins-maven-source-plugin-3.3.1

No new revisions were added by this update.

Summary of changes:
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



(struts) branch fix/WW-5415-constructor updated (b36e88ff4 -> 7c523ac33)

2024-05-12 Thread kusal
This is an automated email from the ASF dual-hosted git repository.

kusal pushed a change to branch fix/WW-5415-constructor
in repository https://gitbox.apache.org/repos/asf/struts.git


from b36e88ff4 WW-5415 Fixes accessing public constructors via expression
 add 7c523ac33 WW-5415 Constructor members should be exempted as static 
members

No new revisions were added by this update.

Summary of changes:
 .../java/com/opensymphony/xwork2/ognl/SecurityMemberAccess.java| 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)



(struts) branch dependabot/github_actions/ossf/scorecard-action-2.3.3 created (now 039c5f8d4)

2024-05-12 Thread github-bot
This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a change to branch 
dependabot/github_actions/ossf/scorecard-action-2.3.3
in repository https://gitbox.apache.org/repos/asf/struts.git


  at 039c5f8d4 Bump ossf/scorecard-action from 2.3.1 to 2.3.3

No new revisions were added by this update.



(struts) branch dependabot/maven/org.apache.maven.plugins-maven-project-info-reports-plugin-3.5.0 created (now 6e12c25ac)

2024-05-12 Thread github-bot
This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a change to branch 
dependabot/maven/org.apache.maven.plugins-maven-project-info-reports-plugin-3.5.0
in repository https://gitbox.apache.org/repos/asf/struts.git


  at 6e12c25ac Bump 
org.apache.maven.plugins:maven-project-info-reports-plugin

No new revisions were added by this update.



(struts) branch dependabot/maven/ognl-ognl-3.4.3 created (now f3108a438)

2024-05-12 Thread github-bot
This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a change to branch dependabot/maven/ognl-ognl-3.4.3
in repository https://gitbox.apache.org/repos/asf/struts.git


  at f3108a438 Bump ognl:ognl from 3.3.5 to 3.4.3

No new revisions were added by this update.



(struts) branch dependabot/maven/slf4j.version-2.0.13 created (now c6b53d488)

2024-05-12 Thread github-bot
This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a change to branch dependabot/maven/slf4j.version-2.0.13
in repository https://gitbox.apache.org/repos/asf/struts.git


  at c6b53d488 Bump slf4j.version from 2.0.12 to 2.0.13

No new revisions were added by this update.



(struts) branch dependabot/maven/spring.platformVersion-6.1.6 created (now 04fa3f015)

2024-05-12 Thread github-bot
This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a change to branch 
dependabot/maven/spring.platformVersion-6.1.6
in repository https://gitbox.apache.org/repos/asf/struts.git


  at 04fa3f015 Bump spring.platformVersion from 5.3.31 to 6.1.6

No new revisions were added by this update.



(struts) branch dependabot/maven/org.apache.maven.plugins-maven-source-plugin-3.3.1 created (now 942fbd67e)

2024-05-12 Thread github-bot
This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a change to branch 
dependabot/maven/org.apache.maven.plugins-maven-source-plugin-3.3.1
in repository https://gitbox.apache.org/repos/asf/struts.git


  at 942fbd67e Bump org.apache.maven.plugins:maven-source-plugin from 3.3.0 
to 3.3.1

No new revisions were added by this update.



(struts-examples) branch dependabot/maven/org.eclipse.jetty.ee8-jetty-ee8-maven-plugin-12.0.9 created (now e46d1e1)

2024-05-12 Thread github-bot
This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a change to branch 
dependabot/maven/org.eclipse.jetty.ee8-jetty-ee8-maven-plugin-12.0.9
in repository https://gitbox.apache.org/repos/asf/struts-examples.git


  at e46d1e1  Bump org.eclipse.jetty.ee8:jetty-ee8-maven-plugin from 12.0.8 
to 12.0.9

No new revisions were added by this update.



(struts-examples) branch dependabot/maven/net.sf.jasperreports-jasperreports-6.21.3 created (now 3bb4400)

2024-05-12 Thread github-bot
This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a change to branch 
dependabot/maven/net.sf.jasperreports-jasperreports-6.21.3
in repository https://gitbox.apache.org/repos/asf/struts-examples.git


  at 3bb4400  Bump net.sf.jasperreports:jasperreports from 6.21.2 to 6.21.3

No new revisions were added by this update.



(struts-examples) branch dependabot/github_actions/actions/checkout-4.1.5 created (now 7d37898)

2024-05-12 Thread github-bot
This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a change to branch 
dependabot/github_actions/actions/checkout-4.1.5
in repository https://gitbox.apache.org/repos/asf/struts-examples.git


  at 7d37898  Bump actions/checkout from 4.1.4 to 4.1.5

No new revisions were added by this update.



(struts-examples) branch dependabot/maven/struts2.version-6.4.0 created (now 86d193e)

2024-05-12 Thread github-bot
This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a change to branch dependabot/maven/struts2.version-6.4.0
in repository https://gitbox.apache.org/repos/asf/struts-examples.git


  at 86d193e  Bump struts2.version from 6.3.0.2 to 6.4.0

No new revisions were added by this update.



(struts) 01/01: WW-5415 Fixes accessing public constructors via expression

2024-05-12 Thread lukaszlenart
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a commit to branch fix/WW-5415-constructor
in repository https://gitbox.apache.org/repos/asf/struts.git

commit b36e88ff4b2810776854041dc1e71fd95228aef5
Author: Lukasz Lenart 
AuthorDate: Sun May 12 09:47:38 2024 +0200

WW-5415 Fixes accessing public constructors via expression
---
 .../com/opensymphony/xwork2/ognl/SecurityMemberAccess.java|  2 +-
 .../xwork2/validator/VisitorFieldValidatorTest.java   | 11 +++
 .../xwork2/validator/VisitorValidatorTestAction.java  | 11 ++-
 .../validator/VisitorValidatorTestAction-validation.xml   |  8 
 4 files changed, 30 insertions(+), 2 deletions(-)

diff --git 
a/core/src/main/java/com/opensymphony/xwork2/ognl/SecurityMemberAccess.java 
b/core/src/main/java/com/opensymphony/xwork2/ognl/SecurityMemberAccess.java
index 43ae99240..8a8c71326 100644
--- a/core/src/main/java/com/opensymphony/xwork2/ognl/SecurityMemberAccess.java
+++ b/core/src/main/java/com/opensymphony/xwork2/ognl/SecurityMemberAccess.java
@@ -147,7 +147,7 @@ public class SecurityMemberAccess implements MemberAccess {
 if (target != null) {
 // Special case: Target is a Class object but not Class.class
 if (Class.class.equals(target.getClass()) && 
!Class.class.equals(target)) {
-if (!isStatic(member)) {
+if (!isStatic(member) && Arrays.stream(((Class) 
target).getConstructors()).noneMatch(p -> 
p.getClass().equals(member.getClass( {
 throw new IllegalArgumentException("Member expected to be 
static!");
 }
 if (!member.getDeclaringClass().equals(target)) {
diff --git 
a/core/src/test/java/com/opensymphony/xwork2/validator/VisitorFieldValidatorTest.java
 
b/core/src/test/java/com/opensymphony/xwork2/validator/VisitorFieldValidatorTest.java
index 76c2eac71..de605d2c5 100644
--- 
a/core/src/test/java/com/opensymphony/xwork2/validator/VisitorFieldValidatorTest.java
+++ 
b/core/src/test/java/com/opensymphony/xwork2/validator/VisitorFieldValidatorTest.java
@@ -28,6 +28,8 @@ import com.opensymphony.xwork2.config.entities.ActionConfig;
 import com.opensymphony.xwork2.conversion.impl.ConversionData;
 import org.easymock.EasyMock;
 
+import java.sql.Date;
+import java.time.LocalDate;
 import java.util.Calendar;
 import java.util.GregorianCalendar;
 import java.util.HashMap;
@@ -142,6 +144,15 @@ public class VisitorFieldValidatorTest extends 
XWorkTestCase {
 assertEquals(1, errors.size());
 }
 
+public void testDateValidation() throws Exception {
+action.setBirthday(Date.valueOf(LocalDate.now().minusYears(20)));
+action.setContext("birthday");
+
+validate("birthday");
+
+assertFalse(action.hasFieldErrors());
+}
+
 public void testContextIsOverriddenByContextParamInValidationXML() throws 
Exception {
 validate("visitorValidationAlias");
 assertTrue(action.hasFieldErrors());
diff --git 
a/core/src/test/java/com/opensymphony/xwork2/validator/VisitorValidatorTestAction.java
 
b/core/src/test/java/com/opensymphony/xwork2/validator/VisitorValidatorTestAction.java
index 2050726f7..9e672bf48 100644
--- 
a/core/src/test/java/com/opensymphony/xwork2/validator/VisitorValidatorTestAction.java
+++ 
b/core/src/test/java/com/opensymphony/xwork2/validator/VisitorValidatorTestAction.java
@@ -22,6 +22,7 @@ import com.opensymphony.xwork2.ActionSupport;
 import com.opensymphony.xwork2.TestBean;
 
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 
 
@@ -37,7 +38,7 @@ public class VisitorValidatorTestAction extends ActionSupport 
{
 private String context;
 private TestBean bean = new TestBean();
 private TestBean[] testBeanArray;
-
+private Date birthday;
 
 public VisitorValidatorTestAction() {
 testBeanArray = new TestBean[5];
@@ -80,4 +81,12 @@ public class VisitorValidatorTestAction extends 
ActionSupport {
 public List getTestBeanList() {
 return testBeanList;
 }
+
+public Date getBirthday() {
+return birthday;
+}
+
+public void setBirthday(Date birthday) {
+this.birthday = birthday;
+}
 }
diff --git 
a/core/src/test/resources/com/opensymphony/xwork2/validator/VisitorValidatorTestAction-validation.xml
 
b/core/src/test/resources/com/opensymphony/xwork2/validator/VisitorValidatorTestAction-validation.xml
index a8de9f705..fb2aa80bf 100644
--- 
a/core/src/test/resources/com/opensymphony/xwork2/validator/VisitorValidatorTestAction-validation.xml
+++ 
b/core/src/test/resources/com/opensymphony/xwork2/validator/VisitorValidatorTestAction-validation.xml
@@ -26,4 +26,12 @@
 You must enter a context.
 
 
+
+
+
+
+
+
 



(struts) branch fix/WW-5415-constructor created (now b36e88ff4)

2024-05-12 Thread lukaszlenart
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a change to branch fix/WW-5415-constructor
in repository https://gitbox.apache.org/repos/asf/struts.git


  at b36e88ff4 WW-5415 Fixes accessing public constructors via expression

This branch includes the following new commits:

 new b36e88ff4 WW-5415 Fixes accessing public constructors via expression

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.