Program: 48357
Project: 48357
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public ClusterRead toClusterRead(String clusterName,boolean withNodesList,boolean ignoreObsoleteNode){
  ClusterEntity cluster=findByName(clusterName);
  if (cluster == null) {
    throw BddException.NOT_FOUND("String_Node_Str",clusterName);
  }
  ClusterStatus clusterStatus=cluster.getStatus();
  ClusterRead clusterRead=new ClusterRead();
  clusterRead.setInstanceNum(cluster.getRealInstanceNum(ignoreObsoleteNode));
  clusterRead.setName(cluster.getName());
  clusterRead.setStatus(clusterStatus);
  clusterRead.setAppManager(cluster.getAppManager());
  clusterRead.setDistro(cluster.getDistro());
  clusterRead.setDistroVendor(cluster.getDistroVendor());
  clusterRead.setTopologyPolicy(cluster.getTopologyPolicy());
  clusterRead.setTemplateName(nodeTemplateDAO.findByMoid(cluster.getTemplateId()).getName());
  clusterRead.setAutomationEnable(cluster.getAutomationEnable());
  clusterRead.setVhmMinNum(cluster.getVhmMinNum());
  clusterRead.setVhmMaxNum(cluster.getVhmMaxNum());
  clusterRead.setVhmTargetNum(cluster.getVhmTargetNum());
  clusterRead.setIoShares(cluster.getIoShares());
  clusterRead.setVersion(cluster.getVersion());
  if (!CommonUtil.isBlank(cluster.getAdvancedProperties())) {
    Gson gson=new Gson();
    Map<String,String> advancedProperties=gson.fromJson(cluster.getAdvancedProperties(),Map.class);
    clusterRead.setExternalHDFS(advancedProperties.get("String_Node_Str"));
    clusterRead.setExternalMapReduce(advancedProperties.get("String_Node_Str"));
    clusterRead.setLocalRepoURL(advancedProperties.get("String_Node_Str"));
    clusterRead.setClusterCloneType(advancedProperties.get("String_Node_Str"));
    clusterRead.setExternalNamenode(advancedProperties.get("String_Node_Str"));
    clusterRead.setExternalSecondaryNamenode(advancedProperties.get("String_Node_Str"));
    if (advancedProperties.get("String_Node_Str") != null) {
      clusterRead.setExternalDatanodes(gson.fromJson(gson.toJson(advancedProperties.get("String_Node_Str")),HashSet.class));
    }
  }
  String cloneType=clusterRead.getClusterCloneType();
  if (CommonUtil.isBlank(cloneType)) {
    clusterRead.setClusterCloneType(Constants.CLUSTER_CLONE_TYPE_FAST_CLONE);
  }
  SoftwareManager softMgr=null;
  try {
    softMgr=softwareManagerCollector.getSoftwareManager(cluster.getAppManager());
  }
 catch (  Exception e) {
    logger.error("String_Node_Str");
  }
  List<NodeGroupRead> groupList=new ArrayList<NodeGroupRead>();
  for (  NodeGroupEntity group : cluster.getNodeGroups()) {
    NodeGroupRead groupRead=group.toNodeGroupRead(withNodesList,ignoreObsoleteNode);
    groupRead.setComputeOnly(false);
    try {
      groupRead.setComputeOnly(softMgr.isComputeOnlyRoles(groupRead.getRoles()));
    }
 catch (    Exception e) {
    }
    groupList.add(groupRead);
  }
  clusterRead.setNodeGroups(groupList);
  Set<VcResourcePoolEntity> rps=cluster.getUsedRps();
  List<ResourcePoolRead> rpReads=new ArrayList<ResourcePoolRead>(rps.size());
  for (  VcResourcePoolEntity rp : rps) {
    ResourcePoolRead rpRead=rp.toRest();
    rpRead.setNodes(null);
    rpReads.add(rpRead);
  }
  clusterRead.setResourcePools(rpReads);
  if (clusterStatus.isActiveServiceStatus() || clusterStatus == ClusterStatus.STOPPED) {
    clusterRead.setDcSeperation(clusterRead.validateSetManualElasticity());
  }
  if (StringUtils.isNotBlank(cluster.getInfraConfig())) {
    clusterRead.setInfrastructure_config(InfrastructureConfigUtils.read(cluster.getInfraConfig()));
  }
  return clusterRead;
}

Fixed version (ground truth):
@Deprecated @Override @SuppressWarnings("String_Node_Str") public ClusterRead toClusterRead(String clusterName,boolean withNodesList,boolean ignoreObsoleteNode){
  ClusterEntity cluster=findByName(clusterName);
  if (cluster == null) {
    throw BddException.NOT_FOUND("String_Node_Str",clusterName);
  }
  ClusterStatus clusterStatus=cluster.getStatus();
  ClusterRead clusterRead=new ClusterRead();
  clusterRead.setInstanceNum(cluster.getRealInstanceNum(ignoreObsoleteNode));
  clusterRead.setName(cluster.getName());
  clusterRead.setStatus(clusterStatus);
  clusterRead.setAppManager(cluster.getAppManager());
  clusterRead.setDistro(cluster.getDistro());
  clusterRead.setDistroVendor(cluster.getDistroVendor());
  clusterRead.setTopologyPolicy(cluster.getTopologyPolicy());
  clusterRead.setTemplateName(nodeTemplateDAO.findByMoid(cluster.getTemplateId()).getName());
  clusterRead.setAutomationEnable(cluster.getAutomationEnable());
  clusterRead.setVhmMinNum(cluster.getVhmMinNum());
  clusterRead.setVhmMaxNum(cluster.getVhmMaxNum());
  clusterRead.setVhmTargetNum(cluster.getVhmTargetNum());
  clusterRead.setIoShares(cluster.getIoShares());
  clusterRead.setVersion(cluster.getVersion());
  if (!CommonUtil.isBlank(cluster.getAdvancedProperties())) {
    Gson gson=new Gson();
    Map<String,String> advancedProperties=gson.fromJson(cluster.getAdvancedProperties(),Map.class);
    clusterRead.setExternalHDFS(advancedProperties.get("String_Node_Str"));
    clusterRead.setExternalMapReduce(advancedProperties.get("String_Node_Str"));
    clusterRead.setLocalRepoURL(advancedProperties.get("String_Node_Str"));
    clusterRead.setClusterCloneType(advancedProperties.get("String_Node_Str"));
    clusterRead.setExternalNamenode(advancedProperties.get("String_Node_Str"));
    clusterRead.setExternalSecondaryNamenode(advancedProperties.get("String_Node_Str"));
    if (advancedProperties.get("String_Node_Str") != null) {
      clusterRead.setExternalDatanodes(gson.fromJson(gson.toJson(advancedProperties.get("String_Node_Str")),HashSet.class));
    }
  }
  String cloneType=clusterRead.getClusterCloneType();
  if (CommonUtil.isBlank(cloneType)) {
    clusterRead.setClusterCloneType(Constants.CLUSTER_CLONE_TYPE_FAST_CLONE);
  }
  SoftwareManager softMgr=null;
  try {
    softMgr=softwareManagerCollector.getSoftwareManager(cluster.getAppManager());
  }
 catch (  Exception e) {
    logger.error("String_Node_Str");
  }
  List<NodeGroupRead> groupList=new ArrayList<NodeGroupRead>();
  for (  NodeGroupEntity group : cluster.getNodeGroups()) {
    NodeGroupRead groupRead=group.toNodeGroupRead(withNodesList,ignoreObsoleteNode);
    groupRead.setComputeOnly(false);
    try {
      groupRead.setComputeOnly(softMgr.isComputeOnlyRoles(groupRead.getRoles()));
    }
 catch (    Exception e) {
    }
    groupList.add(groupRead);
  }
  clusterRead.setNodeGroups(groupList);
  Set<VcResourcePoolEntity> rps=cluster.getUsedRps();
  List<ResourcePoolRead> rpReads=new ArrayList<ResourcePoolRead>(rps.size());
  for (  VcResourcePoolEntity rp : rps) {
    ResourcePoolRead rpRead=rp.toRest();
    rpRead.setNodes(null);
    rpReads.add(rpRead);
  }
  clusterRead.setResourcePools(rpReads);
  if (clusterStatus.isActiveServiceStatus() || clusterStatus == ClusterStatus.STOPPED) {
    clusterRead.setDcSeperation(clusterRead.validateSetManualElasticity());
  }
  if (StringUtils.isNotBlank(cluster.getInfraConfig())) {
    clusterRead.setInfrastructure_config(InfrastructureConfigUtils.read(cluster.getInfraConfig()));
  }
  return clusterRead;
}