(struts) branch fix/WW-5360-iterator created (now 081c84bf6)

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

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


  at 081c84bf6 WW-5360 Introduces additional countStr & indexStr to allow 
to ignore conversion

This branch includes the following new commits:

 new 081c84bf6 WW-5360 Introduces additional countStr & indexStr to allow 
to ignore conversion

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) 01/01: WW-5360 Introduces additional countStr & indexStr to allow to ignore conversion

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

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

commit 081c84bf6094d36cfb371ee5b32e1770d6c3b365
Author: Lukasz Lenart 
AuthorDate: Sun Jan 21 10:39:49 2024 +0100

WW-5360 Introduces additional countStr & indexStr to allow to ignore 
conversion
---
 .../apache/struts2/views/jsp/IteratorStatus.java   |  20 ++-
 .../java/com/opensymphony/xwork2/test/User.java|   6 +
 .../test/java/org/apache/struts2/TestAction.java   |   9 +
 .../struts2/components/IteratorComponentTest.java  | 199 -
 .../apache/struts2/views/jsp/IteratorTagTest.java  |  86 -
 5 files changed, 262 insertions(+), 58 deletions(-)

diff --git 
a/core/src/main/java/org/apache/struts2/views/jsp/IteratorStatus.java 
b/core/src/main/java/org/apache/struts2/views/jsp/IteratorStatus.java
index 13022f856..fedef363e 100644
--- a/core/src/main/java/org/apache/struts2/views/jsp/IteratorStatus.java
+++ b/core/src/main/java/org/apache/struts2/views/jsp/IteratorStatus.java
@@ -26,23 +26,29 @@ package org.apache.struts2.views.jsp;
  * count: iterations so far, starts on 1. count is always index + 1
  * first: true if index == 0
  * even: true if (index + 1) % 2 == 0
- * last: true if current iteration is the last iteration 
+ * last: true if current iteration is the last iteration
  * odd: true if (index + 1) % 2 == 1
  * 
  * Example
  * 
  *   
  *  Index:  
- * Count:
+ * Index Str:
+ * Count:
+ * Count Str:
*
* - * + * * will print * * Index: 0 + * Index Str: 0 * Count: 1 + * Count Str: 1 * Index: 1 + * Index Str: 1 * Count: 2 + * Count Str: 2 * */ public class IteratorStatus { @@ -56,6 +62,10 @@ public class IteratorStatus { return state.index + 1; } +public String getCountStr() { +return String.valueOf(state.index + 1); +} + public boolean isEven() { return ((state.index + 1) % 2) == 0; } @@ -68,6 +78,10 @@ public class IteratorStatus { return state.index; } +public String getIndexStr() { +return String.valueOf(state.index); +} + public boolean isLast() { return state.last; } diff --git a/core/src/test/java/com/opensymphony/xwork2/test/User.java b/core/src/test/java/com/opensymphony/xwork2/test/User.java index d377fe018..e6c5d2af4 100644 --- a/core/src/test/java/com/opensymphony/xwork2/test/User.java +++ b/core/src/test/java/com/opensymphony/xwork2/test/User.java @@ -37,6 +37,12 @@ public class User implements UserMarker { private String email2; private String name; +public User() { +} + +public User(String name) { +this.name = name; +} public void setCollection(Collection collection) { this.collection = collection; diff --git a/core/src/test/java/org/apache/struts2/TestAction.java b/core/src/test/java/org/apache/struts2/TestAction.java index 77f784a61..b9595de11 100644 --- a/core/src/test/java/org/apache/struts2/TestAction.java +++ b/core/src/test/java/org/apache/struts2/TestAction.java @@ -45,6 +45,7 @@ public class TestAction extends ActionSupport { private String result; private User user; private String[] array; +private Object[] objectArray; private String[][] list; private List list2; private List list3; @@ -135,6 +136,14 @@ public class TestAction extends ActionSupport { this.array = array; } +public Object[] getObjectArray() { +return objectArray; +} + +public void setObjectArray(Object[] arrayObject) { +this.objectArray = arrayObject; +} + public String[][] getList() { return list; } diff --git a/core/src/test/java/org/apache/struts2/components/IteratorComponentTest.java b/core/src/test/java/org/apache/struts2/components/IteratorComponentTest.java index d6cc5305d..78dd5536a 100644 --- a/core/src/test/java/org/apache/struts2/components/IteratorComponentTest.java +++ b/core/src/test/java/org/apache/struts2/components/IteratorComponentTest.java @@ -19,16 +19,20 @@ package org.apache.struts2.components; import com.opensymphony.xwork2.ActionContext; +import com.opensymphony.xwork2.test.User; import com.opensymphony.xwork2.util.ValueStack; import org.apache.struts2.StrutsInternalTestCase; +import org.apache.struts2.TestAction; import java.io.StringWriter; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.Locale; public class IteratorComponentTest extends StrutsInternalTestCase

(struts) 01/01: WW-5360 Introduces additional countStr & indexStr to allow to ignore conversion

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

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

commit 455e7e91aeee49b206da427685ade656a55144c3
Author: Lukasz Lenart 
AuthorDate: Sun Jan 21 10:39:49 2024 +0100

WW-5360 Introduces additional countStr & indexStr to allow to ignore 
conversion
---
 .../apache/struts2/views/jsp/IteratorStatus.java   |  20 ++-
 .../java/com/opensymphony/xwork2/test/User.java|   6 +
 .../test/java/org/apache/struts2/TestAction.java   |   9 +
 .../struts2/components/IteratorComponentTest.java  | 199 -
 .../apache/struts2/views/jsp/IteratorTagTest.java  | 173 +++---
 5 files changed, 293 insertions(+), 114 deletions(-)

diff --git 
a/core/src/main/java/org/apache/struts2/views/jsp/IteratorStatus.java 
b/core/src/main/java/org/apache/struts2/views/jsp/IteratorStatus.java
index 13022f856..fedef363e 100644
--- a/core/src/main/java/org/apache/struts2/views/jsp/IteratorStatus.java
+++ b/core/src/main/java/org/apache/struts2/views/jsp/IteratorStatus.java
@@ -26,23 +26,29 @@ package org.apache.struts2.views.jsp;
  * count: iterations so far, starts on 1. count is always index + 1
  * first: true if index == 0
  * even: true if (index + 1) % 2 == 0
- * last: true if current iteration is the last iteration 
+ * last: true if current iteration is the last iteration
  * odd: true if (index + 1) % 2 == 1
  * 
  * Example
  * 
  *   
  *  Index:  
- * Count:
+ * Index Str:
+ * Count:
+ * Count Str:
*
* - * + * * will print * * Index: 0 + * Index Str: 0 * Count: 1 + * Count Str: 1 * Index: 1 + * Index Str: 1 * Count: 2 + * Count Str: 2 * */ public class IteratorStatus { @@ -56,6 +62,10 @@ public class IteratorStatus { return state.index + 1; } +public String getCountStr() { +return String.valueOf(state.index + 1); +} + public boolean isEven() { return ((state.index + 1) % 2) == 0; } @@ -68,6 +78,10 @@ public class IteratorStatus { return state.index; } +public String getIndexStr() { +return String.valueOf(state.index); +} + public boolean isLast() { return state.last; } diff --git a/core/src/test/java/com/opensymphony/xwork2/test/User.java b/core/src/test/java/com/opensymphony/xwork2/test/User.java index d377fe018..e6c5d2af4 100644 --- a/core/src/test/java/com/opensymphony/xwork2/test/User.java +++ b/core/src/test/java/com/opensymphony/xwork2/test/User.java @@ -37,6 +37,12 @@ public class User implements UserMarker { private String email2; private String name; +public User() { +} + +public User(String name) { +this.name = name; +} public void setCollection(Collection collection) { this.collection = collection; diff --git a/core/src/test/java/org/apache/struts2/TestAction.java b/core/src/test/java/org/apache/struts2/TestAction.java index 77f784a61..b9595de11 100644 --- a/core/src/test/java/org/apache/struts2/TestAction.java +++ b/core/src/test/java/org/apache/struts2/TestAction.java @@ -45,6 +45,7 @@ public class TestAction extends ActionSupport { private String result; private User user; private String[] array; +private Object[] objectArray; private String[][] list; private List list2; private List list3; @@ -135,6 +136,14 @@ public class TestAction extends ActionSupport { this.array = array; } +public Object[] getObjectArray() { +return objectArray; +} + +public void setObjectArray(Object[] arrayObject) { +this.objectArray = arrayObject; +} + public String[][] getList() { return list; } diff --git a/core/src/test/java/org/apache/struts2/components/IteratorComponentTest.java b/core/src/test/java/org/apache/struts2/components/IteratorComponentTest.java index d6cc5305d..78dd5536a 100644 --- a/core/src/test/java/org/apache/struts2/components/IteratorComponentTest.java +++ b/core/src/test/java/org/apache/struts2/components/IteratorComponentTest.java @@ -19,16 +19,20 @@ package org.apache.struts2.components; import com.opensymphony.xwork2.ActionContext; +import com.opensymphony.xwork2.test.User; import com.opensymphony.xwork2.util.ValueStack; import org.apache.struts2.StrutsInternalTestCase; +import org.apache.struts2.TestAction; import java.io.StringWriter; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.Locale; public class IteratorComponentTest extends StrutsIntern

(struts) branch fix/WW-5360-iterator updated (081c84bf6 -> 455e7e91a)

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

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


 discard 081c84bf6 WW-5360 Introduces additional countStr & indexStr to allow 
to ignore conversion
 new 455e7e91a WW-5360 Introduces additional countStr & indexStr to allow 
to ignore conversion

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   (081c84bf6)
\
 N -- N -- N   refs/heads/fix/WW-5360-iterator (455e7e91a)

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:
 .../apache/struts2/views/jsp/IteratorTagTest.java  | 87 --
 1 file changed, 31 insertions(+), 56 deletions(-)



(struts) branch master updated (a763071d2 -> 1e56b7ce6)

2024-01-21 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 a763071d2 Merge pull request #848 from apache/fix/WW-5357-disabled
 add 775febbdf Upgrade maven to 3.9.6 and wrapper to 3.2.0
 add 1e56b7ce6 Merge pull request #853 from 
sepe81/feature/upgrade-maven-to-3.9.6

No new revisions were added by this update.

Summary of changes:
 .mvn/wrapper/MavenWrapperDownloader.java | 117 -
 .mvn/wrapper/maven-wrapper.properties|   8 +-
 mvnw | 218 +++
 mvnw.cmd |  31 -
 pom.xml  |   7 +-
 5 files changed, 134 insertions(+), 247 deletions(-)
 delete mode 100644 .mvn/wrapper/MavenWrapperDownloader.java



(struts-examples) branch dependabot/github_actions/actions/cache-4.0.0 created (now 30d0419)

2024-01-21 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/cache-4.0.0
in repository https://gitbox.apache.org/repos/asf/struts-examples.git


  at 30d0419  Bump actions/cache from 3.3.2 to 4.0.0

No new revisions were added by this update.



(struts-examples) branch dependabot/github_actions/actions/cache-3.3.3 deleted (was b2386fe)

2024-01-21 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/cache-3.3.3
in repository https://gitbox.apache.org/repos/asf/struts-examples.git


 was b2386fe  Bump actions/cache from 3.3.2 to 3.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-examples) branch dependabot/maven/io.quarkus-quarkus-universe-bom-3.6.6 created (now 6e6eb2c)

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

github-bot pushed a change to branch 
dependabot/maven/io.quarkus-quarkus-universe-bom-3.6.6
in repository https://gitbox.apache.org/repos/asf/struts-examples.git


  at 6e6eb2c  Bump io.quarkus:quarkus-universe-bom from 3.6.4 to 3.6.6

No new revisions were added by this update.



(struts-examples) branch dependabot/maven/io.quarkus-quarkus-universe-bom-3.6.5 deleted (was dc05be3)

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

github-bot pushed a change to branch 
dependabot/maven/io.quarkus-quarkus-universe-bom-3.6.5
in repository https://gitbox.apache.org/repos/asf/struts-examples.git


 was dc05be3  Bump io.quarkus:quarkus-universe-bom from 3.6.4 to 3.6.5

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/github_actions/actions/upload-artifact-4.2.0 created (now cde86457a)

2024-01-21 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/upload-artifact-4.2.0
in repository https://gitbox.apache.org/repos/asf/struts.git


  at cde86457a Bump actions/upload-artifact from 4.1.0 to 4.2.0

No new revisions were added by this update.



(struts) branch dependabot/maven/spring.platformVersion-6.1.3 created (now 488b3840a)

2024-01-21 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.3
in repository https://gitbox.apache.org/repos/asf/struts.git


  at 488b3840a Bump spring.platformVersion from 5.3.27 to 6.1.3

No new revisions were added by this update.



(struts) branch dependabot/maven/spring.platformVersion-6.1.1 deleted (was f3cd67a94)

2024-01-21 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.1
in repository https://gitbox.apache.org/repos/asf/struts.git


 was f3cd67a94 Bump spring.platformVersion from 5.3.27 to 6.1.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 dependabot/maven/org.codehaus.plexus-plexus-container-default-2.1.1 created (now 394025bcc)

2024-01-21 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.codehaus.plexus-plexus-container-default-2.1.1
in repository https://gitbox.apache.org/repos/asf/struts.git


  at 394025bcc Bump org.codehaus.plexus:plexus-container-default

No new revisions were added by this update.



(struts) branch master updated (1e56b7ce6 -> ec18f0eef)

2024-01-21 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 1e56b7ce6 Merge pull request #853 from 
sepe81/feature/upgrade-maven-to-3.9.6
 add cde86457a Bump actions/upload-artifact from 4.1.0 to 4.2.0
 add ec18f0eef Merge pull request #855 from 
apache/dependabot/github_actions/actions/upload-artifact-4.2.0

No new revisions were added by this update.

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



(struts) branch dependabot/github_actions/actions/upload-artifact-4.2.0 deleted (was cde86457a)

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

lukaszlenart pushed a change to branch 
dependabot/github_actions/actions/upload-artifact-4.2.0
in repository https://gitbox.apache.org/repos/asf/struts.git


 was cde86457a Bump actions/upload-artifact from 4.1.0 to 4.2.0

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



Build failed in Jenkins: Struts ยป Struts-master-JDK8-dependency-check #200

2024-01-21 Thread Apache Jenkins Server
See 


Changes:

[Lukasz Lenart] WW-5362 Removes type attribute out of  tag

[github] Bump actions/upload-artifact from 3.1.3 to 4.0.0

[github] Bump org.apache.commons:commons-compress from 1.23.0 to 1.24.0

[github] WW-5362 Removes language attribute

[github] WW-5362 Removes deprecated language attribute

[git] WW-5378 Assorted refactor and clean up

[git] WW-5378 Add option to disable ValueStack context fallback

[git] WW-5379 Implement alternative mechanism for Velocity directives to obtain 
ValueStack

[git] WW-5379 Add support for internal and chained contexts

[git] WW-5379 Fix not looking in chained contexts' chained contexts

[git] WW-5381 Introduce RootAccessor interface for extension point

[git] WW-5381 Introduce extension point for CompoundRootAccessor

[git] WW-5381 Introduce extension point for MethodAccessor

[git] WW-5382 Fix StrutsInternalTestCase

[git] WW-5382 Fix stale injections in Dispatcher

[git] WW-5382 Fix stale bootstrap context on ActionContext

[github] Bump org.apache.commons:commons-compress from 1.23.0 to 1.25.0

[git] WW-5382 Rework existing Dispatcher tests and base test classes

[git] WW-5382 Add test for Dispatcher reinjection

[git] WW-5382 Delete redundant code

[git] WW-5382 Rework Dispatcher injections

[git] WW-5382 Update Dispatcher#getContainer JavaDoc

[git] WW-5364 Add String.class to system allowlist

[git] WW-5379 Use ValueStackProvider marker interface for Velocity context 
implementation flexibility

[git] WW-5352 Repackage ParametersInterceptor and related classes

[git] WW-5352 Fix SonarCloud logging warnings

[git] WW-5352 Move ParameterNameAware and ParameterValueAware

[git] WW-5352 Refactor ParametersInterceptor

[git] WW-5381 Revert bean removal for backwards compatibility

[git] WW-5381 Revert bean removals for backwards compatibility

[git] WW-5352 Gut deprecated interfaces

[Lukasz Lenart] WW-5383 Updates RegEx to excludes JARs by default

[git] WW-5352 Do not use setter notation for helper methods

[git] WW-5352 Rename acceptable name/value methods

[git] WW-5381 Reimplement ability to register additional MethodAccessors

[git] WW-5381 Remove unnecessary/confusing parameters

[Lukasz Lenart] Stops cleaning nightlies to allow to coexist different versions

[Lukasz Lenart] WW-5365 Reverts changes introduced in WW-5192 to allow evaluate 
the value attribute

[github] Bump org.apache.maven.plugins:maven-release-plugin

[Lukasz Lenart] Reduces log level to debug to reduce noise in the logs

[git] WW-5352 Clean up OgnlValueStackTest

[git] WW-5352 Move method to XWorkTestCase

[github] Bump actions/upload-artifact from 4.0.0 to 4.1.0

[Lukasz Lenart] WW-5387 Fixes remove() signature

[Lukasz Lenart] WW-5374 Allows to prepend reportUri with Servlet context

[Lukasz Lenart] WW-5369 Re-define minimal library set

[Lukasz Lenart] WW-5374 Uses @code instead of 

[Lukasz Lenart] WW-5374 Adds additional test case to cover disabling prepending 
context

[Lukasz Lenart] WW-5357 Adds support for disabled attribute to anchor tag

[Lukasz Lenart] Extends sleep period to avoid breaking a build

[Sebastian.Peters] Upgrade maven to 3.9.6 and wrapper to 3.2.0

[github] Bump actions/upload-artifact from 4.1.0 to 4.2.0


--
[...truncated 925.14 KB...]
   False Positives: 
https://jeremylong.github.io/DependencyCheck/general/suppression.html

๐Ÿ’– Sponsor: https://github.com/sponsors/jeremylong


[INFO] Analysis Started
[INFO] Finished File Name Analyzer (0 seconds)
[INFO] Finished Dependency Merging Analyzer (0 seconds)
[INFO] Finished Hint Analyzer (0 seconds)
[INFO] Finished Version Filter Analyzer (0 seconds)
[INFO] Created CPE Index (1 seconds)
[INFO] Finished CPE Analyzer (1 seconds)
[INFO] Finished False Positive Analyzer (0 seconds)
[INFO] Finished NVD CVE Analyzer (0 seconds)
[INFO] Finished Sonatype OSS Index Analyzer (0 seconds)
[INFO] Finished Vulnerability Suppression Analyzer (0 seconds)
[INFO] Finished Known Exploited Vulnerability Analyzer (0 seconds)
[INFO] Finished Dependency Bundling Analyzer (0 seconds)
[INFO] Finished Unused Suppression Rule Analyzer (0 seconds)
[INFO] Analysis Complete (1 seconds)
[INFO] Writing report to: 

[INFO] Cache event queue destroyed: {0}
[INFO] Cache event queue destroyed: {0}
[INFO] Cache event queue destroyed: {0}
[ERROR] {0}: Not alive and dispose was called, filename: {1}
[ERROR] {0}: Not alive and dispose was called, filename: {1}
[ERROR] {0}: Not alive and dispose was called, filename: {1}
[INFO] 
[INFO] --< org.apache.struts:struts2-plexus-plugin >---
[INFO] Building DEPRECATED: Struts 2 Plexus Plugin - since 6.0.0 6.4.0-SNAPSHOT 
[23/39]
[INFO]   from plugins/plexus/pom.xml
[INFO] 

(struts) branch fix/WW-5360-iterator updated (455e7e91a -> d258029cf)

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

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


omit 455e7e91a WW-5360 Introduces additional countStr & indexStr to allow 
to ignore conversion
 new d258029cf WW-5360 Introduces additional countStr & indexStr to allow 
to ignore conversion

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   (455e7e91a)
\
 N -- N -- N   refs/heads/fix/WW-5360-iterator (d258029cf)

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:
 .../apache/struts2/views/jsp/IteratorTagTest.java  | 32 --
 1 file changed, 29 insertions(+), 3 deletions(-)



(struts) 01/01: WW-5360 Introduces additional countStr & indexStr to allow to ignore conversion

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

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

commit d258029cf0b8dd0c92728a5c3e5e00d8d66a66d6
Author: Lukasz Lenart 
AuthorDate: Sun Jan 21 10:39:49 2024 +0100

WW-5360 Introduces additional countStr & indexStr to allow to ignore 
conversion
---
 .../apache/struts2/views/jsp/IteratorStatus.java   |  20 +-
 .../java/com/opensymphony/xwork2/test/User.java|   6 +
 .../test/java/org/apache/struts2/TestAction.java   |   9 +
 .../struts2/components/IteratorComponentTest.java  | 199 +++-
 .../apache/struts2/views/jsp/IteratorTagTest.java  | 205 ++---
 5 files changed, 322 insertions(+), 117 deletions(-)

diff --git 
a/core/src/main/java/org/apache/struts2/views/jsp/IteratorStatus.java 
b/core/src/main/java/org/apache/struts2/views/jsp/IteratorStatus.java
index 13022f856..fedef363e 100644
--- a/core/src/main/java/org/apache/struts2/views/jsp/IteratorStatus.java
+++ b/core/src/main/java/org/apache/struts2/views/jsp/IteratorStatus.java
@@ -26,23 +26,29 @@ package org.apache.struts2.views.jsp;
  * count: iterations so far, starts on 1. count is always index + 1
  * first: true if index == 0
  * even: true if (index + 1) % 2 == 0
- * last: true if current iteration is the last iteration 
+ * last: true if current iteration is the last iteration
  * odd: true if (index + 1) % 2 == 1
  * 
  * Example
  * 
  *   
  *  Index:  
- * Count:
+ * Index Str:
+ * Count:
+ * Count Str:
*
* - * + * * will print * * Index: 0 + * Index Str: 0 * Count: 1 + * Count Str: 1 * Index: 1 + * Index Str: 1 * Count: 2 + * Count Str: 2 * */ public class IteratorStatus { @@ -56,6 +62,10 @@ public class IteratorStatus { return state.index + 1; } +public String getCountStr() { +return String.valueOf(state.index + 1); +} + public boolean isEven() { return ((state.index + 1) % 2) == 0; } @@ -68,6 +78,10 @@ public class IteratorStatus { return state.index; } +public String getIndexStr() { +return String.valueOf(state.index); +} + public boolean isLast() { return state.last; } diff --git a/core/src/test/java/com/opensymphony/xwork2/test/User.java b/core/src/test/java/com/opensymphony/xwork2/test/User.java index d377fe018..e6c5d2af4 100644 --- a/core/src/test/java/com/opensymphony/xwork2/test/User.java +++ b/core/src/test/java/com/opensymphony/xwork2/test/User.java @@ -37,6 +37,12 @@ public class User implements UserMarker { private String email2; private String name; +public User() { +} + +public User(String name) { +this.name = name; +} public void setCollection(Collection collection) { this.collection = collection; diff --git a/core/src/test/java/org/apache/struts2/TestAction.java b/core/src/test/java/org/apache/struts2/TestAction.java index 77f784a61..b9595de11 100644 --- a/core/src/test/java/org/apache/struts2/TestAction.java +++ b/core/src/test/java/org/apache/struts2/TestAction.java @@ -45,6 +45,7 @@ public class TestAction extends ActionSupport { private String result; private User user; private String[] array; +private Object[] objectArray; private String[][] list; private List list2; private List list3; @@ -135,6 +136,14 @@ public class TestAction extends ActionSupport { this.array = array; } +public Object[] getObjectArray() { +return objectArray; +} + +public void setObjectArray(Object[] arrayObject) { +this.objectArray = arrayObject; +} + public String[][] getList() { return list; } diff --git a/core/src/test/java/org/apache/struts2/components/IteratorComponentTest.java b/core/src/test/java/org/apache/struts2/components/IteratorComponentTest.java index d6cc5305d..78dd5536a 100644 --- a/core/src/test/java/org/apache/struts2/components/IteratorComponentTest.java +++ b/core/src/test/java/org/apache/struts2/components/IteratorComponentTest.java @@ -19,16 +19,20 @@ package org.apache.struts2.components; import com.opensymphony.xwork2.ActionContext; +import com.opensymphony.xwork2.test.User; import com.opensymphony.xwork2.util.ValueStack; import org.apache.struts2.StrutsInternalTestCase; +import org.apache.struts2.TestAction; import java.io.StringWriter; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.Locale; public class IteratorComponentTest extends StrutsInter