Buggy code:
public class FormatterOptions { public static final String OPTION_InsertNewlineBeforeOpeningBrace = ( CodeFormatter . class . getName ( ) ) + ".newlineOpeningBrace" ; public static final String OPTION_InsertNewlineInControlStatement = ( CodeFormatter . class . getName ( ) ) + ".newlineControlStatement" ; public static final String OPTION_InsertNewLineBetweenElseAndIf = ( CodeFormatter . class . getName ( ) ) + ".newlineElseIf" ; public static final String OPTION_InsertNewLineInEmptyBlock = ( CodeFormatter . class . getName ( ) ) + ".newlineEmptyBlock" ; public static final String OPTION_ClearAllBlankLines = ( CodeFormatter . class . getName ( ) ) + ".newlineClearAll" ; public static final String OPTION_SplitLineExceedingLength = ( CodeFormatter . class . getName ( ) ) + ".lineSplit" ; public static final String OPTION_CompactAssignment = ( CodeFormatter . class . getName ( ) ) + ".compactAssignment" ; public static final String OPTION_TabulationChar = ( CodeFormatter . class . getName ( ) ) + ".tabulationChar" ; public static final String OPTION_TabulationSize = ( CodeFormatter . class . getName ( ) ) + ".tabulationSize" ; public boolean newLineBeforeOpeningBraceMode = false ; public boolean newlineInControlStatementMode = false ; public boolean clearAllBlankLinesMode = false ; public int maxLineLength = 80 ; public boolean compactAssignmentMode = false ; public int tabSize = 4 ; public boolean indentWithTab = true ; public boolean compactElseIfMode = false ; public boolean newLineInEmptyBlockMode = true ; public char [ ] lineSeparatorSequence = System . getProperty ( "line.separator" ) . toCharArray ( ) ; public FormatterOptions ( ) { } public FormatterOptions ( ConfigurableOption [ ] settings ) { } public int getMaxLineLength ( ) { } public int getTabSize ( ) { } public boolean isAddingNewLineBeforeOpeningBrace ( ) { } public boolean isAddingNewLineInControlStatement ( ) { } public boolean isAddingNewLineInEmptyBlock ( ) { } public boolean isClearingAllBlankLines ( ) { } public boolean isCompactingAssignment ( ) { } public boolean isCompactingElseIf ( ) { } public boolean isUsingTabForIndenting ( ) { } public void setClearAllBlankLinesMode ( boolean flag ) { } public void setCompactAssignmentMode ( boolean flag ) { } public void setCompactElseIfMode ( boolean flag ) { } public void setIndentationUsesTab ( boolean flag ) { } public void setLineSeparator ( String lineSeparator ) { } public void setMaxLineLength ( int maxLineLength ) { } public void setNewLineBeforeOpeningBraceMode ( boolean flag ) { } public void setNewlineInControlStatementMode ( boolean flag ) { } public void setNewLineInEmptyBlockMode ( boolean flag ) { } public void setOption ( ConfigurableOption setting ) { String optionID = setting . getID ( ) ; if ( optionID . equals ( FormatterOptions . OPTION_InsertNewlineBeforeOpeningBrace ) ) { setNewLineBeforeOpeningBraceMode ( ( ( setting . getValueIndex ( ) ) == 0 ) ) ; } else if ( optionID . equals ( FormatterOptions . OPTION_InsertNewlineInControlStatement ) ) { setNewlineInControlStatementMode ( ( ( setting . getValueIndex ( ) ) == 0 ) ) ; } else if ( optionID . equals ( FormatterOptions . OPTION_ClearAllBlankLines ) ) { setClearAllBlankLinesMode ( ( ( setting . getValueIndex ( ) ) == 0 ) ) ; } else if ( optionID . equals ( FormatterOptions . OPTION_InsertNewLineBetweenElseAndIf ) ) { <START_BUG> setCompactElseIfMode ( ( ( setting . getValueIndex ( ) ) == 0 ) ) ; <END_BUG> } else if ( optionID . equals ( FormatterOptions . OPTION_InsertNewLineInEmptyBlock ) ) { setNewLineInEmptyBlockMode ( ( ( setting . getValueIndex ( ) ) == 0 ) ) ; } else if ( optionID . equals ( FormatterOptions . OPTION_SplitLineExceedingLength ) ) { try { setMaxLineLength ( Integer . parseInt ( setting . getValue ( ) ) ) ; } catch ( NumberFormatException e ) { } } else if ( optionID . equals ( FormatterOptions . OPTION_CompactAssignment ) ) { setCompactAssignmentMode ( ( ( setting . getValueIndex ( ) ) == 0 ) ) ; } else if ( optionID . equals ( FormatterOptions . OPTION_TabulationChar ) ) { setIndentationUsesTab ( ( ( setting . getValueIndex ( ) ) == 0 ) ) ; } else if ( optionID . equals ( FormatterOptions . OPTION_TabulationSize ) ) { try { setTabSize ( Integer . parseInt ( setting . getValue ( ) ) ) ; } catch ( NumberFormatException e ) { } } } public void setReuseExistingLayoutMode ( boolean flag ) { } public void setTabSize ( int size ) { } }

Fix:
setCompactElseIfMode ( ( ( setting . getValueIndex ( ) ) == 1 ) ) ;