Program: 48300
Project: 48300
Buggy source:
@Override public ClusterRead findClusterWithNodes(String clusterName,boolean includeVolumes){
  ClusterEntity cluster=clusterDao.findWithNodes(clusterName,includeVolumes);
  ClusterRead clusterRead=RestObjectManager.clusterEntityToRead(cluster);
  SoftwareManager softMgr=null;
  try {
    softMgr=softwareManagerCollector.getSoftwareManager(cluster.getAppManager());
  }
 catch (  Exception e) {
    logger.error("String_Node_Str");
  }
  int clusterInstanceNum=0;
  List<NodeGroupRead> ngReads=new ArrayList<>();
  List<VcResourcePoolEntity> rps=new ArrayList<>();
  for (  NodeGroupEntity ng : cluster.getNodeGroupsSortedById()) {
    NodeGroupRead ngRead=RestObjectManager.nodeGroupEntityToRead(ng);
    List<NodeRead> nodeReads=new ArrayList<>();
    for (    NodeEntity node : ng.getNodes()) {
      nodeReads.add(RestObjectManager.nodeEntityToRead(node,includeVolumes));
    }
    ngRead.setInstances(nodeReads);
    int instanceNum=this.nodeDao.getCountByNodeGroup(ng.getId());
    ngRead.setInstanceNum(instanceNum);
    clusterInstanceNum+=instanceNum;
    try {
      ngRead.setComputeOnly(softMgr.isComputeOnlyRoles(ngRead.getRoles()));
    }
 catch (    Exception e) {
    }
    ngReads.add(ngRead);
    List<VcResourcePoolEntity> rpsNg=this.rpDao.findUsedRpsByNodeGroup(ng.getId());
    if (rpsNg != null && !rpsNg.isEmpty()) {
      rps.addAll(rpsNg);
    }
    logger.debug("String_Node_Str" + rps.size());
  }
  clusterRead.setNodeGroups(ngReads);
  clusterRead.setInstanceNum(clusterInstanceNum);
  clusterRead.setTemplateName(this.nodeTemplateDAO.findByMoid(cluster.getTemplateId()).getName());
  List<ResourcePoolRead> rpReads=new ArrayList<ResourcePoolRead>();
  Set<Long> processedRpIds=new HashSet<>();
  for (  VcResourcePoolEntity rp : rps) {
    if (!processedRpIds.contains(rp.getId())) {
      ResourcePoolRead rpRead=RestObjectManager.vcResourcePoolEntityToRead(rp);
      rpRead.setNodes(null);
      rpReads.add(rpRead);
      processedRpIds.add(rp.getId());
    }
  }
  logger.debug("String_Node_Str" + rpReads.size());
  clusterRead.setResourcePools(rpReads);
  return clusterRead;
}

Fixed version (ground truth):
@Override public ClusterRead findClusterWithNodes(String clusterName,boolean includeVolumes){
  ClusterEntity cluster=clusterDao.findWithNodes(clusterName,includeVolumes);
  ClusterRead clusterRead=RestObjectManager.clusterEntityToRead(cluster);
  SoftwareManager softMgr=null;
  try {
    softMgr=softwareManagerCollector.getSoftwareManager(cluster.getAppManager());
  }
 catch (  Exception e) {
    logger.error("String_Node_Str");
  }
  int clusterInstanceNum=0;
  List<NodeGroupRead> ngReads=new ArrayList<>();
  List<VcResourcePoolEntity> rps=new ArrayList<>();
  for (  NodeGroupEntity ng : cluster.getNodeGroupsSortedById()) {
    NodeGroupRead ngRead=RestObjectManager.nodeGroupEntityToRead(ng);
    List<NodeRead> nodeReads=new ArrayList<>();
    for (    NodeEntity node : ng.getNodes()) {
      nodeReads.add(RestObjectManager.nodeEntityToRead(node,includeVolumes));
    }
    ngRead.setInstances(nodeReads);
    int instanceNum=this.nodeDao.getCountByNodeGroup(ng.getId());
    ngRead.setInstanceNum(instanceNum);
    clusterInstanceNum+=instanceNum;
    try {
      ngRead.setComputeOnly(softMgr.isComputeOnlyRoles(ngRead.getRoles()));
    }
 catch (    Exception e) {
    }
    ngReads.add(ngRead);
    List<VcResourcePoolEntity> rpsNg=this.rpDao.findUsedRpsByNodeGroup(ng.getId());
    if (rpsNg != null && !rpsNg.isEmpty()) {
      rps.addAll(rpsNg);
    }
    logger.debug("String_Node_Str" + rps.size());
  }
  clusterRead.setNodeGroups(ngReads);
  clusterRead.setInstanceNum(clusterInstanceNum);
  setNodeTemplateName(clusterRead,cluster.getTemplateId());
  List<ResourcePoolRead> rpReads=new ArrayList<ResourcePoolRead>();
  Set<Long> processedRpIds=new HashSet<>();
  for (  VcResourcePoolEntity rp : rps) {
    if (!processedRpIds.contains(rp.getId())) {
      ResourcePoolRead rpRead=RestObjectManager.vcResourcePoolEntityToRead(rp);
      rpRead.setNodes(null);
      rpReads.add(rpRead);
      processedRpIds.add(rp.getId());
    }
  }
  logger.debug("String_Node_Str" + rpReads.size());
  clusterRead.setResourcePools(rpReads);
  return clusterRead;
}