Program: 48539
Project: 48539
Buggy source:
@Override public ClusterReport queryClusterStatus(ClusterBlueprint blueprint) throws SoftwareManagementPluginException {
  if (blueprint == null) {
    logger.info("String_Node_Str");
    return null;
  }
  try {
    CmClusterDef cluster=new CmClusterDef(blueprint);
    syncHostsId(cluster);
    if (isExistingServiceStarted(cluster.getName())) {
      ApiHealthSummary summary=getExistingServiceHealthStatus(cluster.getName());
      if (summary.ordinal() >= ApiHealthSummary.GOOD.ordinal()) {
        if (summary.ordinal() == ApiHealthSummary.GOOD.ordinal()) {
          cluster.getCurrentReport().setStatus(ServiceStatus.STARTED);
          logger.debug("String_Node_Str" + blueprint.getName() + "String_Node_Str");
        }
 else {
          cluster.getCurrentReport().setStatus(ServiceStatus.ALERT);
          logger.debug("String_Node_Str" + blueprint.getName() + "String_Node_Str");
        }
      }
 else {
        cluster.getCurrentReport().setStatus(ServiceStatus.STARTED);
        logger.debug("String_Node_Str" + blueprint.getName() + "String_Node_Str");
      }
    }
 else {
      logger.debug("String_Node_Str" + blueprint.getName() + "String_Node_Str");
      cluster.getCurrentReport().setStatus(ServiceStatus.STOPPED);
    }
    queryNodesStatus(cluster);
    return cluster.getCurrentReport().clone();
  }
 catch (  Exception e) {
    throw SoftwareManagementPluginException.QUERY_CLUSTER_STATUS_FAILED(blueprint.getName(),e);
  }
}

Fixed version (ground truth):
@Override public ClusterReport queryClusterStatus(ClusterBlueprint blueprint) throws SoftwareManagementPluginException {
  if (blueprint == null) {
    logger.info("String_Node_Str");
    return null;
  }
  try {
    CmClusterDef cluster=new CmClusterDef(blueprint);
    syncHostsId(cluster);
    boolean allStarted=true;
    boolean allStopped=true;
    for (    ApiService apiService : apiResourceRootV6.getClustersResource().getServicesResource(cluster.getName()).readServices(DataView.SUMMARY)) {
      ApiServiceState serviceState=apiService.getServiceState();
      if (!ApiServiceState.STARTED.equals(serviceState)) {
        allStarted=false;
      }
 else {
        allStopped=false;
      }
    }
    if (allStopped) {
      logger.debug("String_Node_Str" + blueprint.getName() + "String_Node_Str");
      cluster.getCurrentReport().setStatus(ServiceStatus.STOPPED);
    }
 else     if (allStarted) {
      ApiHealthSummary summary=getExistingServiceHealthStatus(cluster.getName());
switch (summary) {
case GOOD:
        cluster.getCurrentReport().setStatus(ServiceStatus.STARTED);
      logger.debug("String_Node_Str" + blueprint.getName() + "String_Node_Str");
    break;
case BAD:
case CONCERNING:
  cluster.getCurrentReport().setStatus(ServiceStatus.ALERT);
logger.debug("String_Node_Str" + blueprint.getName() + "String_Node_Str");
break;
default :
cluster.getCurrentReport().setStatus(ServiceStatus.STARTED);
logger.debug("String_Node_Str" + blueprint.getName() + "String_Node_Str");
break;
}
}
 else {
cluster.getCurrentReport().setStatus(ServiceStatus.ALERT);
logger.debug("String_Node_Str" + blueprint.getName() + "String_Node_Str");
}
queryNodesStatus(cluster);
return cluster.getCurrentReport().clone();
}
 catch (Exception e) {
throw SoftwareManagementPluginException.QUERY_CLUSTER_STATUS_FAILED(blueprint.getName(),e);
}
}