Program: 90886
Project: 90886
Buggy source:
/** 
 * Purge and rename old log files in preparation for rollover
 * @param lowIndex  low index
 * @param highIndex high index.  Log file associated with high index will be deleted if needed.
 * @param manager The RollingFileManager
 * @return true if purge was successful and rollover should be attempted.
 */
private boolean purge(final int lowIndex,final int highIndex,RollingFileManager manager){
  int suffixLength=0;
  List<FileRenameAction> renames=new ArrayList<FileRenameAction>();
  StringBuilder buf=new StringBuilder();
  manager.getProcessor().formatFileName(lowIndex,buf);
  String lowFilename=buf.toString();
  if (lowFilename.endsWith("String_Node_Str")) {
    suffixLength=3;
  }
 else   if (lowFilename.endsWith("String_Node_Str")) {
    suffixLength=4;
  }
  for (int i=lowIndex; i <= highIndex; i++) {
    File toRename=new File(lowFilename);
    boolean isBase=false;
    if (suffixLength > 0) {
      File toRenameBase=new File(lowFilename.substring(0,lowFilename.length() - suffixLength));
      if (toRename.exists()) {
        if (toRenameBase.exists()) {
          toRenameBase.delete();
        }
      }
 else {
        toRename=toRenameBase;
        isBase=true;
      }
    }
    if (toRename.exists()) {
      if (i == highIndex) {
        if (!toRename.delete()) {
          return false;
        }
        break;
      }
      buf.setLength(0);
      manager.getProcessor().formatFileName(i + 1,buf);
      String highFilename=buf.toString();
      String renameTo=highFilename;
      if (isBase) {
        renameTo=highFilename.substring(0,highFilename.length() - suffixLength);
      }
      renames.add(new FileRenameAction(toRename,new File(renameTo),true));
      lowFilename=highFilename;
    }
 else {
      break;
    }
  }
  for (int i=renames.size() - 1; i >= 0; i--) {
    Action action=renames.get(i);
    try {
      if (!action.execute()) {
        return false;
      }
    }
 catch (    Exception ex) {
      logger.warn("String_Node_Str",ex);
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Purge and rename old log files in preparation for rollover
 * @param lowIndex  low index
 * @param highIndex high index.  Log file associated with high index will be deleted if needed.
 * @param manager The RollingFileManager
 * @return true if purge was successful and rollover should be attempted.
 */
private boolean purge(final int lowIndex,final int highIndex,RollingFileManager manager){
  int suffixLength=0;
  List<FileRenameAction> renames=new ArrayList<FileRenameAction>();
  StringBuilder buf=new StringBuilder();
  manager.getProcessor().formatFileName(lowIndex,buf);
  String lowFilename=buf.toString();
  if (lowFilename.endsWith("String_Node_Str")) {
    suffixLength=3;
  }
 else   if (lowFilename.endsWith("String_Node_Str")) {
    suffixLength=4;
  }
  for (int i=lowIndex; i <= highIndex; i++) {
    File toRename=new File(lowFilename);
    boolean isBase=false;
    if (suffixLength > 0) {
      File toRenameBase=new File(lowFilename.substring(0,lowFilename.length() - suffixLength));
      if (toRename.exists()) {
        if (toRenameBase.exists()) {
          toRenameBase.delete();
        }
      }
 else {
        toRename=toRenameBase;
        isBase=true;
      }
    }
    if (toRename.exists()) {
      if (i == highIndex) {
        if (!toRename.delete()) {
          return false;
        }
        break;
      }
      buf.setLength(0);
      manager.getProcessor().formatFileName(i + 1,buf);
      String highFilename=buf.toString();
      String renameTo=highFilename;
      if (isBase) {
        renameTo=highFilename.substring(0,highFilename.length() - suffixLength);
      }
      renames.add(new FileRenameAction(toRename,new File(renameTo),true));
      lowFilename=highFilename;
    }
 else {
      break;
    }
  }
  for (int i=renames.size() - 1; i >= 0; i--) {
    Action action=renames.get(i);
    try {
      if (!action.execute()) {
        return false;
      }
    }
 catch (    Exception ex) {
      LOGGER.warn("String_Node_Str",ex);
      return false;
    }
  }
  return true;
}