Buggy code:
private static final int INCLUDE_LINE_COMMENTS = ( CodeFormatter . F_INCLUDE_COMMENTS ) | ( CodeFormatter . K_SINGLE_LINE_COMMENT ) ; private static final int SKIP_FIRST_WHITESPACE_TOKEN = - 2 ; private static final int INVALID_TOKEN = 2000 ; private int formatComments = 0 ; private int headerEndPosition = - 1 ; String commentIndentation ; private FormatterCommentParser formatterCommentParser ; Scribe ( CodeFormatterVisitor formatter , long sourceLevel , IRegion [ ] regions , CodeSnippetParsingUtil codeSnippetParsingUtil , boolean includeComments ) { } private void adaptRegions ( ) { } private void adaptEdits ( ) { } private int adaptEdit ( OptimizedReplaceEdit [ ] sortedEdits , int start , int regionStart , int regionEnd ) { } 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 ) { } private int consumeInvalidToken ( int end ) { } 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 ) { } private int getCommentIndex ( int start , int position ) { } private IRegion getCoveringAdaptedRegion ( int offset , int end ) { } private int getCurrentCommentOffset ( int start ) { } public String getEmptyLines ( int linesNumber ) { } private int getIndexOfAdaptedRegionAt ( int offset ) { } public OptimizedReplaceEdit getLastEdit ( ) { } public final int getLineEnd ( int lineNumber ) { } Alignment getMemberAlignment ( ) { } public String getNewLine ( ) { } public int getNextIndentationLevel ( int someColumn ) { } private String getPreserveEmptyLines ( int count ) { } private IRegion getAdaptedRegionAt ( int offset ) { } public TextEdit getRootEdit ( ) { } public void handleLineTooLong ( ) { } private boolean hasNLSTag ( int sourceStart ) { } private boolean includesBlockComments ( ) { } private boolean includesJavadocComments ( ) { } private boolean includesLineComments ( ) { } boolean includesComments ( ) { } public void indent ( ) { } public void initializeScanner ( char [ ] compilationUnitSource ) { } private void initFormatterCommentParser ( ) { } private boolean isOnFirstColumn ( int start ) { } private boolean isValidEdit ( OptimizedReplaceEdit edit ) { } private void preserveEmptyLines ( int count , int insertPosition ) { } private void print ( int length , boolean considerSpaceIfAny ) { } private void printBlockComment ( boolean isJavadoc ) { int currentTokenStartPosition = this . scanner . getCurrentTokenStartPosition ( ) ; int currentTokenEndPosition = ( this . scanner . getCurrentTokenEndPosition ( ) ) + 1 ; <START_BUG> boolean includesBlockComments = includesBlockComments ( ) ; <END_BUG> this . scanner . resetTo ( currentTokenStartPosition , ( currentTokenEndPosition - 1 ) ) ; int currentCharacter ; boolean isNewLine = false ; int start = currentTokenStartPosition ; int nextCharacterStart = currentTokenStartPosition ; int previousStart = currentTokenStartPosition ; boolean onFirstColumn = isOnFirstColumn ( start ) ; boolean indentComment = false ; if ( ( this . indentationLevel ) != 0 ) { if ( ( isJavadoc || ( ! ( this . formatter . preferences . never_indent_block_comments_on_first_column ) ) ) || ( ! onFirstColumn ) ) { indentComment = true ; printIndentationIfNecessary ( ) ; } } if ( this . pendingSpace ) { addInsertEdit ( currentTokenStartPosition , "<seq2seq4repair_space>" ) ; } this . needSpace = false ; this . pendingSpace = false ; int commentColumn = this . column ; if ( includesBlockComments ) { if ( printBlockComment ( currentTokenStartPosition , currentTokenEndPosition ) ) { return ; } } int currentIndentationLevel = this . indentationLevel ; if ( ( commentColumn - 1 ) > ( this . indentationLevel ) ) { this . indentationLevel = commentColumn - 1 ; } int currentCommentOffset = ( onFirstColumn ) ? 0 : getCurrentCommentOffset ( start ) ; boolean formatComment = ( isJavadoc && ( ( ( this . formatComments ) & ( CodeFormatter . K_JAVA_DOC ) ) != 0 ) ) || ( ( ! isJavadoc ) && ( ( ( this . formatComments ) & ( CodeFormatter . K_MULTI_LINE_COMMENT ) ) != 0 ) ) ; try { while ( ( nextCharacterStart <= currentTokenEndPosition ) && ( ( currentCharacter = this . scanner . getNextChar ( ) ) != ( - 1 ) ) ) { nextCharacterStart = this . scanner . currentPosition ; switch ( currentCharacter ) { case '\r' : start = previousStart ; isNewLine = true ; if ( this . scanner . getNextChar ( '\n' ) ) { currentCharacter = '\n' ; nextCharacterStart = this . scanner . currentPosition ;

Fix:
boolean includesBlockComments = ( ! isJavadoc ) && ( includesBlockComments ( ) ) ;