everbrightw commented on PR #6119:
URL: 
https://github.com/apache/incubator-kie-drools/pull/6119#issuecomment-2411467310

   Hi @mariofusco,
   
   Thank you for taking the time to review and for your feedback. 
   
   I’d like to provide more context on my exploration of the codebase. Since 
this is my first time exploring this project, please bear with me if I am 
misunderstanding anything.
   
   From my understanding, the `usedDeclarationInRHS` set is iterated over in 
two key places in the codebase:
   
   1. It is used to construct the `MethodCallExpr` in 
`onCall(Collection<String> usedArguments)` by iterating at 
[line](https://github.com/apache/incubator-kie-drools/blob/9711a149672bc6721288e9ec16374a5b42d4a97e/drools-model/drools-model-codegen/src/main/java/org/drools/model/codegen/execmodel/generator/Consequence.java#L305)
 over the `HashSet` 
   
   2. Then, during `executeCall()`,  parameters are added to a NodeList by 
iterating over the same HashSet `declarationUsedInRHS`. The order of parameters 
can affect method signatures and variable bindings.  
[Consequence.java#L291](https://github.com/apache/incubator-kie-drools/blob/9711a149672bc6721288e9ec16374a5b42d4a97e/drools-model/drools-model-codegen/src/main/java/org/drools/model/codegen/execmodel/generator/Consequence.java#L291)
 which calls 
[getBoxedParametersWithUnboxedAssignment](https://github.com/apache/incubator-kie-drools/blob/9711a149672bc6721288e9ec16374a5b42d4a97e/drools-model/drools-model-codegen/src/main/java/org/drools/model/codegen/execmodel/generator/BoxedParameters.java#L45)
   
   And from my exploration while running the test case, the order that are 
being passed to `D.on(var_result,var_$eSet)` could be both `(result, $eSet)` 
and `($eSet, result)`, which leads to the above compilation error message.
   
   Based on my understanding, iteration order in a HashSet is inconsistent in 
the same session itself , even within the same VM and even if the HashSet's 
contents aren't modified. 
   
   Thank you again for your time to read through this follow up. 
   
   
   
   


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