This is an automated email from the ASF dual-hosted git repository.
asf-gitbox-commits pushed a commit to branch release24.09
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
The following commit(s) were added to refs/heads/release24.09 by this push:
new 4ed7011a24 Ofbiz 13374 Fixed: incorrect Groovy range iteration that
was causing index out of bounds (#1177)
4ed7011a24 is described below
commit 4ed7011a243494c1a04e39a9d634ae897b48ace7
Author: Ankit-Joshi11 <[email protected]>
AuthorDate: Sun May 10 13:14:35 2026 +0530
Ofbiz 13374 Fixed: incorrect Groovy range iteration that was causing index
out of bounds (#1177)
Fixed: proper parenthesised based iteration to avoid precedence issue
that leads to invalid index access.
---------
Co-authored-by: Ankit Joshi <[email protected]>
Co-authored-by: Jacques Le Roux <[email protected]>
Thanks Ankit!
---
.../catalog/imagemanagement/ImageRecentlyApproved.groovy | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git
a/applications/product/src/main/groovy/org/apache/ofbiz/product/catalog/imagemanagement/ImageRecentlyApproved.groovy
b/applications/product/src/main/groovy/org/apache/ofbiz/product/catalog/imagemanagement/ImageRecentlyApproved.groovy
index 55e04bfdd1..8c71364842 100644
---
a/applications/product/src/main/groovy/org/apache/ofbiz/product/catalog/imagemanagement/ImageRecentlyApproved.groovy
+++
b/applications/product/src/main/groovy/org/apache/ofbiz/product/catalog/imagemanagement/ImageRecentlyApproved.groovy
@@ -18,15 +18,15 @@
*/
package org.apache.ofbiz.product.catalog.imagemanagement
-import org.apache.ofbiz.entity.GenericValue
-import org.apache.ofbiz.entity.condition.EntityCondition
-import org.apache.ofbiz.entity.condition.EntityOperator
-
import java.sql.Timestamp
import java.text.SimpleDateFormat
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
+import org.apache.ofbiz.entity.GenericValue
+import org.apache.ofbiz.entity.condition.EntityCondition
+import org.apache.ofbiz.entity.condition.EntityOperator
+
int limit = 13 // set number of days
DateTimeFormatter sdf = DateTimeFormatter.ofPattern('yyyy-MM-dd HH:mm:ss')
DateTimeFormatter sdf2 = DateTimeFormatter.ofPattern('EEEE dd/MM/yyyy', locale)
@@ -55,7 +55,7 @@ for (i in 0..limit) {
List time = []
if (tempTimeList.size > 0) {
- 0..tempTimeList.size - 1.each { j ->
+ (0..tempTimeList.size - 1).each { j ->
time.add(sdfTime.format(tempTimeList.get(j).get(0)))
}
}