ChinchuAjith commented on code in PR #6770:
URL: 
https://github.com/apache/incubator-kie-drools/pull/6770#discussion_r3489713531


##########
kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/lang/ast/dialectHandlers/BFEELDialectHandler.java:
##########
@@ -315,50 +289,33 @@ public Map<CheckedPredicate, BiFunction<Object, Object, 
Object>> getLteOperation
                             : null;
 
                     if (less == null && equal == null) {
-                        return Boolean.FALSE; // BFEEL default
+                        return Boolean.FALSE; // BFEEL default for 
incompatible types
                     }
                     if (Boolean.TRUE.equals(less) || 
Boolean.TRUE.equals(equal)) {
                         return Boolean.TRUE;
                     }
                     return Boolean.FALSE;
                 });
-
-        map.putAll(getCommonLteOperations(ctx));
         return map;
     }
 
     @Override
     public Map<CheckedPredicate, BiFunction<Object, Object, Object>> 
getLtOperations(EvaluationContext ctx) {
         Map<CheckedPredicate, BiFunction<Object, Object, Object>> map = new 
LinkedHashMap<>();
 
-        // Non-Boolean coerces to false, so (false,false) --> false
+        // BFEEL: null returns FALSE (not null like standard FEEL)
         map.put(
-                new CheckedPredicate((left, right) -> {
-                    Boolean leftBool = (left instanceof Boolean) ? (Boolean) 
left : Boolean.FALSE;
-                    Object rightValue = evalRight(right, ctx);
-                    Boolean rightBool = (rightValue instanceof Boolean) ? 
(Boolean) rightValue : Boolean.FALSE;
-                    return Boolean.FALSE.equals(leftBool) && 
Boolean.FALSE.equals(rightBool);
-                }, false),
+                new CheckedPredicate((left, right) -> left == null || right == 
null, false),
                 (left, right) -> Boolean.FALSE);
 
-        // General non-Boolean coercion to false
-        map.put(
-                new CheckedPredicate((left, right) -> (!(left instanceof 
Boolean) || !(right instanceof Boolean)), false),
-                (left, right) -> {
-                    Boolean leftBool = (left instanceof Boolean) ? (Boolean) 
left : Boolean.FALSE;
-                    Boolean rightBool = (right instanceof Boolean) ? (Boolean) 
right : Boolean.FALSE;
-                    return leftBool || rightBool;
-                });
-
-        // Numeric/comparable < logic
+        // BFEEL: All other comparisons (numeric, dates, strings, Booleans, 
etc.)
         map.put(
                 new CheckedPredicate((left, right) -> true, false),
                 (left, right) -> {
                     Boolean less = compare(left, right,
                             (l, r) -> l.compareTo(r) < 0);
                     return Objects.requireNonNullElse(less, Boolean.FALSE);
                 });

Review Comment:
   Resolved



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to