You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by pg...@apache.org on 2023/05/05 13:53:48 UTC

[ofbiz-framework] branch trunk updated: Fixed: Fix exception for createFuturePeriod Service (OFBIZ-12816)

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 <gi...@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()