Buggy code:
public OptimizedReplaceEdit getLastEdit ( ) { } public final int getLineEnd ( int lineNumber ) { } Alignment getMemberAlignment ( ) { } public String getNewLine ( ) { } private String getNewLineString ( int linesCount ) { } public int getNextIndentationLevel ( int someColumn ) { } private String getPreserveEmptyLines ( int count ) { } public TextEdit getRootEdit ( ) { } public void handleLineTooLong ( ) { } private void handleLineTooLongSmartly ( ) { } private boolean hasNLSTag ( int sourceStart ) { } private boolean includesBlockComments ( ) { } private boolean includesJavadocComments ( ) { } private boolean includesLineComments ( ) { } boolean includesComments ( ) { } public void indent ( ) { } private void initializeScanner ( long sourceLevel , DefaultCodeFormatterOptions preferences ) { } private void initFormatterCommentParser ( ) { } private boolean isOnFirstColumn ( int start ) { } private boolean isMeaningfulEdit ( OptimizedReplaceEdit edit ) { } private void preserveEmptyLines ( int count , int insertPosition ) { } private void print ( int length , boolean considerSpaceIfAny ) { } private void printBlockComment ( boolean isJavadoc ) { } private boolean printBlockComment ( int currentTokenStartPosition , int currentTokenEndPosition ) { } private void printBlockCommentHeaderLine ( StringBuffer buffer ) { } public void printEndOfCompilationUnit ( ) { } private void printCodeSnippet ( int startPosition , int endPosition , int linesGap ) { } void printComment ( ) { } void printComment ( int kind , int trailing ) { } void printComment ( int kind , String source , int start , int end , int level ) { } private void printLineComment ( ) { } private void printLineComment ( int commentStart , int commentEnd ) { } public void printEmptyLines ( int linesNumber ) { } private void printEmptyLines ( int linesNumber , int insertPosition ) { } void printIndentationIfNecessary ( ) { } private void printIndentationIfNecessary ( StringBuffer buffer ) { } private void printJavadocBlock ( FormatJavadocBlock block ) { } private int printJavadocBlockNodesNewLines ( FormatJavadocBlock block , FormatJavadocNode node , int previousEnd ) { } private void printJavadocBlockReference ( FormatJavadocBlock block , FormatJavadocReference reference ) { } private int getTextLength ( FormatJavadocBlock block , FormatJavadocText text ) { } void printJavadocComment ( int start , int end ) { } private void printJavadocGapLines ( int textStartPosition , int textEndPosition , int newLines , boolean clearBlankLines , boolean footer , StringBuffer output ) { } private void printJavadocImmutableText ( FormatJavadocText text , FormatJavadocBlock block , boolean textOnNewLine ) { try { int textLineStart = text . lineStart ; this . scanner . tokenizeWhiteSpace = false ; String newLineString = null ; for ( int idx = 0 , max = text . separatorsPtr ; idx <= max ; idx ++ ) { int start = ( ( int ) ( text . separators [ idx ] ) ) ; int lineStart = Util . getLineNumber ( start , this . lineEnds , ( textLineStart - 1 ) , this . maxLines ) ; while ( textLineStart < lineStart ) { int end = this . lineEnds [ ( textLineStart - 1 ) ] ; this . scanner . resetTo ( end , start ) ; int token = this . scanner . getNextToken ( ) ; switch ( token ) { case TerminalTokens . TokenNameMULTIPLY : case TerminalTokens . TokenNameMULTIPLY_EQUAL : break ; default : return ; } if ( ( this . scanner . currentCharacter ) == '<seq2seq4repair_space>' ) { this . scanner . getNextChar ( ) ; } if ( newLineString == null ) { this . tempBuffer . setLength ( 0 ) ; this . column = 1 ; printIndentationIfNecessary ( this . tempBuffer ) ; this . tempBuffer . append ( BLOCK_LINE_PREFIX ) ; this . column += BLOCK_LINE_PREFIX_LENGTH ; newLineString = this . tempBuffer . toString ( ) ; } addReplaceEdit ( ( end + 1 ) , this . scanner . getCurrentTokenEndPosition ( ) , newLineString ) ; <START_BUG> textLineStart ++ ; <END_BUG> } } } catch ( InvalidInputException iie ) { } finally { this . needSpace = false ; this . scanner . tokenizeWhiteSpace = true ; this . scanner . resetTo ( ( ( text . sourceEnd ) + 1 ) , ( ( this . scannerEndPosition ) - 1 ) ) ; } } private void printJavadocGapLinesForImmutableBlock ( FormatJavadocBlock block ) { } private int printJavadocHtmlTag ( FormatJavadocText text , FormatJavadocBlock block , boolean textOnNewLine ) { } private void printJavadocNewLine ( StringBuffer buffer ) { } private void printJavadocText ( FormatJavadocText text , FormatJavadocBlock block , boolean textOnNewLine ) { } private void printJavadocTextLine ( StringBuffer buffer , int textStart , int textEnd , FormatJavadocBlock block , boolean firstText , boolean needIndentation , boolean isHtmlTag ) { } public void printModifiers ( Annotation [ ] annotations , ASTVisitor visitor ) { } public void printModifiers ( Annotation [ ] annotations , ASTVisitor visitor , int annotationSourceKind ) { } public void printNewLine ( ) { } public void printNewLine ( int insertPosition ) { } private void printNewLinesBeforeDisablingComment ( ) { } private boolean printNewLinesCharacters ( int offset , int length ) { } public void printNextToken ( int expectedTokenType ) { } public void printNextToken ( int expectedTokenType , boolean considerSpaceIfAny ) { } public void printNextToken ( int [ ] expectedTokenTypes ) { } public void printNextToken ( int [ ] expectedTokenTypes , boolean considerSpaceIfAny ) { } public void printArrayQualifiedReference ( int numberOfTokens , int sourceEnd ) { } public void printQualifiedReference ( int sourceEnd , boolean expectParenthesis ) { } private void printRule ( StringBuffer stringBuffer ) { } void redoAlignment ( AlignmentException e ) { } void redoMemberAlignment ( AlignmentException e ) { } public void reset ( ) { } private void resetAt ( Location location ) { } public void resetScanner ( char [ ] compilationUnitSource ) { } private void resize ( ) { }

Fix:
textLineStart = Util . getLineNumber ( ( ( this . scanner . currentPosition ) - 1 ) , this . lineEnds , textLineStart , this . maxLines ) ;