Buggy code:
public class SchemaGrammar implements XSGrammar , XSNamespaceItem { String fTargetNamespace ; SymbolHash fGlobalAttrDecls ; SymbolHash fGlobalAttrGrpDecls ; SymbolHash fGlobalElemDecls ; SymbolHash fGlobalGroupDecls ; SymbolHash fGlobalNotationDecls ; SymbolHash fGlobalIDConstraintDecls ; SymbolHash fGlobalTypeDecls ; XSDDescription fGrammarDescription = null ; XSAnnotationImpl [ ] fAnnotations = null ; int fNumAnnotations ; private SymbolTable fSymbolTable = null ; private SAXParser fSAXParser = null ; private DOMParser fDOMParser = null ; private SchemaGrammar ( ) { } public SchemaGrammar ( String targetNamespace , XSDDescription grammarDesc , SymbolTable symbolTable ) { } private static final int BASICSET_COUNT = 29 ; private static final int FULLSET_COUNT = 46 ; private static final int GRAMMAR_XS = 1 ; private static final int GRAMMAR_XSI = 2 ; public static class BuiltinSchemaGrammar extends SchemaGrammar { public BuiltinSchemaGrammar ( int grammar ) { } public XMLGrammarDescription getGrammarDescription ( ) { } public void setImportedGrammars ( Vector importedGrammars ) { } public void addGlobalAttributeDecl ( XSAttributeDecl decl ) { } public void addGlobalAttributeGroupDecl ( XSAttributeGroupDecl decl ) { } public void addGlobalElementDecl ( XSElementDecl decl ) { } public void addGlobalGroupDecl ( XSGroupDecl decl ) { } public void addGlobalNotationDecl ( XSNotationDecl decl ) { } public void addGlobalTypeDecl ( XSTypeDefinition decl ) { } public void addComplexTypeDecl ( XSComplexTypeDecl decl , SimpleLocator locator ) { } public void addRedefinedGroupDecl ( XSGroupDecl derived , XSGroupDecl base , SimpleLocator locator ) { } public synchronized void addDocument ( Object document , String location ) { } synchronized DOMParser getDOMParser ( ) { } synchronized SAXParser getSAXParser ( ) { } } public XMLGrammarDescription getGrammarDescription ( ) { } public boolean isNamespaceAware ( ) { } Vector fImported = null ; public void setImportedGrammars ( Vector importedGrammars ) { } public Vector getImportedGrammars ( ) { } public final String getTargetNamespace ( ) { } public void addGlobalAttributeDecl ( XSAttributeDecl decl ) { } public void addGlobalAttributeGroupDecl ( XSAttributeGroupDecl decl ) { } public void addGlobalElementDecl ( XSElementDecl decl ) { } public void addGlobalGroupDecl ( XSGroupDecl decl ) { } public void addGlobalNotationDecl ( XSNotationDecl decl ) { } public void addGlobalTypeDecl ( XSTypeDefinition decl ) { } public final void addIDConstraintDecl ( XSElementDecl elmDecl , IdentityConstraint decl ) { } public final XSAttributeDecl getGlobalAttributeDecl ( String declName ) { } public final XSAttributeGroupDecl getGlobalAttributeGroupDecl ( String declName ) { } public final XSElementDecl getGlobalElementDecl ( String declName ) { } public final XSGroupDecl getGlobalGroupDecl ( String declName ) { } public final XSNotationDecl getGlobalNotationDecl ( String declName ) { } public final XSTypeDefinition getGlobalTypeDecl ( String declName ) { } public final IdentityConstraint getIDConstraintDecl ( String declName ) { } private static final int INITIAL_SIZE = 16 ; private static final int INC_SIZE = 16 ; private int fCTCount = 0 ; private XSComplexTypeDecl [ ] fComplexTypeDecls = new XSComplexTypeDecl [ SchemaGrammar . INITIAL_SIZE ] ; private SimpleLocator [ ] fCTLocators = new SimpleLocator [ SchemaGrammar . INITIAL_SIZE ] ; private static final int REDEFINED_GROUP_INIT_SIZE = 2 ; private int fRGCount = 0 ; private XSGroupDecl [ ] fRedefinedGroupDecls = new XSGroupDecl [ SchemaGrammar . REDEFINED_GROUP_INIT_SIZE ] ; private SimpleLocator [ ] fRGLocators = new SimpleLocator [ ( SchemaGrammar . REDEFINED_GROUP_INIT_SIZE ) // 2 ] ; boolean fFullChecked = false ; public void addComplexTypeDecl ( XSComplexTypeDecl decl , SimpleLocator locator ) { } public void addRedefinedGroupDecl ( XSGroupDecl derived , XSGroupDecl base , SimpleLocator locator ) { if ( ( fRGCount ) == ( fRedefinedGroupDecls . length ) ) { fRedefinedGroupDecls = SchemaGrammar . resize ( fRedefinedGroupDecls , ( ( fRGCount ) << 1 ) ) ; fRGLocators = SchemaGrammar . resize ( fRGLocators , fRGCount ) ; } <START_BUG> fRGLocators [ ( ( fCTCount ) // 2 ) ] = locator ; <END_BUG> fRedefinedGroupDecls [ ( ( fRGCount ) ++ ) ] = derived ; fRedefinedGroupDecls [ ( ( fRGCount ) ++ ) ] = base ; } final XSComplexTypeDecl [ ] getUncheckedComplexTypeDecls ( ) { } final SimpleLocator [ ] getUncheckedCTLocators ( ) { } final XSGroupDecl [ ] getRedefinedGroupDecls ( ) { } final SimpleLocator [ ] getRGLocators ( ) { } final void setUncheckedTypeNum ( int newSize ) { } private int fSubGroupCount = 0 ; private XSElementDecl [ ] fSubGroups = new XSElementDecl [ SchemaGrammar . INITIAL_SIZE ] ; final XSElementDecl [ ] getSubstitutionGroups ( ) { } public static final XSComplexTypeDecl fAnyType = new SchemaGrammar . XSAnyType ( ) ; private static class XSAnyType extends XSComplexTypeDecl { public XSAnyType ( ) { } public void setValues ( String name , String targetNamespace , XSTypeDefinition baseType , short derivedBy , short schemaFinal , short block , short contentType , boolean isAbstract , XSAttributeGroupDecl attrGrp , XSSimpleType simpleType , XSParticleDecl particle ) { } public void setName ( String name ) { } public void setIsAbstractType ( ) { } public void setContainsTypeID ( ) { } public void setIsAnonymous ( ) { } public void reset ( ) { } public XSObjectList getAttributeUses ( ) { } public XSAttributeGroupDecl getAttrGrp ( ) { } public XSWildcard getAttributeWildcard ( ) { } public XSParticle getParticle ( ) { } public XSObjectList getAnnotations ( ) { } } private static class BuiltinAttrDecl extends XSAttributeDecl { public BuiltinAttrDecl ( String name , String tns , XSSimpleType type , short scope ) { } public void setValues ( String name , String targetNamespace , XSSimpleType simpleType , short constraintType , short scope , ValidatedInfo valInfo , XSComplexTypeDecl enclosingCT ) { } public void reset ( ) { } public XSAnnotation getAnnotation ( ) { } } public static final SchemaGrammar . BuiltinSchemaGrammar SG_SchemaNS = new SchemaGrammar . BuiltinSchemaGrammar ( SchemaGrammar . GRAMMAR_XS ) ; public static final XSSimpleType fAnySimpleType = ( ( XSSimpleType ) ( SchemaGrammar . SG_SchemaNS . getGlobalTypeDecl ( ATTVAL_ANYSIMPLETYPE ) ) ) ; public static final SchemaGrammar . BuiltinSchemaGrammar SG_XSI = new SchemaGrammar . BuiltinSchemaGrammar ( SchemaGrammar . GRAMMAR_XSI ) ; static final XSComplexTypeDecl [ ] resize ( XSComplexTypeDecl [ ] oldArray , int newSize ) { }

Fix:
fRGLocators [ ( ( fRGCount ) // 2 ) ] = locator ;