[jboss-jira] [JBoss JIRA] (DROOLS-1007) ArrayIndexOutOfBoundsException attempting to remove a rule containing a OR
Mario Fusco (JIRA)
issues at jboss.org
Tue Dec 15 07:52:00 EST 2015
Mario Fusco created DROOLS-1007:
-----------------------------------
Summary: 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
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}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
More information about the jboss-jira
mailing list