Buggy code:
public class XSDFACM implements XSCMValidator { private static final int EPSILON = - 2 ; private static final int EOC = - 3 ; private static final boolean DEBUG_VALIDATE_CONTENT = false ; private Object [ ] fElemMap = null ; private int [ ] fElemMapType = null ; private int fElemMapSize = 0 ; private boolean fMixed ; private static String fEOCString = "<<CMNODE_EOC>>" ; private int fEOCPos = 0 ; private static String fEpsilonString = "<<CMNODE_EPSILON>>" ; private boolean [ ] fFinalStateFlags = null ; private CMStateSet [ ] fFollowList = null ; private CMNode fHeadNode = null ; private int fLeafCount = 0 ; private XSCMLeaf [ ] fLeafList = null ; private int [ ] fLeafListType = null ; private int [ ] [ ] fTransTable = null ; private int fTransTableSize = 0 ; private boolean fEmptyContentIsValid = false ; private Object fElementDecl = new Object ( ) ; public XSDFACM ( CMNode syntaxTree , int leafCount ) { } public XSDFACM ( CMNode syntaxTree , int leafCount , boolean mixed ) { } private static long time = 0 ; public boolean isFinalState ( int state ) { } public Object oneTransition ( QName curElem , int [ ] state , SubstitutionGroupHandler subGroupHandler ) { } Object findMatchingDecl ( QName curElem , SubstitutionGroupHandler subGroupHandler ) { } public int [ ] startContentModel ( ) { } public boolean endContentModel ( int [ ] state ) { } private void buildDFA ( CMNode syntaxTree ) { fElementDecl = new XSElementDecl ( ) ; ( ( XSElementDecl ) ( fElementDecl ) ) . fName = XSDFACM . fEOCString ; XSCMLeaf nodeEOC = new XSCMLeaf ( ( ( XSElementDecl ) ( fElementDecl ) ) ) ; fHeadNode = new XSCMBinOp ( XSParticleDecl . PARTICLE_SEQUENCE , syntaxTree , nodeEOC ) ; fEOCPos = fLeafCount ; nodeEOC . setPosition ( ( ( fLeafCount ) ++ ) ) ; fLeafList = new XSCMLeaf [ fLeafCount ] ; fLeafListType = new int [ fLeafCount ] ; postTreeBuildInit ( fHeadNode , 0 ) ; fFollowList = new CMStateSet [ fLeafCount ] ; for ( int index = 0 ; index < ( fLeafCount ) ; index ++ ) fFollowList [ index ] = new CMStateSet ( fLeafCount ) ; calcFollowList ( fHeadNode ) ; fElemMap = new Object [ fLeafCount ] ; fElemMapType = new int [ fLeafCount ] ; fElemMapSize = 0 ; for ( int outIndex = 0 ; outIndex < ( fLeafCount ) ; outIndex ++ ) { fElemMap [ outIndex ] = null ; int inIndex = 0 ; final Object decl = fLeafList [ outIndex ] . getDecl ( ) ; if ( ( fLeafListType [ outIndex ] ) == ( XSParticleDecl . PARTICLE_WILDCARD ) ) { for ( ; inIndex < ( fElemMapSize ) ; inIndex ++ ) { <START_BUG> if ( decl == ( fLeafList [ inIndex ] ) ) <END_BUG> break ; } } else { final XSElementDecl element = ( ( XSElementDecl ) ( decl ) ) ; if ( ( element . fName ) == ( XSDFACM . fEOCString ) ) continue ; for ( ; inIndex < ( fElemMapSize ) ; inIndex ++ ) { if ( ( ( ( fElemMapType [ inIndex ] ) == ( fLeafListType [ outIndex ] ) ) && ( ( ( ( XSElementDecl ) ( fElemMap [ inIndex ] ) ) . fTargetNamespace ) == ( element . fTargetNamespace ) ) ) && ( ( ( ( XSElementDecl ) ( fElemMap [ inIndex ] ) ) . fName ) == ( element . fName ) ) ) break ; } } if ( inIndex == ( fElemMapSize ) ) { fElemMap [ fElemMapSize ] = decl ; fElemMapType [ fElemMapSize ] = fLeafListType [ outIndex ] ; ( fElemMapSize ) ++ ; } } int [ ] fLeafSorter = new int [ ( fLeafCount ) + ( fElemMapSize ) ] ; int fSortCount = 0 ; for ( int elemIndex = 0 ; elemIndex < ( fElemMapSize ) ; elemIndex ++ ) { final Object decl = fElemMap [ elemIndex ] ; for ( int leafIndex = 0 ; leafIndex < ( fLeafCount ) ; leafIndex ++ ) { if ( ( fElemMapType [ elemIndex ] ) != ( fLeafListType [ leafIndex ] ) ) continue ; if ( ( fLeafListType [ leafIndex ] ) == ( XSParticleDecl . PARTICLE_WILDCARD ) ) { if ( decl == ( fLeafList [ leafIndex ] . getDecl ( ) ) ) fLeafSorter [ ( fSortCount ++ ) ] = leafIndex ; } else { final XSElementDecl leaf = ( ( XSElementDecl ) ( fLeafList [ leafIndex ] . getDecl ( ) ) ) ; final XSElementDecl element = ( ( XSElementDecl ) ( decl ) ) ; if ( ( ( leaf . fTargetNamespace ) == ( element . fTargetNamespace ) ) && ( ( leaf . fName ) == ( element . fName ) ) ) { fLeafSorter [ ( fSortCount ++ ) ] = leafIndex ; } } } fLeafSorter [ ( fSortCount ++ ) ] = - 1 ; } int curArraySize = ( fLeafCount ) * 4 ; CMStateSet [ ] statesToDo = new CMStateSet [ curArraySize ] ; fFinalStateFlags = new boolean [ curArraySize ] ; fTransTable = new int [ curArraySize ] [ ] ; CMStateSet setT = fHeadNode . firstPos ( ) ; int unmarkedState = 0 ; int curState = 0 ; fTransTable [ curState ] = makeDefStateList ( ) ; statesToDo [ curState ] = setT ; curState ++ ; Hashtable stateTable = new Hashtable ( ) ; while ( unmarkedState < curState ) { setT = statesToDo [ unmarkedState ] ; int [ ] transEntry = fTransTable [ unmarkedState ] ; fFinalStateFlags [ unmarkedState ] = setT . getBit ( fEOCPos ) ; unmarkedState ++ ; CMStateSet newSet = null ; int sorterIndex = 0 ; for ( int elemIndex = 0 ; elemIndex < ( fElemMapSize ) ;

Fix:
if ( decl == ( fElemMap [ inIndex ] ) )