tkobayas opened a new issue, #6436:
URL: https://github.com/apache/incubator-kie-drools/issues/6436

   `SetEvaluatorsDefinition` and `MatchesEvaluatorsDefinition` don't seem to be 
used.
   
   
https://github.com/apache/incubator-kie-drools/blob/10.1.0/drools-mvel/src/main/java/org/drools/mvel/evaluators/SetEvaluatorsDefinition.java
   
   `SetEvaluatorsDefinition` has various inner classes that implement 
`BaseEvaluator`, so it seems to be used when some operators (e.g. `contains`, 
`memberOf`) are evaluated.
   
   However, when debugging `ContainsTest` or `MemberOfTest`, these classes are 
not used. In reality, MVEL supports `contains` by itself, so the constraint is 
evaluated directly by MVEL. `memberOf` is rewritten to `contains` + left/right 
operands inversion (See `DescDumper.processRestriction` 
https://github.com/apache/incubator-kie-drools/blob/10.1.0/drools-compiler/src/main/java/org/drools/compiler/lang/DescrDumper.java#L473-L484).
   
   `MVELConstraintBuilder.buildVariableConstraint` checks if the operator can 
be handled by MVEL 
https://github.com/apache/incubator-kie-drools/blob/main/drools-mvel/src/10.1.0/java/org/drools/mvel/MVELConstraintBuilder.java#L183
 . If yes, the expression will be passed to MVEL without `Evaluator`.
   
   `MVELConstraintBuilder.USE_MVEL_EXPRESSION` is a hard-coded switch to change 
the behavior, but it doesn't seem to be required.
   
   Probably MatchesEvaluatorsDefinition is not used in the similar way (`~=` is 
supported by MVEL).


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