Program: 105586
Project: 105586
Buggy source:
protected boolean getHostInfo(Connection conn) throws IllegalArgumentException {
  try {
    Host myself=Host.getByUuid(conn,_host.uuid);
    Set<HostCpu> hcs=null;
    for (int i=0; i < 10; i++) {
      hcs=myself.getHostCPUs(conn);
      _host.cpus=hcs.size();
      if (_host.cpus > 0) {
        break;
      }
      Thread.sleep(5000);
    }
    if (_host.cpus <= 0) {
      throw new CloudRuntimeException("String_Node_Str" + _host.ip);
    }
    Map<String,String> cpuInfo=myself.getCpuInfo(conn);
    if (cpuInfo.get("String_Node_Str") != null) {
      _host.cpuSockets=Integer.parseInt(cpuInfo.get("String_Node_Str"));
    }
    for (    final HostCpu hc : hcs) {
      _host.speed=hc.getSpeed(conn).intValue();
      break;
    }
    Host.Record hr=myself.getRecord(conn);
    _host.productVersion=hr.softwareVersion.get("String_Node_Str");
    if (_host.productVersion == null) {
      _host.productVersion=hr.softwareVersion.get("String_Node_Str");
    }
 else {
      _host.productVersion=_host.productVersion.trim();
    }
    XsLocalNetwork privateNic=getManagementNetwork(conn);
    _privateNetworkName=privateNic.getNetworkRecord(conn).nameLabel;
    _host.privatePif=privateNic.getPifRecord(conn).uuid;
    _host.privateNetwork=privateNic.getNetworkRecord(conn).uuid;
    _host.systemvmisouuid=null;
    XsLocalNetwork guestNic=null;
    if (_guestNetworkName != null && !_guestNetworkName.equals(_privateNetworkName)) {
      guestNic=getNetworkByName(conn,_guestNetworkName);
      if (guestNic == null) {
        s_logger.warn("String_Node_Str" + _guestNetworkName);
        throw new IllegalArgumentException("String_Node_Str" + _guestNetworkName + "String_Node_Str"+ _host.ip);
      }
    }
 else {
      guestNic=privateNic;
      _guestNetworkName=_privateNetworkName;
    }
    _host.guestNetwork=guestNic.getNetworkRecord(conn).uuid;
    _host.guestPif=guestNic.getPifRecord(conn).uuid;
    XsLocalNetwork publicNic=null;
    if (_publicNetworkName != null && !_publicNetworkName.equals(_guestNetworkName)) {
      publicNic=getNetworkByName(conn,_publicNetworkName);
      if (publicNic == null) {
        s_logger.warn("String_Node_Str" + _publicNetworkName + "String_Node_Str"+ _host.ip);
        throw new IllegalArgumentException("String_Node_Str" + _publicNetworkName + "String_Node_Str"+ _host.ip);
      }
    }
 else {
      publicNic=guestNic;
      _publicNetworkName=_guestNetworkName;
    }
    _host.publicPif=publicNic.getPifRecord(conn).uuid;
    _host.publicNetwork=publicNic.getNetworkRecord(conn).uuid;
    if (_storageNetworkName1 == null) {
      _storageNetworkName1=_guestNetworkName;
    }
    XsLocalNetwork storageNic1=null;
    storageNic1=getNetworkByName(conn,_storageNetworkName1);
    if (storageNic1 == null) {
      s_logger.warn("String_Node_Str" + _storageNetworkName1 + "String_Node_Str"+ _host.ip);
      throw new IllegalArgumentException("String_Node_Str" + _storageNetworkName1 + "String_Node_Str"+ _host.ip);
    }
 else {
      _host.storageNetwork1=storageNic1.getNetworkRecord(conn).uuid;
      _host.storagePif1=storageNic1.getPifRecord(conn).uuid;
    }
    XsLocalNetwork storageNic2=null;
    if (_storageNetworkName2 != null) {
      storageNic2=getNetworkByName(conn,_storageNetworkName2);
      _host.storageNetwork2=storageNic2.getNetworkRecord(conn).uuid;
      _host.storagePif2=storageNic2.getPifRecord(conn).uuid;
    }
    s_logger.info("String_Node_Str" + _privateNetworkName + "String_Node_Str"+ _host.ip);
    s_logger.info("String_Node_Str" + _guestNetworkName + "String_Node_Str"+ _host.ip);
    s_logger.info("String_Node_Str" + _publicNetworkName + "String_Node_Str"+ _host.ip);
    return true;
  }
 catch (  XenAPIException e) {
    s_logger.warn("String_Node_Str" + _host.ip,e);
    return false;
  }
catch (  Exception e) {
    s_logger.warn("String_Node_Str" + _host.ip,e);
    return false;
  }
}

Fixed version (ground truth):
protected boolean getHostInfo(Connection conn) throws IllegalArgumentException {
  try {
    Host myself=Host.getByUuid(conn,_host.uuid);
    Set<HostCpu> hcs=null;
    for (int i=0; i < 10; i++) {
      hcs=myself.getHostCPUs(conn);
      if (hcs != null) {
        _host.cpus=hcs.size();
        if (_host.cpus > 0) {
          break;
        }
      }
      Thread.sleep(5000);
    }
    if (_host.cpus <= 0) {
      throw new CloudRuntimeException("String_Node_Str" + _host.ip);
    }
    Map<String,String> cpuInfo=myself.getCpuInfo(conn);
    if (cpuInfo.get("String_Node_Str") != null) {
      _host.cpuSockets=Integer.parseInt(cpuInfo.get("String_Node_Str"));
    }
    for (    final HostCpu hc : hcs) {
      _host.speed=hc.getSpeed(conn).intValue();
      break;
    }
    Host.Record hr=myself.getRecord(conn);
    _host.productVersion=hr.softwareVersion.get("String_Node_Str");
    if (_host.productVersion == null) {
      _host.productVersion=hr.softwareVersion.get("String_Node_Str");
    }
 else {
      _host.productVersion=_host.productVersion.trim();
    }
    XsLocalNetwork privateNic=getManagementNetwork(conn);
    _privateNetworkName=privateNic.getNetworkRecord(conn).nameLabel;
    _host.privatePif=privateNic.getPifRecord(conn).uuid;
    _host.privateNetwork=privateNic.getNetworkRecord(conn).uuid;
    _host.systemvmisouuid=null;
    XsLocalNetwork guestNic=null;
    if (_guestNetworkName != null && !_guestNetworkName.equals(_privateNetworkName)) {
      guestNic=getNetworkByName(conn,_guestNetworkName);
      if (guestNic == null) {
        s_logger.warn("String_Node_Str" + _guestNetworkName);
        throw new IllegalArgumentException("String_Node_Str" + _guestNetworkName + "String_Node_Str"+ _host.ip);
      }
    }
 else {
      guestNic=privateNic;
      _guestNetworkName=_privateNetworkName;
    }
    _host.guestNetwork=guestNic.getNetworkRecord(conn).uuid;
    _host.guestPif=guestNic.getPifRecord(conn).uuid;
    XsLocalNetwork publicNic=null;
    if (_publicNetworkName != null && !_publicNetworkName.equals(_guestNetworkName)) {
      publicNic=getNetworkByName(conn,_publicNetworkName);
      if (publicNic == null) {
        s_logger.warn("String_Node_Str" + _publicNetworkName + "String_Node_Str"+ _host.ip);
        throw new IllegalArgumentException("String_Node_Str" + _publicNetworkName + "String_Node_Str"+ _host.ip);
      }
    }
 else {
      publicNic=guestNic;
      _publicNetworkName=_guestNetworkName;
    }
    _host.publicPif=publicNic.getPifRecord(conn).uuid;
    _host.publicNetwork=publicNic.getNetworkRecord(conn).uuid;
    if (_storageNetworkName1 == null) {
      _storageNetworkName1=_guestNetworkName;
    }
    XsLocalNetwork storageNic1=null;
    storageNic1=getNetworkByName(conn,_storageNetworkName1);
    if (storageNic1 == null) {
      s_logger.warn("String_Node_Str" + _storageNetworkName1 + "String_Node_Str"+ _host.ip);
      throw new IllegalArgumentException("String_Node_Str" + _storageNetworkName1 + "String_Node_Str"+ _host.ip);
    }
 else {
      _host.storageNetwork1=storageNic1.getNetworkRecord(conn).uuid;
      _host.storagePif1=storageNic1.getPifRecord(conn).uuid;
    }
    XsLocalNetwork storageNic2=null;
    if (_storageNetworkName2 != null) {
      storageNic2=getNetworkByName(conn,_storageNetworkName2);
      if (storageNic2 != null) {
        _host.storagePif2=storageNic2.getPifRecord(conn).uuid;
      }
    }
    s_logger.info("String_Node_Str" + _privateNetworkName + "String_Node_Str"+ _host.ip);
    s_logger.info("String_Node_Str" + _guestNetworkName + "String_Node_Str"+ _host.ip);
    s_logger.info("String_Node_Str" + _publicNetworkName + "String_Node_Str"+ _host.ip);
    return true;
  }
 catch (  XenAPIException e) {
    s_logger.warn("String_Node_Str" + _host.ip,e);
    return false;
  }
catch (  Exception e) {
    s_logger.warn("String_Node_Str" + _host.ip,e);
    return false;
  }
}