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

jleroux 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 dc8d6d5  Fixed: Fix some bugs Spotbugs reports (OFBIZ-12386)
dc8d6d5 is described below

commit dc8d6d504a87ed47ac12f705b8224e465edc7637
Author: Jacques Le Roux <jacques.le.r...@les7arts.com>
AuthorDate: Wed Nov 17 15:49:18 2021 +0100

    Fixed: Fix some bugs Spotbugs reports (OFBIZ-12386)
    
    In ternary operator post increment does not work, pre increment does
    
    Thanks: Spotbugs
---
 .../org/apache/ofbiz/minilang/method/entityops/EntityCount.java     | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/EntityCount.java
 
b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/EntityCount.java
index 19ba0bb..375a288 100644
--- 
a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/EntityCount.java
+++ 
b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/EntityCount.java
@@ -64,11 +64,11 @@ public final class EntityCount extends EntityOperation {
         this.countFma = 
FlexibleMapAccessor.getInstance(element.getAttribute("count-field"));
         int conditionElementCount = 0;
         Element conditionExprElement = UtilXml.firstChildElement(element, 
"condition-expr");
-        conditionElementCount = conditionExprElement == null ? 
conditionElementCount : conditionElementCount++;
+        conditionElementCount = conditionExprElement == null ? 
conditionElementCount : ++conditionElementCount;
         Element conditionListElement = UtilXml.firstChildElement(element, 
"condition-list");
-        conditionElementCount = conditionListElement == null ? 
conditionElementCount : conditionElementCount++;
+        conditionElementCount = conditionListElement == null ? 
conditionElementCount : ++conditionElementCount;
         Element conditionObjectElement = UtilXml.firstChildElement(element, 
"condition-object");
-        conditionElementCount = conditionObjectElement == null ? 
conditionElementCount : conditionElementCount++;
+        conditionElementCount = conditionObjectElement == null ? 
conditionElementCount : ++conditionElementCount;
         if (conditionElementCount > 1) {
             MiniLangValidate.handleError("Element must include only one 
condition child element", simpleMethod, conditionObjectElement);
         }

Reply via email to