gitgabrio commented on issue #1744: URL: https://github.com/apache/incubator-kie-issues/issues/1744#issuecomment-2612941262
I made modification in my own branch, and I have fixed some use cases. Anyway, a new issue arise, namely Expression `= null` [Test](https://github.com/apache/incubator-kie-drools/blob/afde3730d2b6dae20dfc8b9090c1525fc3fdb3c6/kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNDecisionTableRuntimeTest.java#L683) ` context.set("in1", null);` Currently, the expression is [converted](https://github.com/apache/incubator-kie-drools/blob/afde3730d2b6dae20dfc8b9090c1525fc3fdb3c6/kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/parser/feel11/ASTBuilderVisitor.java#L184) to `UnaryTestNode` Then, at execution, the [utEqualSemantic](https://github.com/apache/incubator-kie-drools/blob/afde3730d2b6dae20dfc8b9090c1525fc3fdb3c6/kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/lang/ast/UnaryTestNode.java#L156) method is invoked, that does not check if the right object is ´null´ (as in this case) so it returns `true` (because both left and right are `null`) With my modification, `= null` is translated to Range, but then the [createInUnaryTest](https://github.com/apache/incubator-kie-drools/blob/afde3730d2b6dae20dfc8b9090c1525fc3fdb3c6/kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/lang/ast/UnaryTestNode.java#L180) method is invoked. In that case, if the input is null (as in the current test) the method immediately returns `false`, and the test fails. BEside, if it change the input to something different then `null`, then the [RangeImpl.includes](https://github.com/apache/incubator-kie-drools/blob/afde3730d2b6dae20dfc8b9090c1525fc3fdb3c6/kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/runtime/impl/RangeImpl.java#L75) method is invoked, that returns `null` if the parameter is `null`. So, on one side it is not clear if `= null` should be translated to [null .. null] or [undefined .. undefined]; on the other side, we should review the behavior of UnaryTestNode.createInUnaryTest when the input is null (I don't know why it is different then utEqualSemantic @baldimir @yesamer -- 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]
