Program: 105819
Project: 105819
Buggy source:
@Override public final Map<? extends ServerResource,Map<String,String>> find(final long dcId,final Long podId,final Long clusterId,final URI uri,final String username,final String password,final List<String> hostTags) throws DiscoveryException {
  if (s_logger.isInfoEnabled()) {
    s_logger.info("String_Node_Str" + dcId + "String_Node_Str"+ podId+ "String_Node_Str"+ clusterId+ "String_Node_Str"+ uri.getHost());
  }
  if (podId == null) {
    if (s_logger.isInfoEnabled()) {
      s_logger.info("String_Node_Str" + "String_Node_Str");
    }
    return null;
  }
  ClusterVO cluster=_clusterDao.findById(clusterId);
  if (cluster == null) {
    if (s_logger.isInfoEnabled()) {
      s_logger.info("String_Node_Str" + clusterId);
    }
    return null;
  }
  if (cluster.getHypervisorType() != HypervisorType.Hyperv) {
    if (s_logger.isInfoEnabled()) {
      s_logger.info("String_Node_Str" + clusterId + "String_Node_Str");
    }
    return null;
  }
  if (!uri.getScheme().equals("String_Node_Str")) {
    String msg="String_Node_Str" + "String_Node_Str" + uri;
    s_logger.debug(msg);
    return null;
  }
  try {
    String hostname=uri.getHost();
    InetAddress ia=InetAddress.getByName(hostname);
    String agentIp=ia.getHostAddress();
    String uuidSeed=agentIp;
    String guidWithTail=calcServerResourceGuid(uuidSeed) + "String_Node_Str";
    if (_resourceMgr.findHostByGuid(guidWithTail) != null) {
      s_logger.debug("String_Node_Str" + agentIp + "String_Node_Str"+ guidWithTail+ "String_Node_Str");
      return null;
    }
    s_logger.info("String_Node_Str" + HypervDirectConnectResource.class.getName() + "String_Node_Str"+ dcId+ "String_Node_Str"+ podId+ "String_Node_Str"+ clusterId);
    if (cluster.getGuid() == null) {
      cluster.setGuid(UUID.nameUUIDFromBytes(String.valueOf(clusterId).getBytes()).toString());
      _clusterDao.update(clusterId,cluster);
    }
    Map<String,Object> params=new HashMap<String,Object>();
    params.put("String_Node_Str",Long.toString(dcId));
    params.put("String_Node_Str",Long.toString(podId));
    params.put("String_Node_Str",Long.toString(clusterId));
    params.put("String_Node_Str",guidWithTail);
    params.put("String_Node_Str",agentIp);
    Map<String,String> details=new HashMap<String,String>();
    details.put("String_Node_Str",uri.getHost());
    details.put("String_Node_Str",username);
    details.put("String_Node_Str",password);
    details.put("String_Node_Str",cluster.getGuid());
    params.putAll(details);
    HypervDirectConnectResource resource=new HypervDirectConnectResource();
    resource.configure(agentIp,params);
    ReadyCommand ping=new ReadyCommand();
    Answer pingAns=resource.executeRequest(ping);
    if (pingAns == null || !pingAns.getResult()) {
      String errMsg="String_Node_Str" + uri;
      s_logger.debug(errMsg);
      throw new DiscoveryException(errMsg);
    }
    Map<HypervDirectConnectResource,Map<String,String>> resources=new HashMap<HypervDirectConnectResource,Map<String,String>>();
    resources.put(resource,details);
    return resources;
  }
 catch (  ConfigurationException e) {
    _alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_HOST,dcId,podId,"String_Node_Str" + uri.getHost(),"String_Node_Str" + e.getMessage());
    s_logger.warn("String_Node_Str" + uri.getHost(),e);
  }
catch (  UnknownHostException e) {
    _alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_HOST,dcId,podId,"String_Node_Str" + uri.getHost(),"String_Node_Str" + e.getMessage());
    s_logger.warn("String_Node_Str" + uri.getHost(),e);
  }
catch (  Exception e) {
    String msg="String_Node_Str" + e.toString() + "String_Node_Str"+ e.getMessage();
    s_logger.warn(msg);
  }
  return null;
}

Fixed version (ground truth):
@Override public final Map<? extends ServerResource,Map<String,String>> find(final long dcId,final Long podId,final Long clusterId,final URI uri,final String username,final String password,final List<String> hostTags) throws DiscoveryException {
  if (s_logger.isInfoEnabled()) {
    s_logger.info("String_Node_Str" + dcId + "String_Node_Str"+ podId+ "String_Node_Str"+ clusterId+ "String_Node_Str"+ uri.getHost());
  }
  if (podId == null) {
    if (s_logger.isInfoEnabled()) {
      s_logger.info("String_Node_Str" + "String_Node_Str");
    }
    return null;
  }
  ClusterVO cluster=_clusterDao.findById(clusterId);
  if (cluster == null) {
    if (s_logger.isInfoEnabled()) {
      s_logger.info("String_Node_Str" + clusterId);
    }
    return null;
  }
  if (cluster.getHypervisorType() != HypervisorType.Hyperv) {
    if (s_logger.isInfoEnabled()) {
      s_logger.info("String_Node_Str" + clusterId + "String_Node_Str");
    }
    return null;
  }
  if (!uri.getScheme().equals("String_Node_Str")) {
    String msg="String_Node_Str" + "String_Node_Str" + uri;
    s_logger.debug(msg);
    return null;
  }
  try {
    String hostname=uri.getHost();
    InetAddress ia=InetAddress.getByName(hostname);
    String agentIp=ia.getHostAddress();
    String uuidSeed=agentIp;
    String guidWithTail=calcServerResourceGuid(uuidSeed) + "String_Node_Str";
    if (_resourceMgr.findHostByGuid(guidWithTail) != null) {
      s_logger.debug("String_Node_Str" + agentIp + "String_Node_Str"+ guidWithTail+ "String_Node_Str");
      return null;
    }
    s_logger.info("String_Node_Str" + HypervDirectConnectResource.class.getName() + "String_Node_Str"+ dcId+ "String_Node_Str"+ podId+ "String_Node_Str"+ clusterId);
    if (cluster.getGuid() == null) {
      cluster.setGuid(UUID.nameUUIDFromBytes(String.valueOf(clusterId).getBytes(Charset.forName("String_Node_Str"))).toString());
      _clusterDao.update(clusterId,cluster);
    }
    Map<String,Object> params=new HashMap<String,Object>();
    params.put("String_Node_Str",Long.toString(dcId));
    params.put("String_Node_Str",Long.toString(podId));
    params.put("String_Node_Str",Long.toString(clusterId));
    params.put("String_Node_Str",guidWithTail);
    params.put("String_Node_Str",agentIp);
    Map<String,String> details=new HashMap<String,String>();
    details.put("String_Node_Str",uri.getHost());
    details.put("String_Node_Str",username);
    details.put("String_Node_Str",password);
    details.put("String_Node_Str",cluster.getGuid());
    params.putAll(details);
    HypervDirectConnectResource resource=new HypervDirectConnectResource();
    resource.configure(agentIp,params);
    ReadyCommand ping=new ReadyCommand();
    Answer pingAns=resource.executeRequest(ping);
    if (pingAns == null || !pingAns.getResult()) {
      String errMsg="String_Node_Str" + uri;
      s_logger.debug(errMsg);
      throw new DiscoveryException(errMsg);
    }
    Map<HypervDirectConnectResource,Map<String,String>> resources=new HashMap<HypervDirectConnectResource,Map<String,String>>();
    resources.put(resource,details);
    return resources;
  }
 catch (  ConfigurationException e) {
    _alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_HOST,dcId,podId,"String_Node_Str" + uri.getHost(),"String_Node_Str" + e.getMessage());
    s_logger.warn("String_Node_Str" + uri.getHost(),e);
  }
catch (  UnknownHostException e) {
    _alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_HOST,dcId,podId,"String_Node_Str" + uri.getHost(),"String_Node_Str" + e.getMessage());
    s_logger.warn("String_Node_Str" + uri.getHost(),e);
  }
catch (  Exception e) {
    String msg="String_Node_Str" + e.toString() + "String_Node_Str"+ e.getMessage();
    s_logger.warn(msg);
  }
  return null;
}