[struts] branch struts-2-5-x updated: Proposed WW-5035 enhancement: - Provide cache clearing methods for OgnlUtil (expression cache, BeanInfo cache). - Provide methods to check the cache sizes (entry

2019-09-07 Thread yasserzamani
This is an automated email from the ASF dual-hosted git repository.

yasserzamani pushed a commit to branch struts-2-5-x
in repository https://gitbox.apache.org/repos/asf/struts.git


The following commit(s) were added to refs/heads/struts-2-5-x by this push:
 new 9216e8e  Proposed WW-5035 enhancement: - Provide cache clearing 
methods for OgnlUtil (expression cache, BeanInfo cache). - Provide methods to 
check the cache sizes (entry number for expression cache, BeanInfo cache). - 
Provide static method to clear the OgnlRuntime cache (convenience method).
 new 4ae1a6a  Merge pull request #361 from 
JCgH4164838Gh792C124B5/localS2_25x_OgnlCachecontrol
9216e8e is described below

commit 9216e8e22c67393f29665186dd25ac5c4bf753e4
Author: JCgH4164838Gh792C124B5 
<43964333+jcgh4164838gh792c12...@users.noreply.github.com>
AuthorDate: Sat Jun 15 11:40:58 2019 -0400

Proposed WW-5035 enhancement:
- Provide cache clearing methods for OgnlUtil (expression cache, BeanInfo
cache).
- Provide methods to check the cache sizes (entry number for expression
cache, BeanInfo cache).
- Provide static method to clear the OgnlRuntime cache (convenience
method).
---
 .../com/opensymphony/xwork2/ognl/OgnlUtil.java |  70 +
 .../com/opensymphony/xwork2/ognl/OgnlUtilTest.java | 112 +
 2 files changed, 182 insertions(+)

diff --git a/core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java 
b/core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java
index 20be3dc..071ed71 100644
--- a/core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java
+++ b/core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java
@@ -189,6 +189,76 @@ public class OgnlUtil {
 }
 
 /**
+ * Convenience mechanism to clear the OGNL Runtime Cache via OgnlUtil.  
May be utilized
+ * by applications that generate many unique OGNL expressions over time.
+ *
+ * Note: This call affects the global OGNL cache, see ({@link 
ognl.OgnlRuntime#clearCache()} for details.
+ *
+ * Warning: Frequent calling if this method may negatively impact 
performance, but may be required
+ *  to avoid memory exhaustion (resource leak) with too many OGNL 
expressions being cached.
+ *
+ * @since 2.5.21
+ */
+public static void clearRuntimeCache() {
+OgnlRuntime.clearCache();
+}
+
+/**
+ * Provide a mechanism to clear the OGNL expression cache.  May be 
utilized by applications
+ * that generate many unique OGNL expressions over time.
+ *
+ * Note: This call affects the current OgnlUtil instance.  For Struts this 
is often a Singleton
+ *   instance so it can be "effectively global".
+ *
+ * Warning: Frequent calling if this method may negatively impact 
performance, but may be required
+ *  to avoid memory exhaustion (resource leak) with too many OGNL 
expressions being cached.
+ *
+ * @since 2.5.21
+ */
+public void clearExpressionCache() {
+expressions.clear();
+}
+
+/**
+ * Check the size of the expression cache (current number of elements).
+ *
+ * @return current number of elements in the expression cache.
+ *
+ * @since 2.5.21
+ */
+public int expressionCacheSize() {
+return expressions.size();
+}
+
+/**
+ * Provide a mechanism to clear the BeanInfo cache.  May be utilized by 
applications
+ * that request BeanInfo and/or PropertyDescriptors for many unique 
classes or objects over time
+ * (especially dynamic objects).
+ *
+ * Note: This call affects the current OgnlUtil instance.  For Struts this 
is often a Singleton
+ *   instance so it can be "effectively global".
+ *
+ * Warning: Frequent calling if this method may negatively impact 
performance, but may be required
+ *  to avoid memory exhaustion (resource leak) with too many 
BeanInfo elements being cached.
+ *
+ * @since 2.5.21
+ */
+public void clearBeanInfoCache() {
+beanInfoCache.clear();
+}
+
+/**
+ * Check the size of the BeanInfo cache (current number of elements).
+ *
+ * @return current number of elements in the BeanInfo cache.
+ *
+ * @since 2.5.21
+ */
+public int beanInfoCacheSize() {
+return beanInfoCache.size();
+}
+
+/**
  * Sets the object's properties using the default type converter, 
defaulting to not throw
  * exceptions for problems setting the properties.
  *
diff --git a/core/src/test/java/com/opensymphony/xwork2/ognl/OgnlUtilTest.java 
b/core/src/test/java/com/opensymphony/xwork2/ognl/OgnlUtilTest.java
index 9c5e59b..5f1a5a5 100644
--- a/core/src/test/java/com/opensymphony/xwork2/ognl/OgnlUtilTest.java
+++ b/core/src/test/java/com/opensymphony/xwork2/ognl/OgnlUtilTest.java
@@ -31,6 +31,7 @@ import com.opensymphony.xwork2.test.User;
 import com.opensymphony.xwork2.util.*;
 import com.opensymphon

[struts] branch struts-2-5-x updated: WW-5033 - Update to latest versions for some Struts 2.5.x dependencies: (#362)

2019-09-07 Thread yasserzamani
This is an automated email from the ASF dual-hosted git repository.

yasserzamani pushed a commit to branch struts-2-5-x
in repository https://gitbox.apache.org/repos/asf/struts.git


The following commit(s) were added to refs/heads/struts-2-5-x by this push:
 new f7b191f  WW-5033 - Update to latest versions for some Struts 2.5.x 
dependencies: (#362)
f7b191f is described below

commit f7b191f782ae53d3bde3e62953a0a1419278ce0a
Author: JCgH4164838Gh792C124B5 
<43964333+jcgh4164838gh792c12...@users.noreply.github.com>
AuthorDate: Sat Sep 7 06:03:34 2019 -0400

WW-5033 - Update to latest versions for some Struts 2.5.x dependencies: 
(#362)

* WW-5033 - Update to latests versions for some Struts 2.5.x dependencies:
- ASM 7 -> 7.1
- Spring 4.3.20.RELEASE -> 4.3.24.RELEASE

* fix Travis build
---
 .travis.yml | 3 ++-
 pom.xml | 4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index d07d990..1d9d615 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,3 +1,4 @@
+dist: trusty
 language: java
 sudo: false
 
@@ -25,4 +26,4 @@ env:
 cache:
   directories:
   - $HOME/.m2
-  
\ No newline at end of file
+  
diff --git a/pom.xml b/pom.xml
index c73be77..2fff51b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -97,9 +97,9 @@
 
 UTF-8
 
-4.3.20.RELEASE
+4.3.24.RELEASE
 3.1.23
-7.0
+7.1
 3.0.8
 1.0.7
 2.11.2



[struts] 01/02: Proposed WW-5035 enhancement: - Provide cache clearing methods for OgnlUtil (expression cache, BeanInfo cache). - Provide methods to check the cache sizes (entry number for expression

2019-09-07 Thread yasserzamani
This is an automated email from the ASF dual-hosted git repository.

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

commit 6d453ca70d5ccce80b1cf2708fb79c214a65d407
Author: JCgH4164838Gh792C124B5 
<43964333+jcgh4164838gh792c12...@users.noreply.github.com>
AuthorDate: Sat Jun 15 20:10:58 2019 +0430

Proposed WW-5035 enhancement:
- Provide cache clearing methods for OgnlUtil (expression cache, BeanInfo
cache).
- Provide methods to check the cache sizes (entry number for expression
cache, BeanInfo cache).
- Provide static method to clear the OgnlRuntime cache (convenience
method).

(cherry picked from commit 9216e8e)
---
 .../com/opensymphony/xwork2/ognl/OgnlUtil.java |  70 +
 .../com/opensymphony/xwork2/ognl/OgnlUtilTest.java | 112 +
 2 files changed, 182 insertions(+)

diff --git a/core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java 
b/core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java
index 084723e..d5720e9 100644
--- a/core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java
+++ b/core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java
@@ -194,6 +194,76 @@ public class OgnlUtil {
 }
 
 /**
+ * Convenience mechanism to clear the OGNL Runtime Cache via OgnlUtil.  
May be utilized
+ * by applications that generate many unique OGNL expressions over time.
+ *
+ * Note: This call affects the global OGNL cache, see ({@link 
ognl.OgnlRuntime#clearCache()} for details.
+ *
+ * Warning: Frequent calling if this method may negatively impact 
performance, but may be required
+ *  to avoid memory exhaustion (resource leak) with too many OGNL 
expressions being cached.
+ *
+ * @since 2.5.21
+ */
+public static void clearRuntimeCache() {
+OgnlRuntime.clearCache();
+}
+
+/**
+ * Provide a mechanism to clear the OGNL expression cache.  May be 
utilized by applications
+ * that generate many unique OGNL expressions over time.
+ *
+ * Note: This call affects the current OgnlUtil instance.  For Struts this 
is often a Singleton
+ *   instance so it can be "effectively global".
+ *
+ * Warning: Frequent calling if this method may negatively impact 
performance, but may be required
+ *  to avoid memory exhaustion (resource leak) with too many OGNL 
expressions being cached.
+ *
+ * @since 2.5.21
+ */
+public void clearExpressionCache() {
+expressions.clear();
+}
+
+/**
+ * Check the size of the expression cache (current number of elements).
+ *
+ * @return current number of elements in the expression cache.
+ *
+ * @since 2.5.21
+ */
+public int expressionCacheSize() {
+return expressions.size();
+}
+
+/**
+ * Provide a mechanism to clear the BeanInfo cache.  May be utilized by 
applications
+ * that request BeanInfo and/or PropertyDescriptors for many unique 
classes or objects over time
+ * (especially dynamic objects).
+ *
+ * Note: This call affects the current OgnlUtil instance.  For Struts this 
is often a Singleton
+ *   instance so it can be "effectively global".
+ *
+ * Warning: Frequent calling if this method may negatively impact 
performance, but may be required
+ *  to avoid memory exhaustion (resource leak) with too many 
BeanInfo elements being cached.
+ *
+ * @since 2.5.21
+ */
+public void clearBeanInfoCache() {
+beanInfoCache.clear();
+}
+
+/**
+ * Check the size of the BeanInfo cache (current number of elements).
+ *
+ * @return current number of elements in the BeanInfo cache.
+ *
+ * @since 2.5.21
+ */
+public int beanInfoCacheSize() {
+return beanInfoCache.size();
+}
+
+/**
  * Sets the object's properties using the default type converter, 
defaulting to not throw
  * exceptions for problems setting the properties.
  *
diff --git a/core/src/test/java/com/opensymphony/xwork2/ognl/OgnlUtilTest.java 
b/core/src/test/java/com/opensymphony/xwork2/ognl/OgnlUtilTest.java
index c226bb8..6662ad2 100644
--- a/core/src/test/java/com/opensymphony/xwork2/ognl/OgnlUtilTest.java
+++ b/core/src/test/java/com/opensymphony/xwork2/ognl/OgnlUtilTest.java
@@ -30,6 +30,7 @@ import com.opensymphony.xwork2.test.User;
 import com.opensymphony.xwork2.util.*;
 import com.opensymphony.xwork2.util.location.LocatableProperties;
 import com.opensymphony.xwork2.util.reflection.ReflectionContextState;
+import java.beans.IntrospectionException;
 import ognl.*;
 import org.apache.struts2.StrutsConstants;
 
@@ -111,6 +112,84 @@ public class OgnlUtilTest extends XWorkTestCase {
 assertSame(expr0, expr2);
 }
 
+public void testClearExpressionCache() throws OgnlException {
+ognlUtil.setEnableExpressionCache("true");
+// Test 

[struts] branch master updated (83da0b6 -> 9453e05)

2019-09-07 Thread yasserzamani
This is an automated email from the ASF dual-hosted git repository.

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


from 83da0b6  Merge pull request #365 from 
apache/WW-5038-upgrade-jackson-databind
 new 6d453ca  Proposed WW-5035 enhancement: - Provide cache clearing 
methods for OgnlUtil (expression cache, BeanInfo cache). - Provide methods to 
check the cache sizes (entry number for expression cache, BeanInfo cache). - 
Provide static method to clear the OgnlRuntime cache (convenience method).
 new 9453e05  WW-5033 - Update to latest versions for some Struts 2.5.x 
dependencies: (#362)

The 2 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:
 .../com/opensymphony/xwork2/ognl/OgnlUtil.java |  70 +
 .../com/opensymphony/xwork2/ognl/OgnlUtilTest.java | 112 +
 pom.xml|   6 +-
 3 files changed, 185 insertions(+), 3 deletions(-)



[struts] 02/02: WW-5033 - Update to latest versions for some Struts 2.5.x dependencies: (#362)

2019-09-07 Thread yasserzamani
This is an automated email from the ASF dual-hosted git repository.

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

commit 9453e05559731a4f20e720fa268e25c0040b80c0
Author: JCgH4164838Gh792C124B5 
<43964333+jcgh4164838gh792c12...@users.noreply.github.com>
AuthorDate: Sat Sep 7 14:33:34 2019 +0430

WW-5033 - Update to latest versions for some Struts 2.5.x dependencies: 
(#362)

* WW-5033 - Update to latests versions for some Struts 2.5.x dependencies:
- ASM 7 -> 7.1
- Spring 4.3.20.RELEASE -> 4.3.24.RELEASE

* fix Travis build

(cherry picked from commit f7b191f)
---
 pom.xml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pom.xml b/pom.xml
index 60c81ff..6c1704a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -98,9 +98,9 @@
 UTF-8
 1.8
 
-4.3.20.RELEASE
+4.3.24.RELEASE
 3.2.10
-7.0
+7.1
 3.0.8
 1.0.7
 2.11.1
@@ -271,7 +271,7 @@
 
 
 
-
+
 
 
 



[struts] branch struts-2-5-x updated (f7b191f -> 632f19e)

2019-09-07 Thread yasserzamani
This is an automated email from the ASF dual-hosted git repository.

yasserzamani pushed a change to branch struts-2-5-x
in repository https://gitbox.apache.org/repos/asf/struts.git.


from f7b191f  WW-5033 - Update to latest versions for some Struts 2.5.x 
dependencies: (#362)
 new 50a1451  Fix typo in MultiselectInterceptor javadoc
 new 632f19e  WW-5038 Upgrades jackson-databind to version 2.9.9.3 plus 
upgrades jackson-core to 2.9.9

The 2 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:
 .../apache/struts2/interceptor/MultiselectInterceptor.java |  4 ++--
 pom.xml| 14 --
 2 files changed, 14 insertions(+), 4 deletions(-)



[struts] 02/02: WW-5038 Upgrades jackson-databind to version 2.9.9.3 plus upgrades jackson-core to 2.9.9

2019-09-07 Thread yasserzamani
This is an automated email from the ASF dual-hosted git repository.

yasserzamani pushed a commit to branch struts-2-5-x
in repository https://gitbox.apache.org/repos/asf/struts.git

commit 632f19eab32416168ad0e4611b9e130aaea4c2fa
Author: Lukasz Lenart 
AuthorDate: Fri Sep 6 12:45:12 2019 +0430

WW-5038 Upgrades jackson-databind to version 2.9.9.3
plus upgrades jackson-core to 2.9.9

(cherry picked from commit 8187006)
---
 pom.xml | 14 --
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index 2fff51b..bb2aef4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -104,6 +104,8 @@
 1.0.7
 2.11.2
 2.9.9
+
+2.9.9.3
 
 
 1.7
@@ -1080,14 +1082,22 @@
 
 com.fasterxml.jackson.core
 jackson-databind
-${jackson.version}
+${jackson-databind.version}
 
 
 com.fasterxml.jackson.dataformat
 jackson-dataformat-xml
 ${jackson.version}
 
-
+
+
+
+
+org.codehaus.woodstox
+stax2-api
+4.1
+
+
 
 
 javax.enterprise



[struts] 01/02: Fix typo in MultiselectInterceptor javadoc

2019-09-07 Thread yasserzamani
This is an automated email from the ASF dual-hosted git repository.

yasserzamani pushed a commit to branch struts-2-5-x
in repository https://gitbox.apache.org/repos/asf/struts.git

commit 50a145152d1af5513edd0aaa3eacf486e42bf3bb
Author: Sebastian Haas 
AuthorDate: Thu Aug 29 14:10:06 2019 +0430

Fix typo in MultiselectInterceptor javadoc

(cherry picked from commit dca0dd2)
---
 .../java/org/apache/struts2/interceptor/MultiselectInterceptor.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/core/src/main/java/org/apache/struts2/interceptor/MultiselectInterceptor.java 
b/core/src/main/java/org/apache/struts2/interceptor/MultiselectInterceptor.java
index 64cab74..b11c3b7 100644
--- 
a/core/src/main/java/org/apache/struts2/interceptor/MultiselectInterceptor.java
+++ 
b/core/src/main/java/org/apache/struts2/interceptor/MultiselectInterceptor.java
@@ -29,7 +29,7 @@ import java.util.Map;
 /**
  * Just as the CheckboxInterceptor checks that if only the hidden field is 
present, so too does this interceptor. If
  * the "__multiselect_" request parameter is present and its visible 
counterpart is not, set a new request parameter to an
- * empty Sting.
+ * empty String.
  */
 public class MultiselectInterceptor extends AbstractInterceptor {
 private static final long serialVersionUID = 1L;
@@ -37,7 +37,7 @@ public class MultiselectInterceptor extends 
AbstractInterceptor {
 /**
  * Just as the CheckboxInterceptor checks that if only the hidden field is 
present, so too does this interceptor.
  * If the "__multiselect_" request parameter is present and its visible 
counterpart is not, set a new request parameter
- * to an empty Sting.
+ * to an empty String.
  *
  * @param ai ActionInvocation
  * @return the result of the action