Program: 106609
Project: 106609
Buggy source:
private VmDataCommand generateVmDataCommand(DomainRouterVO router,String vmPrivateIpAddress,String userData,String serviceOffering,String zoneName,String guestIpAddress,String vmName,String vmInstanceName,long vmId,String publicKey){
  VmDataCommand cmd=new VmDataCommand(vmPrivateIpAddress,vmName);
  cmd.setAccessDetail(NetworkElementCommand.ROUTER_IP,router.getPrivateIpAddress());
  cmd.setAccessDetail(NetworkElementCommand.ROUTER_GUEST_IP,router.getGuestIpAddress());
  cmd.setAccessDetail(NetworkElementCommand.ROUTER_NAME,router.getInstanceName());
  DataCenterVO dcVo=_dcDao.findById(router.getDataCenterIdToDeployIn());
  cmd.setAccessDetail(NetworkElementCommand.ZONE_NETWORK_TYPE,dcVo.getNetworkType().toString());
  cmd.addVmData("String_Node_Str","String_Node_Str",userData);
  cmd.addVmData("String_Node_Str","String_Node_Str",StringUtils.unicodeEscape(serviceOffering));
  cmd.addVmData("String_Node_Str","String_Node_Str",StringUtils.unicodeEscape(zoneName));
  cmd.addVmData("String_Node_Str","String_Node_Str",guestIpAddress);
  cmd.addVmData("String_Node_Str","String_Node_Str",StringUtils.unicodeEscape(vmName));
  if (dcVo.getNetworkType() == NetworkType.Basic) {
    cmd.addVmData("String_Node_Str","String_Node_Str",guestIpAddress);
    cmd.addVmData("String_Node_Str","String_Node_Str",StringUtils.unicodeEscape(vmName));
  }
 else {
    cmd.addVmData("String_Node_Str","String_Node_Str",router.getPublicIpAddress());
    cmd.addVmData("String_Node_Str","String_Node_Str",router.getPublicIpAddress());
  }
  cmd.addVmData("String_Node_Str","String_Node_Str",vmInstanceName);
  cmd.addVmData("String_Node_Str","String_Node_Str",String.valueOf(vmId));
  cmd.addVmData("String_Node_Str","String_Node_Str",publicKey);
  String cloudIdentifier=_configDao.getValue("String_Node_Str");
  if (cloudIdentifier == null) {
    cloudIdentifier="String_Node_Str";
  }
 else {
    cloudIdentifier="String_Node_Str" + cloudIdentifier + "String_Node_Str";
  }
  cmd.addVmData("String_Node_Str","String_Node_Str",cloudIdentifier);
  return cmd;
}

Fixed version (ground truth):
private VmDataCommand generateVmDataCommand(DomainRouterVO router,String vmPrivateIpAddress,String userData,String serviceOffering,String zoneName,String guestIpAddress,String vmName,String vmInstanceName,long vmId,String publicKey){
  VmDataCommand cmd=new VmDataCommand(vmPrivateIpAddress,vmName);
  cmd.setAccessDetail(NetworkElementCommand.ROUTER_IP,router.getPrivateIpAddress());
  cmd.setAccessDetail(NetworkElementCommand.ROUTER_GUEST_IP,router.getGuestIpAddress());
  cmd.setAccessDetail(NetworkElementCommand.ROUTER_NAME,router.getInstanceName());
  DataCenterVO dcVo=_dcDao.findById(router.getDataCenterIdToDeployIn());
  cmd.setAccessDetail(NetworkElementCommand.ZONE_NETWORK_TYPE,dcVo.getNetworkType().toString());
  cmd.addVmData("String_Node_Str","String_Node_Str",userData);
  cmd.addVmData("String_Node_Str","String_Node_Str",StringUtils.unicodeEscape(serviceOffering));
  cmd.addVmData("String_Node_Str","String_Node_Str",StringUtils.unicodeEscape(zoneName));
  cmd.addVmData("String_Node_Str","String_Node_Str",guestIpAddress);
  cmd.addVmData("String_Node_Str","String_Node_Str",StringUtils.unicodeEscape(vmName));
  if (dcVo.getNetworkType() == NetworkType.Basic) {
    cmd.addVmData("String_Node_Str","String_Node_Str",guestIpAddress);
    cmd.addVmData("String_Node_Str","String_Node_Str",StringUtils.unicodeEscape(vmName));
  }
 else {
    if (router.getPublicIpAddress() == null) {
      cmd.addVmData("String_Node_Str","String_Node_Str",guestIpAddress);
    }
 else {
      cmd.addVmData("String_Node_Str","String_Node_Str",router.getPublicIpAddress());
    }
    cmd.addVmData("String_Node_Str","String_Node_Str",router.getPublicIpAddress());
  }
  cmd.addVmData("String_Node_Str","String_Node_Str",vmInstanceName);
  cmd.addVmData("String_Node_Str","String_Node_Str",String.valueOf(vmId));
  cmd.addVmData("String_Node_Str","String_Node_Str",publicKey);
  String cloudIdentifier=_configDao.getValue("String_Node_Str");
  if (cloudIdentifier == null) {
    cloudIdentifier="String_Node_Str";
  }
 else {
    cloudIdentifier="String_Node_Str" + cloudIdentifier + "String_Node_Str";
  }
  cmd.addVmData("String_Node_Str","String_Node_Str",cloudIdentifier);
  return cmd;
}