Program: 58283
Project: 58283
Buggy source:
/** 
 * Applies EditorConfig rules for the given file.
 * @param dataObject
 */
public void applyRulesToFile(DataObject dataObject) throws Exception {
  HashMap<String,String> keyedRules=parseRulesForFile(dataObject);
  FileObject fileObject=dataObject.getPrimaryFile();
  boolean changedStyle=false;
  boolean changed=false;
  for (  Map.Entry<String,String> rule : keyedRules.entrySet()) {
    final String key=rule.getKey();
    final String value=rule.getValue();
    LOG.log(Level.INFO,"String_Node_Str",new Object[]{Tab.ONE,key,value});
switch (key) {
case EditorConfigConstant.CHARSET:
      CharsetOperation.doCharset(dataObject,value,EditorConfigPropertyMapper.normalizeLineEnding(keyedRules.get(EditorConfigConstant.END_OF_LINE)));
    break;
case EditorConfigConstant.END_OF_LINE:
  LineEndingOperation.doLineEnding(dataObject,EditorConfigPropertyMapper.normalizeLineEnding(value));
break;
case EditorConfigConstant.INDENT_SIZE:
changed=IndentSizeOperation.doIndentSize(dataObject,value);
changedStyle=changedStyle || changed;
break;
case EditorConfigConstant.INDENT_STYLE:
changed=IndentStyleOperation.doIndentStyle(dataObject,value);
changedStyle=changedStyle || changed;
break;
case EditorConfigConstant.INSERT_FINAL_NEWLINE:
FinalNewLineOperation.doFinalNewLine(dataObject,EditorConfigPropertyMapper.normalizeLineEnding(keyedRules.get(EditorConfigConstant.END_OF_LINE)));
break;
case EditorConfigConstant.TAB_WIDTH:
changed=TabWidthOperation.doTabWidth(dataObject,value);
changedStyle=changedStyle || changed;
break;
default :
LOG.log(Level.WARNING,"String_Node_Str",key);
}
}
Preferences codeStyle=CodeStylePreferences.get(fileObject,fileObject.getMIMEType()).getPreferences();
if (changedStyle) {
try {
codeStyle.flush();
}
 catch (BackingStoreException ex) {
LOG.log(Level.SEVERE,"String_Node_Str",ex.getMessage());
}
}
}

Fixed version (ground truth):
/** 
 * Applies EditorConfig rules for the given file.
 * @param dataObject
 */
public void applyRulesToFile(DataObject dataObject) throws Exception {
  HashMap<String,String> keyedRules=parseRulesForFile(dataObject);
  FileObject fileObject=dataObject.getPrimaryFile();
  boolean changedStyle=false;
  boolean changed=false;
  for (  Map.Entry<String,String> rule : keyedRules.entrySet()) {
    final String key=rule.getKey();
    final String value=rule.getValue();
    LOG.log(Level.INFO,"String_Node_Str",new Object[]{Tab.ONE,key,value});
switch (key) {
case EditorConfigConstant.CHARSET:
      CharsetOperation.doCharset(dataObject,value,EditorConfigPropertyMapper.normalizeLineEnding(keyedRules.get(EditorConfigConstant.END_OF_LINE)));
    break;
case EditorConfigConstant.END_OF_LINE:
  LineEndingOperation.doLineEnding(dataObject,EditorConfigPropertyMapper.normalizeLineEnding(value));
break;
case EditorConfigConstant.INDENT_SIZE:
changed=IndentSizeOperation.doIndentSize(dataObject,value);
changedStyle=changedStyle || changed;
break;
case EditorConfigConstant.INDENT_STYLE:
changed=IndentStyleOperation.doIndentStyle(dataObject,value);
changedStyle=changedStyle || changed;
break;
case EditorConfigConstant.INSERT_FINAL_NEWLINE:
System.out.println("String_Node_Str");
changed=FinalNewLineOperation.doFinalNewLine(dataObject,EditorConfigPropertyMapper.normalizeLineEnding(keyedRules.get(EditorConfigConstant.END_OF_LINE)));
if (changed) {
LOG.log(Level.INFO,"String_Node_Str",dataObject.getPrimaryFile().getPath());
}
 else {
LOG.log(Level.INFO,"String_Node_Str",dataObject.getPrimaryFile().getPath());
}
break;
case EditorConfigConstant.TAB_WIDTH:
changed=TabWidthOperation.doTabWidth(dataObject,value);
changedStyle=changedStyle || changed;
break;
default :
LOG.log(Level.WARNING,"String_Node_Str",key);
break;
}
}
Preferences codeStyle=CodeStylePreferences.get(fileObject,fileObject.getMIMEType()).getPreferences();
if (changedStyle) {
try {
codeStyle.flush();
}
 catch (BackingStoreException ex) {
LOG.log(Level.SEVERE,"String_Node_Str",ex.getMessage());
}
}
}