Buggy code:
public boolean visit ( OR_OR_Expression or_or_Expression , BlockScope scope ) { } public boolean visit ( PostfixExpression postfixExpression , BlockScope scope ) { } public boolean visit ( PrefixExpression prefixExpression , BlockScope scope ) { } public boolean visit ( QualifiedAllocationExpression qualifiedAllocationExpression , BlockScope scope ) { } public boolean visit ( QualifiedNameReference qualifiedNameReference , BlockScope scope ) { } public boolean visit ( QualifiedSuperReference qualifiedSuperReference , BlockScope scope ) { } public boolean visit ( QualifiedThisReference qualifiedThisReference , BlockScope scope ) { } public boolean visit ( QualifiedTypeReference qualifiedTypeReference , BlockScope scope ) { } public boolean visit ( QualifiedTypeReference qualifiedTypeReference , ClassScope scope ) { } public boolean visit ( ReturnStatement returnStatement , BlockScope scope ) { } public boolean visit ( SingleNameReference singleNameReference , BlockScope scope ) { } public boolean visit ( SingleTypeReference singleTypeReference , BlockScope scope ) { } public boolean visit ( SingleTypeReference singleTypeReference , ClassScope scope ) { } public boolean visit ( StringLiteral stringLiteral , BlockScope scope ) { } public boolean visit ( SuperReference superReference , BlockScope scope ) { } public boolean visit ( SwitchStatement switchStatement , BlockScope scope ) { this . scribe . printNextToken ( TerminalTokens . TokenNameswitch ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameLPAREN , this . preferences . insert_space_before_switch_condition ) ; if ( this . preferences . insert_space_in_switch_condition ) { this . scribe . space ( ) ; } switchStatement . expression . traverse ( this , scope ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameRPAREN , this . preferences . insert_space_in_switch_condition ) ; String switch_brace = this . preferences . switch_brace_position ; formatOpeningBrace ( switch_brace , this . preferences . insert_space_before_switch_open_brace ) ; this . scribe . printNewLine ( ) ; if ( preferences . indent_switchstatements_compare_to_switch ) { this . scribe . indent ( ) ; } final Statement [ ] statements = switchStatement . statements ; boolean wasACase = false ; boolean wasAStatement = false ; if ( statements != null ) { int statementsLength = statements . length ; for ( int i = 0 ; i < statementsLength ; i ++ ) { final Statement statement = statements [ i ] ; if ( statement instanceof CaseStatement ) { if ( ( wasACase && ( this . preferences . indent_switchstatements_compare_to_cases ) ) || ( wasAStatement && ( this . preferences . indent_switchstatements_compare_to_cases ) ) ) { this . scribe . unIndent ( ) ; } statement . traverse ( this , scope ) ; wasACase = true ; wasAStatement = false ; if ( this . preferences . indent_switchstatements_compare_to_cases ) { this . scribe . indent ( ) ; } } else if ( statement instanceof BreakStatement ) { if ( this . preferences . indent_breaks_compare_to_cases ) { if ( wasAStatement && ( ! ( this . preferences . indent_switchstatements_compare_to_cases ) ) ) { this . scribe . indent ( ) ; } } else { if ( wasAStatement ) { if ( this . preferences . indent_switchstatements_compare_to_cases ) { this . scribe . unIndent ( ) ; } } if ( wasACase && ( this . preferences . indent_switchstatements_compare_to_cases ) ) { this . scribe . unIndent ( ) ; } } statement . traverse ( this , scope ) ; if ( this . preferences . indent_breaks_compare_to_cases ) { this . scribe . unIndent ( ) ; } wasACase = false ; wasAStatement = false ; } else { statement . traverse ( this , scope ) ; wasAStatement = true ; wasACase = false ; } if ( statement instanceof Expression ) { this . scribe . printNextToken ( TerminalTokens . TokenNameSEMICOLON , this . preferences . insert_space_before_semicolon ) ; this . scribe . printTrailingComment ( ) ; } else if ( statement instanceof LocalDeclaration ) { LocalDeclaration currentLocal = ( ( LocalDeclaration ) ( statement ) ) ; if ( i < ( statementsLength - 1 ) ) { if ( ( statements [ ( i + 1 ) ] ) instanceof LocalDeclaration ) { LocalDeclaration nextLocal = ( ( LocalDeclaration ) ( statements [ ( i + 1 ) ] ) ) ; if ( ( currentLocal . declarationSourceStart ) != ( nextLocal . declarationSourceStart ) ) { this . scribe . printNextToken ( TerminalTokens . TokenNameSEMICOLON , this . preferences . insert_space_before_semicolon ) ; this . scribe . printTrailingComment ( ) ; } } else { this . scribe . printNextToken ( TerminalTokens . TokenNameSEMICOLON , this . preferences . insert_space_before_semicolon ) ; this . scribe . printTrailingComment ( ) ; } } else { this . scribe . printNextToken ( TerminalTokens . TokenNameSEMICOLON , this . preferences . insert_space_before_semicolon ) ; this . scribe . printTrailingComment ( ) ; } } this . scribe . printNewLine ( ) ; } } <START_BUG> if ( wasACase && ( this . preferences . indent_switchstatements_compare_to_cases ) ) { <END_BUG> this . scribe . unIndent ( ) ; } if ( preferences . indent_switchstatements_compare_to_switch ) { this . scribe . unIndent ( ) ; } this . scribe . printNewLine ( ) ; this . scribe . printNextToken ( TerminalTokens . TokenNameRBRACE ) ; this . scribe . printTrailingComment ( ) ; if ( switch_brace . equals ( DefaultCodeFormatterConstants . NEXT_LINE_SHIFTED ) ) { this . scribe . unIndent ( ) ; } return false ; } public boolean visit ( SynchronizedStatement synchronizedStatement , BlockScope scope ) { } public boolean visit ( ThisReference thisReference , BlockScope scope ) { } public boolean visit ( ThrowStatement throwStatement , BlockScope scope ) { } public boolean visit ( TrueLiteral trueLiteral , BlockScope scope ) { } public boolean visit ( TryStatement tryStatement , BlockScope scope ) { } public boolean visit ( TypeDeclaration typeDeclaration , CompilationUnitScope scope ) { } public boolean visit ( UnaryExpression unaryExpression , BlockScope scope ) { } public boolean visit ( WhileStatement whileStatement , BlockScope scope ) { } }

Fix:
if ( ( wasACase || wasAStatement ) && ( this . preferences . indent_switchstatements_compare_to_cases ) ) {