Program: 4388
Project: 4388
Buggy source:
@Override public void execute() throws Exception {
  if (!ElasticsearchProcessMonitor.isElasticsearchRunning()) {
    String exceptionMsg="String_Node_Str";
    logger.info(exceptionMsg);
    return;
  }
  if (config.reportMetricsFromMasterOnly() && EsUtils.amIMasterNode(config,httpModule)) {
    return;
  }
  HealthBean healthBean=new HealthBean();
  try {
    Client esTransportClient=ESTransportClient.instance(config).getTransportClient();
    ClusterHealthStatus clusterHealthStatus=esTransportClient.admin().cluster().prepareHealth().setTimeout(MASTER_NODE_TIMEOUT).execute().get().getStatus();
    ClusterHealthResponse clusterHealthResponse=esTransportClient.admin().cluster().prepareHealth().execute().actionGet(MASTER_NODE_TIMEOUT);
    if (clusterHealthStatus == null) {
      logger.info("String_Node_Str");
      resetHealthStats(healthBean);
      return;
    }
    if (clusterHealthStatus.name().equalsIgnoreCase("String_Node_Str")) {
      healthBean.greenorredstatus=0;
      healthBean.greenoryellowstatus=0;
    }
 else     if (clusterHealthStatus.name().equalsIgnoreCase("String_Node_Str")) {
      healthBean.greenoryellowstatus=1;
      healthBean.greenorredstatus=0;
    }
 else     if (clusterHealthStatus.name().equalsIgnoreCase("String_Node_Str")) {
      healthBean.greenorredstatus=1;
      healthBean.greenoryellowstatus=0;
    }
    if (config.isNodeMismatchWithDiscoveryEnabled())     healthBean.nodematch=(clusterHealthResponse.getNumberOfNodes() == instanceManager.getAllInstances().size()) ? 0 : 1;
 else     healthBean.nodematch=(clusterHealthResponse.getNumberOfNodes() == config.getDesiredNumberOfNodesInCluster()) ? 0 : 1;
    if (config.isEurekaHealthCheckEnabled())     healthBean.eurekanodematch=(clusterHealthResponse.getNumberOfNodes() == discoveryClient.getApplication(config.getAppName()).getInstances().size()) ? 0 : 1;
  }
 catch (  Exception e) {
    resetHealthStats(healthBean);
    logger.warn("String_Node_Str",e);
  }
  healthReporter.healthBean.set(healthBean);
}

Fixed version (ground truth):
@Override public void execute() throws Exception {
  if (!ElasticsearchProcessMonitor.isElasticsearchRunning()) {
    String exceptionMsg="String_Node_Str";
    logger.info(exceptionMsg);
    return;
  }
  if (config.reportMetricsFromMasterOnly() && !EsUtils.amIMasterNode(config,httpModule)) {
    return;
  }
  HealthBean healthBean=new HealthBean();
  try {
    Client esTransportClient=ESTransportClient.instance(config).getTransportClient();
    ClusterHealthStatus clusterHealthStatus=esTransportClient.admin().cluster().prepareHealth().setTimeout(MASTER_NODE_TIMEOUT).execute().get().getStatus();
    ClusterHealthResponse clusterHealthResponse=esTransportClient.admin().cluster().prepareHealth().execute().actionGet(MASTER_NODE_TIMEOUT);
    if (clusterHealthStatus == null) {
      logger.info("String_Node_Str");
      resetHealthStats(healthBean);
      return;
    }
    if (clusterHealthStatus.name().equalsIgnoreCase("String_Node_Str")) {
      healthBean.greenorredstatus=0;
      healthBean.greenoryellowstatus=0;
    }
 else     if (clusterHealthStatus.name().equalsIgnoreCase("String_Node_Str")) {
      healthBean.greenoryellowstatus=1;
      healthBean.greenorredstatus=0;
    }
 else     if (clusterHealthStatus.name().equalsIgnoreCase("String_Node_Str")) {
      healthBean.greenorredstatus=1;
      healthBean.greenoryellowstatus=0;
    }
    if (config.isNodeMismatchWithDiscoveryEnabled())     healthBean.nodematch=(clusterHealthResponse.getNumberOfNodes() == instanceManager.getAllInstances().size()) ? 0 : 1;
 else     healthBean.nodematch=(clusterHealthResponse.getNumberOfNodes() == config.getDesiredNumberOfNodesInCluster()) ? 0 : 1;
    if (config.isEurekaHealthCheckEnabled())     healthBean.eurekanodematch=(clusterHealthResponse.getNumberOfNodes() == discoveryClient.getApplication(config.getAppName()).getInstances().size()) ? 0 : 1;
  }
 catch (  Exception e) {
    resetHealthStats(healthBean);
    logger.warn("String_Node_Str",e);
  }
  healthReporter.healthBean.set(healthBean);
}