[jboss-jira] [JBoss JIRA] Commented: (JBRULES-1173) java.lang.ArrayIndexOutOfBoundsException: 2 in file named "TupleIndexHashTable.java" in toArray() Method. I have fix and works fine.

Mark Proctor (JIRA) jira-events at lists.jboss.org
Wed Sep 5 20:12:11 EDT 2007


    [ http://jira.jboss.com/jira/browse/JBRULES-1173?page=comments#action_12375537 ] 
            
Mark Proctor commented on JBRULES-1173:
---------------------------------------

ok looking at hte code, seems you are fixing code in trunk, so obviously it's still broken :(
It's definitely suppose to be:
Entry[] result = new Entry[this.factSize];
and not:
Entry[] result = new Entry[this.size]; 

This is because factSize is the total number of facts in the system, size is just the number of buckets; obviously Entry[] result must be the same size as this.factSize.

I'm not entirely sure why this is needed:
index<result.length

In theory if this.factSize is the total number of facts, then entry.getNext() should never produce a result larger than result. I wonder if this is a zero index problem and I should have new Entry[this.factSize+1]

> java.lang.ArrayIndexOutOfBoundsException: 2 in file named "TupleIndexHashTable.java" in toArray() Method. I have fix and works fine.
> ------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: JBRULES-1173
>                 URL: http://jira.jboss.com/jira/browse/JBRULES-1173
>             Project: JBoss Rules
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: Reteoo
>    Affects Versions:  4.0.0.MR3
>         Environment: windows XP
>            Reporter: Nageshwar Kunichetty
>         Assigned To: Mark Proctor
>             Fix For:  4.0.0.MR3
>
>
> Sometimes while asserting specific facts I get the following exception in drools-core-4.0.0 :
> > java.lang.ArrayIndexOutOfBoundsException: 26
> >         at org.drools.util.TupleIndexHashTable.toArray(TupleIndexHashTable.java:178)
> >         at org.drools.reteoo.CollectNode.assertObject(CollectNode.java:212)
> >         at org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:317)
> >         at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:183)
> >         at org.drools.reteoo.Rete.assertObject(Rete.java:121)
> >         at org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:201)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list