hwu2024 commented on PR #6473:
URL: 
https://github.com/apache/incubator-kie-drools/pull/6473#issuecomment-3374883426

   Hi @tkobayas,
   
   Thanks for the updates and suggestions. 
   
   My original thought is that since the method `toSet()` is unordered and 
would discard the stream's encounter order, I would instead sort the upstream 
and put it in `LinkedHashSet` to ensure both steps preserve the order. 
   
   I have done some additional testing and found out that just using `toSet()` 
with `LinkedHashSet` will no longer produce any related error. In this case, 
would it be safer using `toCollection(LinkedHashSet::new)`, instead of using 
`toSet()` and wrapping it in `LinkedHashSet`, to ensure the deterministic order?
   
   And for the AST section using RHS order, I was thinking that streaming 
`existingDecls` directly may lead to the encounter order driven by 
`existingDecls` and thus lose the RHS order. I am wondering whether we do need 
that order in this case. 
   
   Thanks again for your time to 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