tkobayas commented on PR #6473:
URL:
https://github.com/apache/incubator-kie-drools/pull/6473#issuecomment-3364947901
Thank you for reporting. @hwu2024
So there are 2 places which iterate the HashSet. Practically, the same JVM
results in the same order, so we haven't seen the compilation error so far, but
it's not guaranteed in the future. So this PR.
The order in `D.on()`
```java
private MethodCallExpr onCall(Collection<String> usedArguments) {
MethodCallExpr onCall = null;
if (!usedArguments.isEmpty()) {
onCall = createDslTopLevelMethod(ON_CALL);
usedArguments.stream().map(context::getVar).forEach(onCall::addArgument);
}
return onCall;
}
```
The order in `LambdaConsequence.execute()`
```java
public NodeList<Parameter> getParametersForPrototype(Collection<String>
declarationUsedInRHS, BlockStmt methodBody) {
NodeList<Parameter> parameters = NodeList.nodeList();
for (String parameterName : declarationUsedInRHS) {
DeclarationSpec declaration =
context.getDeclarationByIdWithException(parameterName);
Parameter boxedParameter = declaration instanceof
TypedDeclarationSpec tSpec ?
getTypedParameter(methodBody, parameterName, tSpec) :
new
Parameter(toClassOrInterfaceType(PrototypeFactInstance.class), parameterName);
parameters.add(boxedParameter);
}
return parameters;
}
```
@mariofusco If I correctly remember, you had a similar PR in the past and
you rejected it (I cannot find it though). WDYT this time? (The actual PR
implementation aside ... I guess no need to sort, just using List would be
enough)
--
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]