sergehuber commented on code in PR #773:
URL: https://github.com/apache/unomi/pull/773#discussion_r3409095094


##########
plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/BooleanConditionEvaluator.java:
##########
@@ -36,13 +36,16 @@ public boolean eval(Condition condition, Item item, 
Map<String, Object> context,
         boolean isAnd = "and".equalsIgnoreCase((String) 
condition.getParameter("operator"));
         @SuppressWarnings("unchecked")
         List<Condition> conditions = (List<Condition>) 
condition.getParameter("subConditions");
+
+        if (conditions == null || conditions.isEmpty()) {
+            return true;
+        }

Review Comment:
   Good catch. An empty OR should return `false` (empty disjunction), not 
`true`. Fixed in bccb264: changed `return true` to `return isAnd`, which is the 
correct neutral element for both cases (vacuous truth for AND, false for empty 
OR). This was already the logic used at the end of the method; the early-return 
just had a copy/paste mistake.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to