tkobayas commented on PR #6473:
URL:
https://github.com/apache/incubator-kie-drools/pull/6473#issuecomment-3370627149
Hi @hwu2024 ,
I wonder if sort is required. I guess just using `LinkedHashSet` is enough.
Am I missing something?
```
if (context.getRuleDialect() == RuleContext.RuleDialect.MVEL) {
return new LinkedHashSet<>(existingDecls.stream().filter(d ->
containsWord(d, consequenceString)).collect(toSet()));
} else if (ruleConsequence != null) {
Set<String> declUsedInRHS =
ruleConsequence.findAll(NameExpr.class).stream().map(NameExpr::getNameAsString).collect(toSet());
return new
LinkedHashSet<>(existingDecls.stream().filter(declUsedInRHS::contains).collect(toSet()));
}
```
--
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]