Buggy code:
private int fENUMERATIONSymbol = - 1 ; private int fREQUIREDSymbol = - 1 ; private int fFIXEDSymbol = - 1 ; private int fDATATYPESymbol = - 1 ; private int fEpsilonIndex = - 1 ; private DatatypeValidatorFactoryImpl fDataTypeReg = null ; private DatatypeValidator fValID = null ; private DatatypeValidator fValIDRef = null ; private DatatypeValidator fValIDRefs = null ; private DatatypeValidator fValENTITY = null ; private DatatypeValidator fValENTITIES = null ; private DatatypeValidator fValNMTOKEN = null ; private DatatypeValidator fValNMTOKENS = null ; private DatatypeValidator fValNOTATION = null ; public XMLValidator ( StringPool stringPool , XMLErrorReporter errorReporter , DefaultEntityHandler entityHandler , XMLDocumentScanner documentScanner ) { } public void setGrammarResolver ( GrammarResolver grammarResolver ) { } public void initHandlers ( boolean sendCharDataAsCharArray , XMLDocumentHandler docHandler , XMLDocumentHandler . DTDHandler dtdHandler ) { } public void resetOrCopy ( StringPool stringPool ) throws Exception { } public void reset ( StringPool stringPool ) throws Exception { } public void setValidationEnabled ( boolean flag ) throws Exception { } public boolean getValidationEnabled ( ) { } public void setSchemaValidationEnabled ( boolean flag ) { } public boolean getSchemaValidationEnabled ( ) { } public void setDynamicValidationEnabled ( boolean flag ) throws Exception { } public boolean getDynamicValidationEnabled ( ) { } public void setLoadDTDGrammar ( boolean loadDG ) { } public boolean getLoadDTDGrammar ( ) { } public void setNamespacesEnabled ( boolean flag ) { } public boolean getNamespacesEnabled ( ) { } public void setWarningOnDuplicateAttDef ( boolean flag ) { } public boolean getWarningOnDuplicateAttDef ( ) { } public void setWarningOnUndeclaredElements ( boolean flag ) { } public boolean getWarningOnUndeclaredElements ( ) { } public void startEntityReference ( int entityName , int entityType , int entityContext ) throws Exception { } public void endEntityReference ( int entityName , int entityType , int entityContext ) throws Exception { } public void sendEndOfInputNotifications ( int entityName , boolean moreToFollow ) throws Exception { } public void sendReaderChangeNotifications ( XMLEntityHandler . EntityReader reader , int readerId ) throws Exception { } public boolean externalEntityStandaloneCheck ( ) { } public boolean getValidating ( ) { } public void processCharacters ( char [ ] chars , int offset , int length ) throws Exception { } public void processCharacters ( int data ) throws Exception { } public void processWhitespace ( char [ ] chars , int offset , int length ) throws Exception { } public void processWhitespace ( int data ) throws Exception { } public void scanElementType ( XMLEntityHandler . EntityReader entityReader , char fastchar , QName element ) throws Exception { } public boolean scanExpectedElementType ( XMLEntityHandler . EntityReader entityReader , char fastchar , QName element ) throws Exception { } public void scanAttributeName ( XMLEntityHandler . EntityReader entityReader , QName element , QName attribute ) throws Exception { } public void callStartDocument ( ) throws Exception { } public void callEndDocument ( ) throws Exception { } public void callXMLDecl ( int version , int encoding , int standalone ) throws Exception { } public void callStandaloneIsYes ( ) throws Exception { } public void callTextDecl ( int version , int encoding ) throws Exception { } public void element ( QName element ) throws Exception { } public boolean attribute ( QName element , QName attrName , int attrValue ) throws Exception { } public void callStartElement ( QName element ) throws Exception { if ( XMLValidator . DEBUG_SCHEMA_VALIDATION ) System . out . println ( ( "\n=======StartElement<seq2seq4repair_space>:<seq2seq4repair_space>" + ( fStringPool . toString ( element . localpart ) ) ) ) ; if ( ! ( fSeenRootElement ) ) { fSeenRootElement = true ; rootElementSpecified ( element ) ; fStringPool . resetShuffleCount ( ) ; } if ( ( ( fGrammar ) != null ) && ( fGrammarIsDTDGrammar ) ) { fAttrListHandle = addDTDDefaultAttributes ( element , fAttrList , fAttrListHandle , fValidating , ( ( fStandaloneReader ) != ( - 1 ) ) ) ; } fCheckedForSchema = true ; if ( fNamespacesEnabled ) { bindNamespacesToElementAndAttributes ( element , fAttrList ) ; } validateElementAndAttributes ( element , fAttrList ) ; if ( ( fAttrListHandle ) != ( - 1 ) ) { fAttrList . endAttrList ( ) ; } fDocumentHandler . startElement ( element , fAttrList , fAttrListHandle ) ; fAttrListHandle = - 1 ; ( fElementDepth ) ++ ; if ( fValidating ) { <START_BUG> if ( ( fElementChildrenOffsetStack . length ) < ( fElementDepth ) ) { <END_BUG> int [ ] newarray = new int [ ( fElementChildrenOffsetStack . length ) * 2 ] ; System . arraycopy ( fElementChildrenOffsetStack , 0 , newarray , 0 , fElementChildrenOffsetStack . length ) ; fElementChildrenOffsetStack = newarray ; } fElementChildrenOffsetStack [ fElementDepth ] = fElementChildrenLength ; if ( ( fElementChildren . length ) <= ( fElementChildrenLength ) ) { QName [ ] newarray = new QName [ ( fElementChildrenLength ) * 2 ] ; System . arraycopy ( fElementChildren , 0 , newarray , 0 , fElementChildren . length ) ; fElementChildren = newarray ; } QName qname = fElementChildren [ fElementChildrenLength ] ; if ( qname == null ) { for ( int i = fElementChildrenLength ; i < ( fElementChildren . length ) ; i ++ ) { fElementChildren [ i ] = new QName ( ) ; } qname = fElementChildren [ fElementChildrenLength ] ; } qname . setValues ( element ) ; ( fElementChildrenLength ) ++ ; if ( XMLValidator . DEBUG_ELEMENT_CHILDREN ) { printChildren ( ) ; printStack ( ) ; } } ensureStackCapacity ( fElementDepth ) ; fCurrentElement . setValues ( element ) ; fCurrentElementEntity = fEntityHandler . getReaderId ( ) ; fElementQNamePartsStack [ fElementDepth ] . setValues ( fCurrentElement ) ; fElementEntityStack [ fElementDepth ] = fCurrentElementEntity ; fElementIndexStack [ fElementDepth ] = fCurrentElementIndex ; fContentSpecTypeStack [ fElementDepth ] = fCurrentContentSpecType ; if ( fNeedValidationOff ) { fValidating = false ; fNeedValidationOff = false ; } if ( ( fValidating ) && ( fGrammarIsSchemaGrammar ) ) { pushContentLeafStack ( ) ; }

Fix:
if ( ( fElementChildrenOffsetStack . length ) <= ( fElementDepth ) ) {