Buggy code:
} Argument [ ] parameters = methodDeclaration . arguments ; if ( parameters != null ) { int parametersLength = parameters . length ; for ( int i = 0 ; i < parametersLength ; i ++ ) { methodDecl . parameters ( ) . add ( convert ( parameters [ i ] ) ) ; } } ExplicitConstructorCall explicitConstructorCall = null ; if ( isConstructor ) { PrimitiveType returnType = this . ast . newPrimitiveType ( PrimitiveType . VOID ) ; returnType . setSourceRange ( methodDeclaration . sourceStart , 0 ) ; methodDecl . setReturnType ( returnType ) ; ConstructorDeclaration constructorDeclaration = ( ( ConstructorDeclaration ) ( methodDeclaration ) ) ; explicitConstructorCall = constructorDeclaration . constructorCall ; } else { org . eclipse . jdt . internal . compiler . ast . MethodDeclaration method = ( ( org . eclipse . jdt . internal . compiler . ast . MethodDeclaration ) ( methodDeclaration ) ) ; TypeReference typeReference = method . returnType ; if ( typeReference != null ) { Type returnType = convertType ( typeReference ) ; int rightParenthesisPosition = retrieveEndOfRightParenthesisPosition ( end , method . bodyEnd ) ; int extraDimensions = retrieveExtraDimension ( rightParenthesisPosition , method . bodyEnd ) ; methodDecl . setExtraDimensions ( extraDimensions ) ; setTypeForMethodDeclaration ( methodDecl , returnType , extraDimensions ) ; } } int declarationSourceStart = methodDeclaration . declarationSourceStart ; int declarationSourceEnd = methodDeclaration . bodyEnd ; methodDecl . setSourceRange ( declarationSourceStart , ( ( declarationSourceEnd - declarationSourceStart ) + 1 ) ) ; int closingPosition = retrieveRightBraceOrSemiColonPosition ( methodDecl , methodDeclaration ) ; if ( closingPosition != ( - 1 ) ) { int startPosition = methodDecl . getStartPosition ( ) ; methodDecl . setSourceRange ( startPosition , ( closingPosition - startPosition ) ) ; Statement [ ] statements = methodDeclaration . statements ; if ( ( statements != null ) || ( explicitConstructorCall != null ) ) { start = retrieveStartBlockPosition ( methodDeclaration . sourceStart , declarationSourceEnd ) ; end = retrieveEndBlockPosition ( methodDeclaration . sourceStart , methodDeclaration . declarationSourceEnd ) ; if ( ( start != ( - 1 ) ) && ( end != ( - 1 ) ) ) { Block block = this . ast . newBlock ( ) ; block . setSourceRange ( start , ( ( end - start ) + 1 ) ) ; if ( ( explicitConstructorCall != null ) && ( ( explicitConstructorCall . accessMode ) != ( ExplicitConstructorCall . ImplicitSuper ) ) ) { block . statements ( ) . add ( convert ( explicitConstructorCall ) ) ; } int statementsLength = ( statements == null ) ? 0 : statements . length ; for ( int i = 0 ; i < statementsLength ; i ++ ) { if ( ( statements [ i ] ) instanceof LocalDeclaration ) { checkAndAddMultipleLocalDeclaration ( statements , i , block . statements ( ) ) ; } else { block . statements ( ) . add ( convert ( statements [ i ] ) ) ; } } methodDecl . setBody ( block ) ; } } else if ( ( ! ( methodDeclaration . isNative ( ) ) ) && ( ! ( methodDeclaration . isAbstract ( ) ) ) ) { start = retrieveStartBlockPosition ( methodDeclaration . sourceStart , declarationSourceEnd ) ; end = retrieveEndBlockPosition ( methodDeclaration . sourceStart , methodDeclaration . declarationSourceEnd ) ; if ( ( start != ( - 1 ) ) && ( end != ( - 1 ) ) ) { Block block = this . ast . newBlock ( ) ; block . setSourceRange ( start , ( ( end - start ) + 1 ) ) ; methodDecl . setBody ( block ) ; } } } else { if ( ( ! ( methodDeclaration . isNative ( ) ) ) && ( ! ( methodDeclaration . isAbstract ( ) ) ) ) { start = retrieveStartBlockPosition ( methodDeclaration . sourceStart , declarationSourceEnd ) ; end = methodDeclaration . bodyEnd ; IProblem [ ] problems = methodDeclaration . compilationResult ( ) . problems ; if ( problems != null ) { <START_BUG> for ( int i = 0 , max = problems . length ; i < max ; i ++ ) { <END_BUG> IProblem currentProblem = problems [ i ] ; if ( ( ( currentProblem . getSourceStart ( ) ) == start ) && ( ( currentProblem . getID ( ) ) == ( IProblem . ParsingErrorInsertToComplete ) ) ) { end = currentProblem . getSourceEnd ( ) ; break ; } } } int startPosition = methodDecl . getStartPosition ( ) ; methodDecl . setSourceRange ( startPosition , ( ( end - startPosition ) + 1 ) ) ; if ( ( start != ( - 1 ) ) && ( end != ( - 1 ) ) ) { Block block = this . ast . newBlock ( ) ; block . setSourceRange ( start , ( ( end - start ) + 1 ) ) ; methodDecl . setBody ( block ) ; } } } setJavaDocComment ( methodDecl ) ; if ( this . resolveBindings ) { recordNodes ( methodDecl , methodDeclaration ) ; recordNodes ( methodName , methodDeclaration ) ; methodDecl . resolveBinding ( ) ; } return methodDecl ; } public Expression convert ( org . eclipse . jdt . internal . compiler . ast . Expression expression ) { } public ParenthesizedExpression convertToParenthesizedExpression ( org . eclipse . jdt . internal . compiler . ast . Expression expression ) { } public ClassInstanceCreation convert ( AllocationExpression expression ) { } public ClassInstanceCreation convert ( AnonymousLocalTypeDeclaration expression ) { } private void buildBodyDeclarations ( AnonymousLocalTypeDeclaration expression , AnonymousClassDeclaration anonymousClassDeclaration ) { } public ArrayCreation convert ( ArrayAllocationExpression expression ) { } public SingleVariableDeclaration convert ( Argument argument ) { } public ArrayInitializer convert ( org . eclipse . jdt . internal . compiler . ast . ArrayInitializer expression ) { }

Fix:
for ( int i = 0 , max = methodDeclaration . compilationResult ( ) . problemCount ; i < max ; i ++ ) {