gitgabrio commented on code in PR #6537:
URL:
https://github.com/apache/incubator-kie-drools/pull/6537#discussion_r2571169963
##########
kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/runtime/impl/RangeImpl.java:
##########
@@ -151,41 +148,58 @@ private Boolean posInfRangeIncludes(FEELDialect
feelDialect, Object param) {
private Boolean negInfRangeIncludes(FEELDialect feelDialect, Object param)
{
if (highBoundary == RangeBoundary.OPEN) {
- return compare(feelDialect, highEndPoint, param, (l, r) ->
l.compareTo(r) > 0);
+ return compare(feelDialect, highEndPoint, param, (l, r) ->
l.compareTo(r) > 0);
} else {
- return compare(feelDialect, highEndPoint, param, (l, r) ->
l.compareTo(r) >= 0);
+ return compare(feelDialect, highEndPoint, param, (l, r) ->
l.compareTo(r) >= 0);
}
}
-
+
private Boolean bothOrThrow(Boolean left, Boolean right, Object param) {
if (left == null || right == null) {
- throw new
IllegalArgumentException("Range.include("+classOf(param)+") not comparable with
"+classOf(lowEndPoint)+", "+classOf(highEndPoint));
+ throw new IllegalArgumentException("Range.include(" +
classOf(param) + ") not comparable with " + classOf(lowEndPoint) + ", " +
classOf(highEndPoint));
}
return left && right;
}
-
+
private static String classOf(Object p) {
return p != null ? p.getClass().toString() : "null";
}
-
+
private static Boolean compare(FEELDialect feelDialect, Comparable left,
Object right, BiPredicate<Comparable, Comparable> op) {
if (left.getClass().isAssignableFrom(right.getClass())) { // short path
- return op.test(left, (Comparable) right);
+ return op.test(left, (Comparable) right);
+ }
+ // TODO to be removed
+ //return BooleanEvalHelper.compare(left, right, feelDialect, op); //
defer to full DMN/FEEL semantic
+ if (feelDialect == FEELDialect.BFEEL) {
Review Comment:
I'm not sure if this is stil WIP, but since there is an FEELDialect
dependant `if`, I think this block should be managed inside the FEELHandlers:
wdyt ?
--
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]