Program: 30347
Project: 30347
Buggy source:
public void execute(AdminCommandContext context){
  report=context.getActionReport();
  logger=context.getLogger();
  SSHLauncher launcher;
  RemoteConnectHelper rch;
  int dasPort;
  String dasHost;
  if (env.isDas()) {
    if (kill) {
      errorMessage=killInstance(context);
    }
 else {
      errorMessage=callInstance();
    }
  }
 else {
    errorMessage=Strings.get("String_Node_Str",env.getRuntimeType().toString());
  }
  if (errorMessage == null && !kill) {
    errorMessage=pollForDeath();
  }
  if (errorMessage != null) {
    report.setActionExitCode(ActionReport.ExitCode.FAILURE);
    report.setMessage(errorMessage);
    return;
  }
  report.setActionExitCode(ActionReport.ExitCode.SUCCESS);
  report.setMessage(Strings.get("String_Node_Str",instanceName));
  if (kill) {
    return;
  }
  String nodeName=instance.getNodeRef();
  Node node=nodes.getNode(nodeName);
  String nodeHost=node.getNodeHost();
  InstanceDirUtils insDU=new InstanceDirUtils(node,serverContext);
  try {
    pidFile=new File(insDU.getLocalInstanceDir(instance.getName()),"String_Node_Str");
  }
 catch (  java.io.IOException eio) {
    return;
  }
  dasPort=helper.getAdminPort(SystemPropertyConstants.DAS_SERVER_NAME);
  dasHost=System.getProperty(SystemPropertyConstants.HOST_NAME_PROPERTY);
  rch=new RemoteConnectHelper(habitat,node,logger,dasHost,dasPort);
  if (rch.isLocalhost()) {
    if (pidFile.exists()) {
      errorMessage=pollForRealDeath("String_Node_Str");
    }
  }
 else   if (node.getType().equals("String_Node_Str")) {
    launcher=habitat.getComponent(SSHLauncher.class);
    launcher.init(node,logger);
    try {
      ftpClient=launcher.getSFTPClient();
      if (ftpClient.exists(pidFile.toString())) {
        errorMessage=pollForRealDeath("String_Node_Str");
      }
    }
 catch (    IOException ex) {
    }
  }
  if (errorMessage != null) {
    report.setActionExitCode(ActionReport.ExitCode.FAILURE);
    report.setMessage(errorMessage);
  }
}

Fixed version (ground truth):
public void execute(AdminCommandContext context){
  report=context.getActionReport();
  logger=context.getLogger();
  SSHLauncher launcher;
  int dasPort;
  String dasHost;
  if (env.isDas()) {
    if (kill) {
      errorMessage=killInstance(context);
    }
 else {
      errorMessage=callInstance();
    }
  }
 else {
    errorMessage=Strings.get("String_Node_Str",env.getRuntimeType().toString());
  }
  if (errorMessage == null && !kill) {
    errorMessage=pollForDeath();
  }
  if (errorMessage != null) {
    report.setActionExitCode(ActionReport.ExitCode.FAILURE);
    report.setMessage(errorMessage);
    return;
  }
  report.setActionExitCode(ActionReport.ExitCode.SUCCESS);
  report.setMessage(Strings.get("String_Node_Str",instanceName));
  if (kill) {
    return;
  }
  String nodeName=instance.getNodeRef();
  Node node=nodes.getNode(nodeName);
  String nodeHost=node.getNodeHost();
  InstanceDirUtils insDU=new InstanceDirUtils(node,serverContext);
  try {
    pidFile=new File(insDU.getLocalInstanceDir(instance.getName()),"String_Node_Str");
  }
 catch (  java.io.IOException eio) {
    return;
  }
  dasPort=helper.getAdminPort(SystemPropertyConstants.DAS_SERVER_NAME);
  dasHost=System.getProperty(SystemPropertyConstants.HOST_NAME_PROPERTY);
  if (node.isLocal()) {
    if (pidFile.exists()) {
      errorMessage=pollForRealDeath("String_Node_Str");
    }
  }
 else   if (node.getType().equals("String_Node_Str")) {
    launcher=habitat.getComponent(SSHLauncher.class);
    launcher.init(node,logger);
    try {
      ftpClient=launcher.getSFTPClient();
      if (ftpClient.exists(pidFile.toString())) {
        errorMessage=pollForRealDeath("String_Node_Str");
      }
    }
 catch (    IOException ex) {
    }
  }
  if (errorMessage != null) {
    report.setActionExitCode(ActionReport.ExitCode.FAILURE);
    report.setMessage(errorMessage);
  }
}