pibizza commented on code in PR #6086:
URL: 
https://github.com/apache/incubator-kie-drools/pull/6086#discussion_r1762983241


##########
drools-model/drools-model-codegen/src/main/java/org/drools/model/codegen/execmodel/generator/drlxparse/CoercedExpression.java:
##########
@@ -151,9 +153,22 @@ public CoercedExpressionResult coerce() {
             coercedLeft = left;
         }
 
+        checkCoercion(coercedLeft, coercedRight, leftClass, rightClass);
         return new CoercedExpressionResult(coercedLeft, coercedRight, 
rightAsStaticField);
     }
 
+    private void checkCoercion(TypedExpression coercedLeft, TypedExpression 
coercedRight, Class<?> leftClass, Class<?> rightClass) {
+        if (equalityExpr) {

Review Comment:
   Since this is known at creation time you can inline the check and put 
instead a lambda inside the expression? so you would not repeat the check for 
every invocation of the cohercion. 



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