Buggy code:
class CompilationUnitResolver extends Compiler { static class IntArrayList { public int [ ] list = new int [ 5 ] ; public int length = 0 ; public void add ( int i ) { } } HashtableOfObject requestedSources ; HashtableOfObject requestedKeys ; DefaultBindingResolver . BindingTables bindingTables ; public CompilationUnitResolver ( INameEnvironment environment , IErrorHandlingPolicy policy , Map settings , ICompilerRequestor requestor , IProblemFactory problemFactory ) { } public void accept ( ISourceType [ ] sourceTypes , PackageBinding packageBinding , AccessRestriction accessRestriction ) { } protected void beginToCompile ( ICompilationUnit [ ] sourceUnits , String [ ] bindingKeys ) { } IBinding createBinding ( String key ) { } public static CompilationUnit convert ( CompilationUnitDeclaration compilationUnitDeclaration , char [ ] source , int apiLevel , Map options , boolean needToResolveBindings , WorkingCopyOwner owner , DefaultBindingResolver . BindingTables bindingTables , IProgressMonitor monitor ) { } protected static IErrorHandlingPolicy getHandlingPolicy ( ) { } protected static ICompilerRequestor getRequestor ( ) { } public void initializeParser ( ) { } public void process ( CompilationUnitDeclaration unit , int i ) { } protected void handleInternalException ( Throwable internalException , CompilationUnitDeclaration unit , CompilationResult result ) { } protected void handleInternalException ( org . eclipse . jdt . internal . compiler . problem . AbortCompilation abortException , CompilationUnitDeclaration unit ) { } public static void parse ( org . eclipse . jdt . core . ICompilationUnit [ ] compilationUnits , ASTRequestor astRequestor , int apiLevel , Map options , IProgressMonitor monitor ) { } public static CompilationUnitDeclaration parse ( ICompilationUnit sourceUnit , NodeSearcher nodeSearcher , Map settings ) { } public static void resolve ( org . eclipse . jdt . core . ICompilationUnit [ ] compilationUnits , String [ ] bindingKeys , ASTRequestor requestor , int apiLevel , Map options , IJavaProject javaProject , WorkingCopyOwner owner , IProgressMonitor monitor ) { } public static CompilationUnitDeclaration resolve ( ICompilationUnit sourceUnit , IJavaProject javaProject , NodeSearcher nodeSearcher , Map options , WorkingCopyOwner owner , IProgressMonitor monitor ) throws JavaModelException { } public static IBinding [ ] resolve ( final IJavaElement [ ] elements , int apiLevel , Map compilerOptions , IJavaProject javaProject , WorkingCopyOwner owner , IProgressMonitor monitor ) { final int length = elements . length ; final HashMap sourceElementPositions = new HashMap ( ) ; int cuNumber = 0 ; final HashtableOfObjectToInt binaryElementPositions = new HashtableOfObjectToInt ( ) ; for ( int i = 0 ; i < length ; i ++ ) { IJavaElement element = elements [ i ] ; if ( ! ( element instanceof SourceRefElement ) ) throw new IllegalStateException ( ( element + "<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>part<seq2seq4repair_space>of<seq2seq4repair_space>a<seq2seq4repair_space>compilation<seq2seq4repair_space>unit<seq2seq4repair_space>or<seq2seq4repair_space>class<seq2seq4repair_space>file" ) ) ; Object cu = element . getAncestor ( IJavaElement . COMPILATION_UNIT ) ; if ( cu != null ) { CompilationUnitResolver . IntArrayList intList = ( ( CompilationUnitResolver . IntArrayList ) ( sourceElementPositions . get ( cu ) ) ) ; if ( intList == null ) { sourceElementPositions . put ( cu , ( intList = new CompilationUnitResolver . IntArrayList ( ) ) ) ; cuNumber ++ ; } intList . add ( i ) ; } else { try { <START_BUG> String key = ( ( org . eclipse . jdt . internal . core . BinaryMember ) ( element ) ) . getBindingKey ( ) ; <END_BUG> binaryElementPositions . put ( key , i ) ; } catch ( JavaModelException e ) { throw new IllegalArgumentException ( ( element + "<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>exist" ) ) ; } } } org . eclipse . jdt . core . ICompilationUnit [ ] cus = new org . eclipse . jdt . core . ICompilationUnit [ cuNumber ] ; sourceElementPositions . keySet ( ) . toArray ( cus ) ; int bindingKeyNumber = binaryElementPositions . size ( ) ; String [ ] bindingKeys = new String [ bindingKeyNumber ] ; binaryElementPositions . keysToArray ( bindingKeys ) ; class Requestor extends ASTRequestor { IBinding [ ] bindings = new IBinding [ length ] ; public void acceptAST ( org . eclipse . jdt . core . ICompilationUnit source , CompilationUnit ast ) { CompilationUnitResolver . IntArrayList intList = ( ( CompilationUnitResolver . IntArrayList ) ( sourceElementPositions . get ( source ) ) ) ; for ( int i = 0 ; i < ( intList . length ) ; i ++ ) { final int index = intList . list [ i ] ; SourceRefElement element = ( ( SourceRefElement ) ( elements [ index ] ) ) ; DOMFinder finder = new DOMFinder ( ast , element , true ) ; try { finder . search ( ) ; } catch ( JavaModelException e ) { throw new IllegalArgumentException ( ( element + "<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>exist" ) ) ; } this . bindings [ index ] = finder . foundBinding ; } } public void acceptBinding ( String bindingKey , IBinding binding ) { int index = binaryElementPositions . get ( bindingKey ) ; this . bindings [ index ] = binding ; } } Requestor requestor = new Requestor ( ) ; CompilationUnitResolver . resolve ( cus , bindingKeys , requestor , apiLevel , compilerOptions , javaProject , owner , monitor ) ; return requestor . bindings ; } public void removeUnresolvedBindings ( CompilationUnitDeclaration compilationUnitDeclaration ) { } private void removeUnresolvedBindings ( TypeDeclaration type ) { } private void resolve ( org . eclipse . jdt . core . ICompilationUnit [ ] compilationUnits , String [ ] bindingKeys , ASTRequestor astRequestor , int apiLevel , Map compilerOptions , WorkingCopyOwner owner , IProgressMonitor monitor ) { } private void reportBinding ( Object key , ASTRequestor astRequestor , WorkingCopyOwner owner , CompilationUnitDeclaration unit ) { } private CompilationUnitDeclaration resolve ( CompilationUnitDeclaration unit , ICompilationUnit sourceUnit , NodeSearcher nodeSearcher , boolean verifyMethods , boolean analyzeCode , boolean generateCode ) { } public CompilationUnitDeclaration resolve ( ICompilationUnit sourceUnit , boolean verifyMethods , boolean analyzeCode , boolean generateCode ) { }

Fix:
String key = ( ( BinaryMember ) ( element ) ) . getKey ( ) ;