This is an automated email from the ASF dual-hosted git repository.

pgil pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 19e02fea89 Fixed: Fix exception for createFuturePeriod Service 
(OFBIZ-12816)
19e02fea89 is described below

commit 19e02fea892219406329acddb781474730a85bc2
Author: Gil Portenseigne <gil.portensei...@nereide.fr>
AuthorDate: Fri May 5 15:53:25 2023 +0200

    Fixed: Fix exception for createFuturePeriod Service (OFBIZ-12816)
    
    Do not use `.hasNext()`, prefer to test with groovy truth the assignment of 
`.next()` value. If null, it ends the while loop.
---
 framework/common/groovyScripts/CommonServices.groovy | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/framework/common/groovyScripts/CommonServices.groovy 
b/framework/common/groovyScripts/CommonServices.groovy
index d8e0d01037..7b875df91d 100644
--- a/framework/common/groovyScripts/CommonServices.groovy
+++ b/framework/common/groovyScripts/CommonServices.groovy
@@ -351,8 +351,7 @@ Map createFuturePeriod() {
     grain = null
     intermediate = null
     parties = from('PartyAcctgPreference').where('enableAccounting', 
'Y').queryIterator()
-    while (parties.hasNext()) {
-        party = parties.next()
+    while (party = parties.next()) {
         parameters.organizationPartyId = party.partyId
         createCustomTimePeriod = from('SystemProperty')
                 .where('systemResourceId', 'general', 'systemPropertyId', 
'CustomTimePeriod.create').queryOne()

Reply via email to