Program: 105272
Project: 105272
Buggy source:
@Override public void processConnect(Host host,StartupCommand cmd,boolean forRebalance) throws ConnectionException {
  if (!(cmd instanceof StartupRoutingCommand)) {
    return;
  }
  long hostId=host.getId();
  StartupRoutingCommand startup=(StartupRoutingCommand)cmd;
  String dataCenter=startup.getDataCenter();
  long dcId=-1;
  DataCenterVO dc=_dcDao.findByName(dataCenter);
  if (dc == null) {
    try {
      dcId=Long.parseLong(dataCenter);
      dc=_dcDao.findById(dcId);
    }
 catch (    final NumberFormatException e) {
    }
  }
  if (dc == null) {
    throw new IllegalArgumentException("String_Node_Str" + startup.getPrivateIpAddress() + "String_Node_Str"+ dataCenter);
  }
  dcId=dc.getId();
  HypervisorType hypervisorType=startup.getHypervisorType();
  if (s_logger.isDebugEnabled()) {
    s_logger.debug("String_Node_Str" + hypervisorType);
  }
  List<PhysicalNetworkSetupInfo> networkInfoList=new ArrayList<PhysicalNetworkSetupInfo>();
  List<PhysicalNetworkVO> physicalNtwkList=_physicalNetworkDao.listByZone(dcId);
  for (  PhysicalNetworkVO pNtwk : physicalNtwkList) {
    String publicName=_pNTrafficTypeDao.getNetworkTag(pNtwk.getId(),TrafficType.Public,hypervisorType);
    String privateName=_pNTrafficTypeDao.getNetworkTag(pNtwk.getId(),TrafficType.Management,hypervisorType);
    String guestName=_pNTrafficTypeDao.getNetworkTag(pNtwk.getId(),TrafficType.Guest,hypervisorType);
    String storageName=_pNTrafficTypeDao.getNetworkTag(pNtwk.getId(),TrafficType.Storage,hypervisorType);
    PhysicalNetworkSetupInfo info=new PhysicalNetworkSetupInfo();
    info.setPhysicalNetworkId(pNtwk.getId());
    info.setGuestNetworkName(guestName);
    info.setPrivateNetworkName(privateName);
    info.setPublicNetworkName(publicName);
    info.setStorageNetworkName(storageName);
    PhysicalNetworkTrafficTypeVO mgmtTraffic=_pNTrafficTypeDao.findBy(pNtwk.getId(),TrafficType.Management);
    if (mgmtTraffic != null) {
      String vlan=mgmtTraffic.getVlan();
      info.setMgmtVlan(vlan);
    }
    networkInfoList.add(info);
  }
  if (s_logger.isDebugEnabled()) {
    s_logger.debug("String_Node_Str");
  }
  CheckNetworkCommand nwCmd=new CheckNetworkCommand(networkInfoList);
  CheckNetworkAnswer answer=(CheckNetworkAnswer)_agentMgr.easySend(hostId,nwCmd);
  if (answer == null) {
    s_logger.warn("String_Node_Str" + host.getId());
    throw new ConnectionException(true,"String_Node_Str" + host.getId());
  }
  if (!answer.getResult()) {
    s_logger.warn("String_Node_Str" + hostId + "String_Node_Str"+ ((answer != null) ? answer.getDetails() : "String_Node_Str"));
    String msg="String_Node_Str" + answer.getDetails();
    _alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_HOST,dcId,host.getPodId(),msg,msg);
    throw new ConnectionException(true,msg);
  }
 else {
    if (answer.needReconnect()) {
      throw new ConnectionException(false,"String_Node_Str");
    }
    if (s_logger.isDebugEnabled()) {
      s_logger.debug("String_Node_Str");
    }
    return;
  }
}

Fixed version (ground truth):
@Override public void processConnect(Host host,StartupCommand cmd,boolean forRebalance) throws ConnectionException {
  if (!(cmd instanceof StartupRoutingCommand)) {
    return;
  }
  long hostId=host.getId();
  StartupRoutingCommand startup=(StartupRoutingCommand)cmd;
  String dataCenter=startup.getDataCenter();
  long dcId=-1;
  DataCenterVO dc=_dcDao.findByName(dataCenter);
  if (dc == null) {
    try {
      dcId=Long.parseLong(dataCenter);
      dc=_dcDao.findById(dcId);
    }
 catch (    final NumberFormatException e) {
    }
  }
  if (dc == null) {
    throw new IllegalArgumentException("String_Node_Str" + startup.getPrivateIpAddress() + "String_Node_Str"+ dataCenter);
  }
  dcId=dc.getId();
  HypervisorType hypervisorType=startup.getHypervisorType();
  if (s_logger.isDebugEnabled()) {
    s_logger.debug("String_Node_Str" + hypervisorType);
  }
  List<PhysicalNetworkSetupInfo> networkInfoList=new ArrayList<PhysicalNetworkSetupInfo>();
  List<PhysicalNetworkVO> physicalNtwkList=_physicalNetworkDao.listByZone(dcId);
  for (  PhysicalNetworkVO pNtwk : physicalNtwkList) {
    String publicName=_pNTrafficTypeDao.getNetworkTag(pNtwk.getId(),TrafficType.Public,hypervisorType);
    String privateName=_pNTrafficTypeDao.getNetworkTag(pNtwk.getId(),TrafficType.Management,hypervisorType);
    String guestName=_pNTrafficTypeDao.getNetworkTag(pNtwk.getId(),TrafficType.Guest,hypervisorType);
    String storageName=_pNTrafficTypeDao.getNetworkTag(pNtwk.getId(),TrafficType.Storage,hypervisorType);
    PhysicalNetworkSetupInfo info=new PhysicalNetworkSetupInfo();
    info.setPhysicalNetworkId(pNtwk.getId());
    info.setGuestNetworkName(guestName);
    info.setPrivateNetworkName(privateName);
    info.setPublicNetworkName(publicName);
    info.setStorageNetworkName(storageName);
    PhysicalNetworkTrafficTypeVO mgmtTraffic=_pNTrafficTypeDao.findBy(pNtwk.getId(),TrafficType.Management);
    if (mgmtTraffic != null) {
      String vlan=mgmtTraffic.getVlan();
      info.setMgmtVlan(vlan);
    }
    networkInfoList.add(info);
  }
  if (s_logger.isDebugEnabled()) {
    s_logger.debug("String_Node_Str");
  }
  CheckNetworkCommand nwCmd=new CheckNetworkCommand(networkInfoList);
  CheckNetworkAnswer answer=(CheckNetworkAnswer)_agentMgr.easySend(hostId,nwCmd);
  if (answer == null) {
    s_logger.warn("String_Node_Str" + host.getId());
    throw new ConnectionException(true,"String_Node_Str" + host.getId());
  }
  if (!answer.getResult()) {
    s_logger.warn("String_Node_Str" + hostId + "String_Node_Str"+ answer.getDetails());
    String msg="String_Node_Str" + answer.getDetails();
    _alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_HOST,dcId,host.getPodId(),msg,msg);
    throw new ConnectionException(true,msg);
  }
 else {
    if (answer.needReconnect()) {
      throw new ConnectionException(false,"String_Node_Str");
    }
    if (s_logger.isDebugEnabled()) {
      s_logger.debug("String_Node_Str");
    }
    return;
  }
}