Rikkola opened a new pull request, #6760:
URL: https://github.com/apache/incubator-kie-drools/pull/6760
An executable-model rule with a top-level or(...) whose branch is a negated
join (and(not(x), y)) and a later pattern carrying a temporal after()
constraint threw an NPE during evaluation:
ConstraintEvaluationException: Error evaluating constraint '' ... in more
rules
Caused by NullPointerException:
Cannot invoke "TupleImpl.getIndex()" because "entry" is null
When the LHS OR is expanded into per-branch subrules, the shared trailing
elements are cloned and each clone's declarations are rebound to its own
subrule's patterns (replaceDeclaration reassigns an array slot).
TemporalConstraintEvaluator.clone() shared the declarations array by reference,
so one subrule's rebinding clobbered the others, leaving a temporal beta
pointing at a sibling branch's pattern tuple index -- an index absent from this
branch's shorter tuple, causing the NPE in TupleImpl.get. (DRL is unaffected:
its parser expands disjunctions before compilation.)
Copy the array (shallow) so each clone rebinds independently. A deep clone
via getClonedDeclarations() regresses the NamedConsequence path, whose clones
are not re-bound and rely on the original Declaration objects.
Adds OrNegatedJoinAfterReproTest (minimal repro + two controls). Verified:
model-compiler suite green; CEP/subnetwork/accumulate blast-radius 519/0/0.
Closes apache/incubator-kie-issues#2344
--
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]