]
RH Bugzilla Integration commented on DROOLS-1007:
-------------------------------------------------
Ryan Zhang <rzhang(a)redhat.com> changed the Status of [bug
ArrayIndexOutOfBoundsException attempting to remove a rule containing
a OR
--------------------------------------------------------------------------
Key: DROOLS-1007
URL:
https://issues.jboss.org/browse/DROOLS-1007
Project: Drools
Issue Type: Bug
Reporter: Mario Fusco
Assignee: Mario Fusco
Fix For: 6.4.0.Beta1
At the moment the association between a node and a rule is kept by a Map inside the node
having the rule as key. This implementation is not taking count of the fact that the same
node could be associated multiple times to the same rule that it is indeed what happens
when a rule contains a OR.
During the removal of such a rule the nodes of the rule are removed from the Rete
starting from the RuleTerminalNodes (in this case the rule has more than one RTNs because
of the OR). This means that when the first RTN is removed the Join and LIA nodes that are
sources for that RTN at any level got completely disassociated from the rule when it is
too early. That in the end causes the following exception when the engine tries to remove
also the second RTN of that rule
{code}
java.lang.ArrayIndexOutOfBoundsException: 1
at org.drools.core.phreak.AddRemoveRule.removeRule(AddRemoveRule.java:171)
at org.drools.core.reteoo.ReteooBuilder.removeTerminalNode(ReteooBuilder.java:173)
at org.drools.core.reteoo.ReteooBuilder.removeRule(ReteooBuilder.java:163)
at org.drools.core.impl.KnowledgeBaseImpl.removeRule(KnowledgeBaseImpl.java:1635)
at org.drools.core.impl.KnowledgeBaseImpl.removeRule(KnowledgeBaseImpl.java:1626)
at
org.drools.core.impl.KnowledgeBaseImpl.internalRemoveRule(KnowledgeBaseImpl.java:1610)
at org.drools.core.impl.KnowledgeBaseImpl.removeRule(KnowledgeBaseImpl.java:1581)
{code}