Permalink
Browse files

JBRULES-2762 ArrayIndexOutOfBoundsException in org.drools.core.util.A…

…bstractHashTable
  • Loading branch information...
1 parent d5a51fd commit e48ff3382f88cf67c70eaafa7478d01a839accac @mdproctor mdproctor committed with etirelli Apr 20, 2011
@@ -197,7 +197,7 @@ public RuleConditionElement build( RuleBuildContext context,
DrlExprParser parser = new DrlExprParser();
ConstraintConnectiveDescr result = parser.parse( expression );
- if ( parser.hasErrors() ) {
+ if ( result == null || parser.hasErrors() ) {
for ( DroolsParserException error : parser.getErrors() ) {
context.getErrors().add( new DescrBuildError( context.getParentDescr(),
descr,
@@ -355,7 +355,7 @@ public void build( RuleBuildContext context,
ExprConstraintDescr descr ) {
DrlExprParser parser = new DrlExprParser();
ConstraintConnectiveDescr result = parser.parse( descr.getText() );
- if ( parser.hasErrors() ) {
+ if ( result == null || parser.hasErrors() ) {
for ( DroolsParserException error : parser.getErrors() ) {
context.getErrors().add( new DescrBuildError( context.getParentDescr(),
descr,
@@ -309,67 +309,23 @@ public Object next() {
}
// if no entry keep skipping rows until we come to the end, or find one that is populated
- while ( this.entry == null && ++this.row < this.length ){
+ while ( this.entry == null && this.row < this.length ){
this.entry = this.table[this.row];
+ this.row++;
}
return this.entry;
}
- // /* (non-Javadoc)
- // * @see org.drools.util.Iterator#next()
- // */
- // public Object next() {
- // if ( this.entry == null ) {
- // // keep skipping rows until we come to the end, or find one that is populated
- // while ( this.entry == null ) {
- // this.row++;
- // if ( this.row == this.length ) {
- // return null;
- // }
- // this.entry = this.table[this.row];
- // }
- // } else {
- // this.entry = this.entry.getNext();
- // if ( this.entry == null ) {
- // this.entry = (Entry) next();
- // }
- // }
- //
- // return this.entry;
- // }
-
- // /* (non-Javadoc)
- // * @see org.drools.util.Iterator#next()
- // */
- // public Object next() {
- // if ( this.entry == null ) {
- // // keep skipping rows until we come to the end, or find one that is populated
- // while ( this.entry == null ) {
- // this.row++;
- // if ( this.row == this.length ) {
- // return null;
- // }
- // this.entry = this.table[this.row];
- // }
- // } else {
- // this.entry = this.entry.getNext();
- // if ( this.entry == null ) {
- // this.entry = (Entry) next();
- // }
- // }
- //
- // return this.entry;
- // }
/* (non-Javadoc)
* @see org.drools.util.Iterator#reset()
*/
public void reset() {
this.table = this.hashTable.getTable();
this.length = this.table.length;
- this.row = -1;
this.entry = null;
+ this.row = 0;
}
}
@@ -270,10 +270,6 @@ public Object next() {
return null;
}
- public void remove() {
- throw new UnsupportedOperationException( "FieldIndexHashTableFullIterator does not support remove()." );
- }
-
/* (non-Javadoc)
* @see org.drools.util.Iterator#reset()
*/

0 comments on commit e48ff33

Please sign in to comment.