Buggy code:
void buildCommentsTable ( CompilationUnit compilationUnit , int [ ] [ ] comments ) { } protected void checkAndAddMultipleFieldDeclaration ( FieldDeclaration [ ] fields , int index , List bodyDeclarations ) { } protected void checkAndAddMultipleLocalDeclaration ( Statement [ ] stmts , int index , List blockStatements ) { } protected void checkCanceled ( ) { } protected void completeRecord ( ArrayType arrayType , ASTNode astNode ) { } public ASTNode convert ( AbstractMethodDeclaration methodDeclaration ) { checkCanceled ( ) ; if ( methodDeclaration instanceof org . eclipse . jdt . internal . compiler . ast . AnnotationTypeMemberDeclaration ) { return convert ( ( ( org . eclipse . jdt . internal . compiler . ast . AnnotationTypeMemberDeclaration ) ( methodDeclaration ) ) ) ; } MethodDeclaration methodDecl = this . ast . newMethodDeclaration ( ) ; if ( ( ( methodDeclaration . modifiers ) & ( CompilerModifiers . AccJustFlag ) ) != 0 ) { setModifiers ( methodDecl , methodDeclaration ) ; } boolean isConstructor = methodDeclaration . isConstructor ( ) ; methodDecl . setConstructor ( isConstructor ) ; SimpleName methodName = this . ast . newSimpleName ( new String ( methodDeclaration . selector ) ) ; int start = methodDeclaration . sourceStart ; int end = retrieveIdentifierEndPosition ( start , methodDeclaration . sourceEnd ) ; methodName . setSourceRange ( start , ( ( end - start ) + 1 ) ) ; methodDecl . setName ( methodName ) ; TypeReference [ ] thrownExceptions = methodDeclaration . thrownExceptions ; if ( thrownExceptions != null ) { int thrownExceptionsLength = thrownExceptions . length ; for ( int i = 0 ; i < thrownExceptionsLength ; i ++ ) { methodDecl . thrownExceptions ( ) . add ( convert ( thrownExceptions [ i ] ) ) ; } } 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 ) { ConstructorDeclaration constructorDeclaration = ( ( ConstructorDeclaration ) ( methodDeclaration ) ) ; explicitConstructorCall = constructorDeclaration . constructorCall ; switch ( this . ast . apiLevel ) { case AST . JLS2 : PrimitiveType returnType = this . ast . newPrimitiveType ( PrimitiveType . VOID ) ; returnType . setSourceRange ( methodDeclaration . sourceStart , 0 ) ; methodDecl . setReturnType ( returnType ) ; break ; case AST . JLS3 : methodDecl . setReturnType2 ( null ) ; } } else if ( methodDeclaration instanceof org . eclipse . jdt . internal . compiler . ast . MethodDeclaration ) { 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 ) ) ; <START_BUG> int closingPosition = retrieveRightBraceOrSemiColonPosition ( methodDeclaration . bodyEnd , methodDeclaration . declarationSourceEnd ) ; <END_BUG> if ( closingPosition != ( - 1 ) ) { int startPosition = methodDecl . getStartPosition ( ) ; methodDecl . setSourceRange ( startPosition , ( ( closingPosition - startPosition ) + 1 ) ) ; Statement [ ] statements = methodDeclaration . statements ; start = retrieveStartBlockPosition ( methodDeclaration . sourceStart , declarationSourceEnd ) ; end = retrieveEndBlockPosition ( methodDeclaration . sourceStart , methodDeclaration . declarationSourceEnd ) ; Block block = null ; if ( ( start != ( - 1 ) ) && ( end != ( - 1 ) ) ) { block = this . ast . newBlock ( ) ; block . setSourceRange ( start , ( ( end - start ) + 1 ) ) ; methodDecl . setBody ( block ) ; } if ( ( block != null ) && ( ( statements != null ) || ( explicitConstructorCall != null ) ) ) { 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 ] ) ) ; } } } if ( ( block != null ) && ( ( Modifier . isAbstract ( methodDecl . getModifiers ( ) ) ) || ( Modifier . isNative ( methodDecl . getModifiers ( ) ) ) ) ) { methodDecl . setFlags ( ( ( methodDecl . getFlags ( ) ) | ( ASTNode . MALFORMED ) ) ) ; } } else { if ( ( ! ( methodDeclaration . isNative ( ) ) ) && ( ! ( methodDeclaration . isAbstract ( ) ) ) ) { start = retrieveStartBlockPosition ( methodDeclaration . sourceStart , declarationSourceEnd ) ; end = methodDeclaration . bodyEnd ; IProblem [ ] problems = methodDeclaration . compilationResult ( ) . problems ;

Fix:
int closingPosition = retrieveRightBraceOrSemiColonPosition ( ( ( methodDeclaration . bodyEnd ) + 1 ) , methodDeclaration . declarationSourceEnd ) ;