Buggy code:
public class SimpleContentModel implements XMLContentModel { private QName fFirstChild = new QName ( ) ; private QName fSecondChild = new QName ( ) ; private int fOp ; private boolean fDTD ; private SubstitutionGroupComparator comparator = null ; public SimpleContentModel ( QName firstChild , QName secondChild , int cmOp ) { } public SimpleContentModel ( QName firstChild , QName secondChild , int cmOp , boolean dtd ) { } public void checkUniqueParticleAttribution ( SchemaGrammar gram ) throws Exception { } public int validateContent ( QName [ ] children , int offset , int length ) throws Exception { } public int validateContentSpecial ( QName [ ] children , int offset , int length ) throws Exception { } public void setSubstitutionGroupComparator ( SubstitutionGroupComparator comparator ) { } public int whatCanGoHere ( boolean fullyValid , InsertableElementsInfo info ) throws Exception { <START_BUG> for ( int index = info . insertAt ; index < ( info . childCount ) ; index ++ ) { <END_BUG> info . curChildren [ index ] . setValues ( info . curChildren [ ( index + 1 ) ] ) ; } ( info . childCount ) -- ; final int failedIndex = validateContent ( info . curChildren , 0 , info . childCount ) ; if ( ( failedIndex != ( - 1 ) ) && ( failedIndex < ( info . insertAt ) ) ) return failedIndex ; info . canHoldPCData = false ; if ( ( ( ( ( fOp ) == ( XMLContentSpec . CONTENTSPECNODE_LEAF ) ) || ( ( fOp ) == ( XMLContentSpec . CONTENTSPECNODE_ZERO_OR_ONE ) ) ) || ( ( fOp ) == ( XMLContentSpec . CONTENTSPECNODE_ZERO_OR_MORE ) ) ) || ( ( fOp ) == ( XMLContentSpec . CONTENTSPECNODE_ONE_OR_MORE ) ) ) { info . resultsCount = 1 ; } else if ( ( ( fOp ) == ( XMLContentSpec . CONTENTSPECNODE_CHOICE ) ) || ( ( fOp ) == ( XMLContentSpec . CONTENTSPECNODE_SEQ ) ) ) { info . resultsCount = 2 ; } else { throw new CMException ( ImplementationMessages . VAL_CST ) ; } if ( ( ( info . results ) == null ) || ( ( info . results . length ) < ( info . resultsCount ) ) ) info . results = new boolean [ info . resultsCount ] ; if ( ( ( info . possibleChildren ) == null ) || ( ( info . possibleChildren . length ) < ( info . resultsCount ) ) ) { info . possibleChildren = new QName [ info . resultsCount ] ; for ( int i = 0 ; i < ( info . possibleChildren . length ) ; i ++ ) { info . possibleChildren [ i ] = new QName ( ) ; } } info . possibleChildren [ 0 ] . setValues ( fFirstChild ) ; info . results [ 0 ] = false ; if ( ( info . resultsCount ) == 2 ) { info . possibleChildren [ 1 ] . setValues ( fSecondChild ) ; info . results [ 1 ] = false ; } info . isValidEOC = false ; switch ( fOp ) { case XMLContentSpec . CONTENTSPECNODE_LEAF : case XMLContentSpec . CONTENTSPECNODE_ZERO_OR_ONE : if ( ( info . childCount ) == 0 ) { info . results [ 0 ] = true ; } else if ( ( info . childCount ) > 0 ) { if ( ( ! fullyValid ) && ( ( info . insertAt ) == 0 ) ) info . results [ 0 ] = true ; } if ( ( fOp ) == ( XMLContentSpec . CONTENTSPECNODE_LEAF ) ) { if ( ( info . insertAt ) == 0 ) info . isValidEOC = true ; } else { info . isValidEOC = true ; } break ; case XMLContentSpec . CONTENTSPECNODE_ZERO_OR_MORE : case XMLContentSpec . CONTENTSPECNODE_ONE_OR_MORE : info . results [ 0 ] = true ; if ( ( ( fOp ) == ( XMLContentSpec . CONTENTSPECNODE_ZERO_OR_MORE ) ) || ( ( info . insertAt ) > 0 ) ) { info . isValidEOC = true ; } break ; case XMLContentSpec . CONTENTSPECNODE_CHOICE : if ( ( info . insertAt ) == 0 ) { if ( ( ! fullyValid ) && ( ( info . childCount ) == 0 ) ) { info . results [ 0 ] = true ; info . results [ 1 ] = true ; } } if ( ( info . insertAt ) == 1 ) info . isValidEOC = true ; break ; case XMLContentSpec . CONTENTSPECNODE_SEQ : if ( ( info . insertAt ) == 0 ) { if ( fullyValid ) { if ( ( info . childCount ) == 1 ) info . results [ 0 ] = ( ( info . curChildren [ 0 ] . uri ) == ( fSecondChild . uri ) ) && ( ( info . curChildren [ 0 ] . localpart ) == ( fSecondChild . localpart ) ) ; } else { info . results [ 0 ] = true ; } } else if ( ( info . insertAt ) == 1 ) { if ( ( ! fullyValid ) || ( ( info . childCount ) == 1 ) ) info . results [ 1 ] = true ; } if ( ( info . insertAt ) == 2 ) info . isValidEOC = true ; break ; default : throw new CMException ( ImplementationMessages . VAL_CST ) ; } return - 1 ; } public ContentLeafNameTypeVector getContentLeafNameTypeVector ( ) { } }

Fix:
for ( int index = info . insertAt ; index < ( ( info . childCount ) - 1 ) ; index ++ ) {