Buggy code:
private int textRegionEnd ; private int textRegionStart ; public int tabChar ; public int numberOfIndentations ; private boolean useTabsOnlyForLeadingIndents ; Scribe ( CodeFormatterVisitor formatter , Map settings , int offset , int length , CodeSnippetParsingUtil codeSnippetParsingUtil ) { } private final void addDeleteEdit ( int start , int end ) { } public final void addInsertEdit ( int insertPosition , String insertedString ) { } private final void addOptimizedReplaceEdit ( int offset , int length , String replacement ) { } public final void addReplaceEdit ( int start , int end , String replacement ) { } public void alignFragment ( Alignment alignment , int fragmentIndex ) { } public void checkNLSTag ( int sourceStart ) { } public void consumeNextToken ( ) { } public Alignment createAlignment ( String name , int mode , int count , int sourceRestart ) { } public Alignment createAlignment ( String name , int mode , int count , int sourceRestart , boolean adjust ) { } public Alignment createAlignment ( String name , int mode , int tieBreakRule , int count , int sourceRestart ) { } public Alignment createAlignment ( String name , int mode , int count , int sourceRestart , int continuationIndent , boolean adjust ) { } public Alignment createAlignment ( String name , int mode , int tieBreakRule , int count , int sourceRestart , int continuationIndent , boolean adjust ) { } public Alignment createMemberAlignment ( String name , int mode , int count , int sourceRestart ) { } public void enterAlignment ( Alignment alignment ) { } public void enterMemberAlignment ( Alignment alignment ) { } public void exitAlignment ( Alignment alignment , boolean discardAlignment ) { } public void exitMemberAlignment ( Alignment alignment ) { } public Alignment getAlignment ( String name ) { } public int getColumnIndentationLevel ( ) { } public final int getCommentIndex ( int position ) { } public String getEmptyLines ( int linesNumber ) { } public OptimizedReplaceEdit getLastEdit ( ) { } public final int getLineEnd ( int lineNumber ) { } Alignment getMemberAlignment ( ) { } public String getNewLine ( ) { } public int getNextIndentationLevel ( int someColumn ) { } private String getPreserveEmptyLines ( int count ) { } public TextEdit getRootEdit ( ) { } public void handleLineTooLong ( ) { } private boolean hasNLSTag ( int sourceStart ) { } public void indent ( ) { } private int indexOf ( char [ ] toBeFound , char [ ] source , int start , int end ) { } public void initializeScanner ( char [ ] compilationUnitSource ) { } private boolean isValidEdit ( OptimizedReplaceEdit edit ) { } private void preserveEmptyLines ( int count , int insertPosition ) { } private void print ( char [ ] s , boolean considerSpaceIfAny ) { } private void printBlockComment ( char [ ] s , boolean isJavadoc ) { } public void printEndOfCompilationUnit ( ) { } public void printComment ( ) { } private void printCommentLine ( char [ ] s ) { } public void printEmptyLines ( int linesNumber ) { } private void printEmptyLines ( int linesNumber , int insertPosition ) { } private void printIndentationIfNecessary ( ) { } private void printIndentationIfNecessary ( StringBuffer buffer ) { } public void printModifiers ( Annotation [ ] annotations , ASTVisitor visitor ) { try { int annotationsLength = ( annotations != null ) ? annotations . length : 0 ; int annotationsIndex = 0 ; boolean isFirstModifier = true ; int currentTokenStartPosition = this . scanner . currentPosition ; boolean hasComment = false ; boolean hasModifiers = false ; while ( ( this . currentToken = this . scanner . getNextToken ( ) ) != ( TerminalTokens . TokenNameEOF ) ) { switch ( this . currentToken ) { case TerminalTokens . TokenNamepublic : case TerminalTokens . TokenNameprotected : case TerminalTokens . TokenNameprivate : case TerminalTokens . TokenNamestatic : case TerminalTokens . TokenNameabstract : case TerminalTokens . TokenNamefinal : case TerminalTokens . TokenNamenative : case TerminalTokens . TokenNamesynchronized : case TerminalTokens . TokenNametransient : case TerminalTokens . TokenNamevolatile : case TerminalTokens . TokenNamestrictfp : hasModifiers = true ; this . print ( this . scanner . getRawTokenSource ( ) , ( ! isFirstModifier ) ) ; isFirstModifier = false ; <START_BUG> currentTokenStartPosition = this . scanner . getCurrentTokenStartPosition ( ) ; <END_BUG> break ; case TerminalTokens . TokenNameAT : hasModifiers = true ; if ( ! isFirstModifier ) { this . space ( ) ; } this . scanner . resetTo ( this . scanner . getCurrentTokenStartPosition ( ) , ( ( this . scannerEndPosition ) - 1 ) ) ; if ( annotationsIndex < annotationsLength ) { annotations [ ( annotationsIndex ++ ) ] . traverse ( visitor , ( ( BlockScope ) ( null ) ) ) ; if ( this . formatter . preferences . insert_new_line_after_annotation ) { this . printNewLine ( ) ; } } else { return ; } isFirstModifier = false ; currentTokenStartPosition = this . scanner . currentPosition ; break ; case TerminalTokens . TokenNameCOMMENT_BLOCK : this . printBlockComment ( this . scanner . getRawTokenSource ( ) , false ) ; currentTokenStartPosition = this . scanner . currentPosition ; hasComment = true ; break ; case TerminalTokens . TokenNameCOMMENT_JAVADOC : this . printBlockComment ( this . scanner . getRawTokenSource ( ) , true ) ; currentTokenStartPosition = this . scanner . currentPosition ; hasComment = true ; break ; case TerminalTokens . TokenNameCOMMENT_LINE : this . printCommentLine ( this . scanner . getRawTokenSource ( ) ) ; currentTokenStartPosition = this . scanner . currentPosition ; break ; case TerminalTokens . TokenNameWHITESPACE : addDeleteEdit ( this . scanner . getCurrentTokenStartPosition ( ) , this . scanner . getCurrentTokenEndPosition ( ) ) ; int count = 0 ; char [ ] whiteSpaces = this . scanner . getCurrentTokenSource ( ) ; for ( int i = 0 , max = whiteSpaces . length ;

Fix:
currentTokenStartPosition = this . scanner . currentPosition ;