Buggy code:
public class RecoveredMethod extends RecoveredElement implements TerminalTokens { public AbstractMethodDeclaration methodDeclaration ; public RecoveredType [ ] localTypes ; public int localTypeCount ; public RecoveredBlock methodBody ; public boolean discardBody = true ; public RecoveredMethod ( AbstractMethodDeclaration methodDeclaration , RecoveredElement parent , int bracketBalance , Parser parser ) { } public RecoveredElement add ( Block nestedBlockDeclaration , int bracketBalanceValue ) { } public RecoveredElement add ( FieldDeclaration fieldDeclaration , int bracketBalanceValue ) { } public RecoveredElement add ( LocalDeclaration localDeclaration , int bracketBalanceValue ) { } public RecoveredElement add ( Statement statement , int bracketBalanceValue ) { } public RecoveredElement add ( TypeDeclaration typeDeclaration , int bracketBalanceValue ) { if ( ( ( methodDeclaration . declarationSourceEnd ) != 0 ) && ( ( typeDeclaration . declarationSourceStart ) > ( methodDeclaration . declarationSourceEnd ) ) ) { if ( ( this . parent ) == null ) { return this ; } return this . parent . add ( typeDeclaration , bracketBalanceValue ) ; } <START_BUG> if ( ( ( typeDeclaration . bits ) & ( ASTNode . IsLocalType ) ) != 0 ) { <END_BUG> if ( ( methodBody ) == null ) { Block block = new Block ( 0 ) ; block . sourceStart = methodDeclaration . bodyStart ; this . add ( block , 1 ) ; } return methodBody . add ( typeDeclaration , bracketBalanceValue , true ) ; } switch ( TypeDeclaration . kind ( typeDeclaration . modifiers ) ) { case TypeDeclaration . INTERFACE_DECL : case TypeDeclaration . ANNOTATION_TYPE_DECL : this . updateSourceEndIfNecessary ( this . previousAvailableLineEnd ( ( ( typeDeclaration . declarationSourceStart ) - 1 ) ) ) ; if ( ( this . parent ) == null ) { return this ; } return this . parent . add ( typeDeclaration , bracketBalanceValue ) ; } if ( ( localTypes ) == null ) { localTypes = new RecoveredType [ 5 ] ; localTypeCount = 0 ; } else { if ( ( localTypeCount ) == ( localTypes . length ) ) { System . arraycopy ( localTypes , 0 , ( localTypes = new RecoveredType [ 2 * ( localTypeCount ) ] ) , 0 , localTypeCount ) ; } } RecoveredType element = new RecoveredType ( typeDeclaration , this , bracketBalanceValue ) ; localTypes [ ( ( localTypeCount ) ++ ) ] = element ; if ( ! ( foundOpeningBrace ) ) { foundOpeningBrace = true ; ( this . bracketBalance ) ++ ; } return element ; } public boolean bodyStartsAtHeaderEnd ( ) { } public ASTNode parseTree ( ) { } public int sourceEnd ( ) { } public String toString ( int tab ) { } public void updateBodyStart ( int bodyStart ) { } public AbstractMethodDeclaration updatedMethodDeclaration ( ) { } public void updateFromParserState ( ) { } public RecoveredElement updateOnClosingBrace ( int braceStart , int braceEnd ) { } public RecoveredElement updateOnOpeningBrace ( int braceStart , int braceEnd ) { } public void updateParseTree ( ) { } public void updateSourceEndIfNecessary ( int braceStart , int braceEnd ) { } void attach ( TypeParameter [ ] parameters , int startPos ) { } }

Fix:
if ( ( ( ( ( typeDeclaration . bits ) & ( ASTNode . IsLocalType ) ) != 0 ) || ( this . parser ( ) . methodRecoveryActivated ) ) || ( this . parser ( ) . statementRecoveryActivated ) ) {