mariofusco commented on code in PR #5618:
URL: 
https://github.com/apache/incubator-kie-drools/pull/5618#discussion_r1422165075


##########
drools-model/drools-model-codegen/src/main/java/org/drools/model/codegen/execmodel/generator/expressiontyper/ExpressionTyper.java:
##########
@@ -801,7 +806,15 @@ private TypedExpressionCursor binaryExpr(BinaryExpr 
binaryExpr) {
         TypedExpression rightTypedExpression = right.getTypedExpression()
                                                     .orElseThrow(() -> new 
NoSuchElementException("TypedExpressionResult doesn't contain 
TypedExpression!"));
         binaryExpr.setRight(rightTypedExpression.getExpression());
-        return new TypedExpressionCursor(binaryExpr, 
getBinaryType(leftTypedExpression, rightTypedExpression, 
binaryExpr.getOperator()));
+        java.lang.reflect.Type binaryType = getBinaryType(leftTypedExpression, 
rightTypedExpression, binaryExpr.getOperator());
+        if (isArithmeticOperator(binaryExpr.getOperator()) && 
binaryType.equals(BigDecimal.class)) {
+            ConstraintCompiler constraintCompiler = 
createConstraintCompiler(ruleContext, 
leftTypedExpression.getOriginalPatternType());

Review Comment:
   What this code does, and more important why, is not immediately evident at a 
first glance. Please add a comment or even better encapsulate the code in this 
if block into a private method with an understandable name. 



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