For the previous java.lang.ArrayIndexOutOfBoundsException, would the
following code change fix them correctly? would there be any other impact ?
org.drools.common.SingleBetaConstraints
/* (non-Javadoc)
* @see
org.drools.common.BetaNodeConstraints#updateFromTuple(org.drools.reteoo.ReteTuple)
*/
public void updateFromTuple(final ContextEntry[] context,
final InternalWorkingMemory workingMemory,
final LeftTuple tuple) {
// Check if context has any elements
// If (... ) added
if (context != null && context.length > 0)
{
context[0].updateFromTuple( workingMemory,
tuple );
}
}
org.drools.reteoo.FromNode
- checkConstraintsAndPropagate
for ( int i = 0, length = this.alphaConstraints.length; i <
length; i++ ) {
// Check memory.alphaContexts size before accessing ith
element
// If (... ) added
if (memory.alphaContexts != null &&
memory.alphaContexts.length > i)
{
if ( !this.alphaConstraints[i].isAllowed(
rightTuple.getFactHandle(),
workingMemory,
memory.alphaContexts[i] ) ) {
// next iteration
isAllowed = false;
break;
}
}
}
--
View this message in context:
http://drools.46999.n3.nabble.com/threw-error-java-lang-ClassCastExceptio...
Sent from the Drools: User forum mailing list archive at
Nabble.com.