Buggy code:
public void addNewLineOnOpeningBrace ( boolean flag ) { } private static boolean breakLineBeforeOperator ( int operator ) { } private final String copyRemainingSource ( ) { } private void dumpTab ( int tabCount ) { } private void flushBuffer ( ) { } private void format ( ) { int token = 0 ; int previousToken = 0 ; int previousCompilableToken = 0 ; int indentationOffset = 0 ; int newLinesInWhitespace = 0 ; int pendingNewLines = 0 ; boolean expectingOpenBrace = false ; boolean clearNonBlockIndents = false ; boolean pendingSpace = true ; boolean pendingNewlineAfterParen = false ; boolean inAssignment = false ; boolean inArrayAssignment = false ; boolean inThrowsClause = false ; boolean inClassOrInterfaceHeader = false ; int openBracketCount = 0 ; int unarySignModifier = 0 ; int openParenthesisCount = 1 ; int [ ] openParenthesis = new int [ 10 ] ; int tokenBeforeColonCount = 0 ; int [ ] tokenBeforeColon = new int [ 10 ] ; constructionsCount = 0 ; int nlicsToken = 0 ; boolean specialElse = false ; currentLineIndentationLevel += constructionsCount ; try { while ( true ) { try { token = scanner . getNextToken ( ) ; } catch ( InvalidInputException e ) { if ( ! ( handleInvalidToken ( e ) ) ) { throw e ; } token = 0 ; } if ( token == Scanner ) break ; if ( clearNonBlockIndents && ( token != Scanner ) ) { switch ( token ) { case TokenNameelse : if ( ( ( constructionsCount ) > 0 ) && ( ( constructions [ ( ( constructionsCount ) - 1 ) ] ) == ( TokenNameelse ) ) ) { pendingNewLines = 1 ; specialElse = true ; } indentationLevel += popInclusiveUntil ( TokenNameif ) ; break ; case TokenNamecatch : indentationLevel += popInclusiveUntil ( TokenNamecatch ) ; break ; case TokenNamefinally : indentationLevel += popInclusiveUntil ( TokenNamecatch ) ; break ; case TokenNamewhile : if ( nlicsToken == ( TokenNamedo ) ) { indentationLevel += pop ( TokenNamedo ) ; break ; } default : indentationLevel += popExclusiveUntilBlockOrCase ( ) ; } clearNonBlockIndents = false ; } if ( ( token == ( TokenNamecase ) ) || ( token == ( TokenNamedefault ) ) ) { indentationLevel += pop ( TokenNamecase ) ; } if ( token == Scanner ) { inThrowsClause = true ; } if ( ( token == Scanner ) || ( token == Scanner ) ) { inClassOrInterfaceHeader = true ; } if ( ( ( pendingNewlineAfterParen && ( previousCompilableToken == ( TokenNameelse ) ) ) && ( token == ( TokenNameif ) ) ) && ( options . compactElseIfMode ) ) { pendingNewlineAfterParen = false ; pendingNewLines = 0 ; indentationLevel += pop ( TokenNameelse ) ; } pendingNewlineAfterParen = pendingNewlineAfterParen || ( ( previousCompilableToken == ( TokenNameRPAREN ) ) && ( token == ( TokenNameLBRACE ) ) ) ; if ( pendingNewlineAfterParen && ( token != Scanner ) ) { pendingNewlineAfterParen = false ; if ( ( ( ( token != ( TokenNameLBRACE ) ) && ( ! ( CodeFormatter . isComment ( token ) ) ) ) && ( token != ( TokenNameDOT ) ) ) && ( ! ( ( previousCompilableToken == ( TokenNameRPAREN ) ) && ( token == ( TokenNameSEMICOLON ) ) ) ) ) { newLine ( 1 ) ; <START_BUG> currentLineIndentationLevel += indentationLevel ; <END_BUG> pendingNewLines = 0 ; pendingSpace = false ; } else { if ( ( token == ( TokenNameLBRACE ) ) && ( options . newLineBeforeOpeningBraceMode ) ) { newLine ( 1 ) ; currentLineIndentationLevel = indentationLevel ; pendingNewLines = 0 ; pendingSpace = false ; } } } if ( ( token == ( TokenNameLBRACE ) ) && inThrowsClause ) { inThrowsClause = false ; if ( options . newLineBeforeOpeningBraceMode ) { newLine ( 1 ) ; currentLineIndentationLevel = indentationLevel ; pendingNewLines = 0 ; pendingSpace = false ; } } if ( ( token == ( TokenNameLBRACE ) ) && inClassOrInterfaceHeader ) { inClassOrInterfaceHeader = false ; if ( options . newLineBeforeOpeningBraceMode ) { newLine ( 1 ) ; currentLineIndentationLevel = indentationLevel ; pendingNewLines = 0 ; pendingSpace = false ; } } if ( ( ( ( ( pendingNewLines > 0 ) && ( ! ( CodeFormatter . isComment ( token ) ) ) ) || ( ( newLinesInWhitespace > 0 ) && ( ( openParenthesisCount <= 1 ) && ( CodeFormatter . isComment ( token ) ) ) ) ) || ( ( previousCompilableToken == ( TokenNameLBRACE ) ) && ( token == ( TokenNameRBRACE ) ) ) ) && ( token != Scanner ) ) { boolean closeBraceAndCloseParen = ( previousToken == ( TokenNameRBRACE ) ) && ( token == ( TokenNameRPAREN ) ) ; boolean nlicsOption = ( ( previousToken == ( TokenNameRBRACE ) ) && ( ! ( options . newlineInControlStatementMode ) ) ) && ( ( ( ( token == ( TokenNameelse ) ) || ( ( token == ( TokenNamewhile ) ) && ( nlicsToken == ( TokenNamedo ) ) ) ) || ( token == ( TokenNamecatch ) ) ) || ( token == ( TokenNamefinally ) ) ) ; boolean semiColonAndCloseBrace = ( previousToken == ( TokenNameRBRACE ) ) && ( token == ( TokenNameSEMICOLON ) ) ; boolean commentAndOpenBrace = ( previousToken == Scanner ) && ( token == ( TokenNameLBRACE ) ) ; boolean commaAndCloseBrace = ( previousToken == ( TokenNameRBRACE ) ) && ( token == ( TokenNameCOMMA ) ) ; if ( specialElse || ( ( ( ( ( ! commentAndOpenBrace ) && ( ! closeBraceAndCloseParen ) ) && ( ! nlicsOption ) ) && ( ! semiColonAndCloseBrace ) ) && ( ! commaAndCloseBrace ) ) ) { if ( ! ( options . clearAllBlankLinesMode ) ) { pendingNewLines = ( pendingNewLines < newLinesInWhitespace ) ? newLinesInWhitespace : pendingNewLines ; pendingNewLines = ( pendingNewLines > 2 ) ? 2 : pendingNewLines ; }

Fix:
currentLineIndentationLevel = indentationLevel ;