Program: 100866
Project: 100866
Buggy source:
private static void updateProperty(String listName,Properties property){
  StringBuffer result=new StringBuffer(Constants.INT_1024);
  String propValue=property.getProperty(listName);
  String file;
  int equalIndex;
  int fileExtIndex;
  StringTokenizer tokenizer=null;
  if (propValue == null || Constants.STRING_EMPTY.equals(propValue.trim())) {
    return;
  }
  tokenizer=new StringTokenizer(propValue,Constants.COMMA);
  while (tokenizer.hasMoreElements()) {
    file=(String)tokenizer.nextElement();
    equalIndex=file.indexOf(Constants.EQUAL);
    fileExtIndex=file.lastIndexOf(Constants.DOT);
    if (fileExtIndex != -1 && Constants.FILE_EXTENSION_DITAMAP.equalsIgnoreCase(file.substring(fileExtIndex))) {
      result.append(Constants.COMMA).append(file);
    }
 else     if (equalIndex == -1) {
      result.append(Constants.COMMA).append(FileUtils.replaceExtName(file,extName));
    }
 else {
      result.append(Constants.COMMA);
      result.append(FileUtils.replaceExtName(file.substring(0,equalIndex),extName));
      result.append(Constants.EQUAL);
      result.append(FileUtils.replaceExtName(file.substring(equalIndex + 1),extName));
    }
  }
  String list=result.substring(Constants.INT_1);
  property.setProperty(listName,list);
  String files[]=list.split(Constants.COMMA);
  String filename="String_Node_Str";
  if (listName == "String_Node_Str") {
    filename="String_Node_Str";
  }
 else   filename=listName.substring(Constants.INT_0,listName.lastIndexOf("String_Node_Str")) + "String_Node_Str";
  try {
    BufferedWriter bufferedWriter=new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(tempDir,filename))));
    if (files.length > 0) {
      for (int i=0; i < files.length; i++) {
        bufferedWriter.write(files[i]);
        if (i < files.length - 1)         bufferedWriter.write("String_Node_Str");
        bufferedWriter.flush();
      }
    }
  }
 catch (  FileNotFoundException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
private static void updateProperty(String listName,Properties property){
  StringBuffer result=new StringBuffer(Constants.INT_1024);
  String propValue=property.getProperty(listName);
  String file;
  int equalIndex;
  int fileExtIndex;
  StringTokenizer tokenizer=null;
  if (propValue == null || Constants.STRING_EMPTY.equals(propValue.trim())) {
    return;
  }
  tokenizer=new StringTokenizer(propValue,Constants.COMMA);
  while (tokenizer.hasMoreElements()) {
    file=(String)tokenizer.nextElement();
    equalIndex=file.indexOf(Constants.EQUAL);
    fileExtIndex=file.lastIndexOf(Constants.DOT);
    if (fileExtIndex != -1 && Constants.FILE_EXTENSION_DITAMAP.equalsIgnoreCase(file.substring(fileExtIndex))) {
      result.append(Constants.COMMA).append(file);
    }
 else     if (equalIndex == -1) {
      result.append(Constants.COMMA).append(FileUtils.replaceExtName(file,extName));
    }
 else {
      result.append(Constants.COMMA);
      result.append(FileUtils.replaceExtName(file.substring(0,equalIndex),extName));
      result.append(Constants.EQUAL);
      result.append(FileUtils.replaceExtName(file.substring(equalIndex + 1),extName));
    }
  }
  String list=result.substring(Constants.INT_1);
  property.setProperty(listName,list);
  String files[]=list.split(Constants.COMMA);
  String filename="String_Node_Str";
  if (listName.equals("String_Node_Str")) {
    filename="String_Node_Str";
  }
 else   filename=listName.substring(Constants.INT_0,listName.lastIndexOf("String_Node_Str")) + "String_Node_Str";
  Writer bufferedWriter=null;
  try {
    bufferedWriter=new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(tempDir,filename))));
    if (files.length > 0) {
      for (int i=0; i < files.length; i++) {
        bufferedWriter.write(files[i]);
        if (i < files.length - 1)         bufferedWriter.write("String_Node_Str");
        bufferedWriter.flush();
      }
    }
  }
 catch (  FileNotFoundException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
 finally {
    if (bufferedWriter != null) {
      try {
        bufferedWriter.close();
      }
 catch (      IOException e) {
        final DITAOTLogger logger=new DITAOTJavaLogger();
        logger.logException(e);
      }
    }
  }
}