Rikkola commented on code in PR #6584:
URL:
https://github.com/apache/incubator-kie-drools/pull/6584#discussion_r2772998149
##########
drools-core/src/main/java/org/drools/core/reteoo/CompositeLeftTupleSinkAdapter.java:
##########
@@ -67,10 +78,16 @@ public LeftTupleSink[] getSinks() {
return sinkArray;
}
- LeftTupleSink[] sinks = new LeftTupleSink[this.sinks.size()];
+ // Count actual nodes in case of list inconsistency (BiLinear shared
nodes)
+ int actualCount = 0;
+ for ( LeftTupleSinkNode sink = this.sinks.getFirst(); sink != null;
sink = sink.getNextLeftTupleSinkNode() ) {
+ actualCount++;
+ }
+
+ LeftTupleSink[] sinks = new LeftTupleSink[actualCount];
int i = 0;
- for ( LeftTupleSinkNode sink = this.sinks.getFirst(); sink != null;
sink = sink.getNextLeftTupleSinkNode() ) {
+ for ( LeftTupleSinkNode sink = this.sinks.getFirst(); sink != null &&
i < actualCount; sink = sink.getNextLeftTupleSinkNode() ) {
sinks[i++] = sink;
}
Review Comment:
Not really an issue.
--
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]