Program: 28332
Project: 28332
Buggy source:
/** 
 * Method to delete files and directories on remote host 'nodes' directory is not considered for deletion since it would contain configuration information.
 * @param sftpClient sftp client instance
 * @param dasFiles file layout on DAS
 * @param dir directory to be removed
 * @param force true means delete all files, false means leave non-GlassFish filesuntouched
 * @throws IOException in case of error
 */
void deleteRemoteFiles(SFTPClient sftpClient,List<String> dasFiles,String dir,boolean force) throws IOException {
  for (  SFTPv3DirectoryEntry directoryEntry : (List<SFTPv3DirectoryEntry>)sftpClient.ls(dir)) {
    if (directoryEntry.filename.equals("String_Node_Str") || directoryEntry.filename.equals("String_Node_Str") || directoryEntry.filename.equals("String_Node_Str")) {
      continue;
    }
 else     if (directoryEntry.attributes.isDirectory()) {
      String f1=dir + "String_Node_Str" + directoryEntry.filename;
      deleteRemoteFiles(sftpClient,dasFiles,f1,force);
      if (force) {
        logger.fine("String_Node_Str" + f1);
        if (isRemoteDirectoryEmpty(sftpClient,f1)) {
          sftpClient.rmdir(f1);
        }
      }
 else {
        if (dasFiles.contains(f1)) {
          if (isRemoteDirectoryEmpty(sftpClient,f1)) {
            sftpClient.rmdir(f1);
          }
        }
      }
    }
 else {
      String f2=dir + "String_Node_Str" + directoryEntry.filename;
      if (force) {
        logger.fine("String_Node_Str" + f2);
        sftpClient.rm(f2);
      }
 else {
        if (dasFiles.contains(f2))         sftpClient.rm(f2);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Method to delete files and directories on remote host 'nodes' directory is not considered for deletion since it would contain configuration information.
 * @param sftpClient sftp client instance
 * @param dasFiles file layout on DAS
 * @param dir directory to be removed
 * @param force true means delete all files, false means leave non-GlassFish filesuntouched
 * @throws IOException in case of error
 */
void deleteRemoteFiles(SFTPClient sftpClient,List<String> dasFiles,String dir,boolean force) throws IOException {
  for (  SFTPv3DirectoryEntry directoryEntry : (List<SFTPv3DirectoryEntry>)sftpClient.ls(dir)) {
    if (directoryEntry.filename.equals("String_Node_Str") || directoryEntry.filename.equals("String_Node_Str") || directoryEntry.filename.equals("String_Node_Str")) {
      continue;
    }
 else     if (directoryEntry.attributes.isDirectory()) {
      String f1=dir + "String_Node_Str" + directoryEntry.filename;
      deleteRemoteFiles(sftpClient,dasFiles,f1,force);
      if (force) {
        if (logger.isLoggable(Level.FINE))         logger.fine("String_Node_Str" + f1);
        if (isRemoteDirectoryEmpty(sftpClient,f1)) {
          sftpClient.rmdir(f1);
        }
      }
 else {
        if (dasFiles.contains(f1)) {
          if (isRemoteDirectoryEmpty(sftpClient,f1)) {
            sftpClient.rmdir(f1);
          }
        }
      }
    }
 else {
      String f2=dir + "String_Node_Str" + directoryEntry.filename;
      if (force) {
        if (logger.isLoggable(Level.FINE))         logger.fine("String_Node_Str" + f2);
        sftpClient.rm(f2);
      }
 else {
        if (dasFiles.contains(f2))         sftpClient.rm(f2);
      }
    }
  }
}