tkobayas commented on code in PR #7202:
URL: https://github.com/apache/incubator-kie/pull/7202#discussion_r4320545049
##########
drools-core/src/main/java/org/drools/core/RuleBaseConfiguration.java:
##########
@@ -642,6 +642,10 @@ public void setShareAlphaNodes(final boolean
shareAlphaNodes) {
}
public boolean isShareBetaNodes() {
+ // Beta node sharing in sequential mode causes NPE and incorrect
results (incubator-kie#7201)
+ if (this.sequential) {
+ return false;
+ }
return this.shareBetaNodes;
}
Review Comment:
The getter override is a deliberate choice — setting the field in the setter
introduces order-of-call sensitivity (a subsequent `setShareBetaNodes(true)`
would revert it) and would require tracking the original value to restore if
sequential mode is later disabled. The getter approach avoids both issues and
guarantees the correct effective value regardless of call order.
That said, you raised a fair point about internal consistency.
`getOption(ShareBetaNodesOption.class)` was reading the field directly, which
would report `YES` even in sequential mode. I've updated it to go through the
getter so the public API is consistent. Serialization also writes the raw
field, but sequential is serialized alongside it, so `isShareBetaNodes()`
returns the correct value after deserialization.
--
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]