Buggy code:
public abstract class AbstractMethodDeclaration extends AstNode implements ReferenceContext , ProblemSeverities { public MethodScope scope ; public char [ ] selector ; public int declarationSourceStart ; public int declarationSourceEnd ; public int modifiers ; public int modifiersSourceStart ; public Argument [ ] arguments ; public TypeReference [ ] thrownExceptions ; public Statement [ ] statements ; public int explicitDeclarations ; public MethodBinding binding ; public boolean ignoreFurtherInvestigation = false ; public boolean needFreeReturn = false ; public int bodyStart ; public int bodyEnd = - 1 ; public CompilationResult compilationResult ; AbstractMethodDeclaration ( CompilationResult compilationResult ) { } public void abort ( int abortLevel ) { } public void bindArguments ( ) { } public void bindThrownExceptions ( ) { } public CompilationResult compilationResult ( ) { } public void generateCode ( ClassScope classScope , ClassFile classFile ) { int problemResetPC = 0 ; classFile . codeStream . wideMode = false ; if ( ignoreFurtherInvestigation ) { if ( ( this . binding ) == null ) return ; int problemsLength ; <START_BUG> IProblem [ ] problems = scope . referenceCompilationUnit ( ) . compilationResult . getAllProblems ( ) ; <END_BUG> IProblem [ ] problemsCopy = new IProblem [ problemsLength = problems . length ] ; System . arraycopy ( problems , 0 , problemsCopy , 0 , problemsLength ) ; classFile . addProblemMethod ( this , binding , problemsCopy ) ; return ; } try { problemResetPC = classFile . contentsOffset ; this . generateCode ( classFile ) ; } catch ( org . eclipse . jdt . internal . compiler . problem . AbortMethod e ) { if ( ( e . compilationResult ) == ( CodeStream . RESTART_IN_WIDE_MODE ) ) { try { this . traverse ( new ResetStateForCodeGenerationVisitor ( ) , classScope ) ; classFile . contentsOffset = problemResetPC ; ( classFile . methodCount ) -- ; classFile . codeStream . wideMode = true ; this . generateCode ( classFile ) ; } catch ( org . eclipse . jdt . internal . compiler . problem . AbortMethod e2 ) { int problemsLength ; IProblem [ ] problems = scope . referenceCompilationUnit ( ) . compilationResult . getAllProblems ( ) ; IProblem [ ] problemsCopy = new IProblem [ problemsLength = problems . length ] ; System . arraycopy ( problems , 0 , problemsCopy , 0 , problemsLength ) ; classFile . addProblemMethod ( this , binding , problemsCopy , problemResetPC ) ; } } else { int problemsLength ; IProblem [ ] problems = scope . referenceCompilationUnit ( ) . compilationResult . getAllProblems ( ) ; IProblem [ ] problemsCopy = new IProblem [ problemsLength = problems . length ] ; System . arraycopy ( problems , 0 , problemsCopy , 0 , problemsLength ) ; classFile . addProblemMethod ( this , binding , problemsCopy , problemResetPC ) ; } } } private void generateCode ( ClassFile classFile ) { } private void checkArgumentsSize ( ) { } public boolean hasErrors ( ) { } public boolean isAbstract ( ) { } public boolean isClinit ( ) { } public boolean isConstructor ( ) { } public boolean isDefaultConstructor ( ) { } public boolean isInitializationMethod ( ) { } public boolean isNative ( ) { } public boolean isStatic ( ) { } public abstract void parseStatements ( Parser parser , CompilationUnitDeclaration unit ) { } public void resolve ( ClassScope upperScope ) { } public void resolveStatements ( ClassScope upperScope ) { } public String returnTypeToString ( int tab ) { } public void tagAsHavingErrors ( ) { } public String toString ( int tab ) { } public String toStringStatements ( int tab ) { } public void traverse ( IAbstractSyntaxTreeVisitor visitor , ClassScope classScope ) { } }

Fix:
IProblem [ ] problems = scope . referenceCompilationUnit ( ) . compilationResult . getProblems ( ) ;