Program: 48506
Project: 48506
Buggy source:
@SuppressWarnings("String_Node_Str") public ClusterRead toClusterRead(String clusterName,boolean ignoreObsoleteNode){
  ClusterEntity cluster=findByName(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.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"));
  }
  SoftwareManager softMgr=softwareManagerCollector.getSoftwareManager(cluster.getAppManager());
  if (softMgr == null) {
    logger.error("String_Node_Str");
    throw ClusterConfigException.FAILED_TO_GET_SOFTWARE_MANAGER(cluster.getAppManager());
  }
  List<NodeGroupRead> groupList=new ArrayList<NodeGroupRead>();
  for (  NodeGroupEntity group : cluster.getNodeGroups()) {
    NodeGroupRead groupRead=group.toNodeGroupRead(ignoreObsoleteNode);
    groupRead.setComputeOnly(softMgr.isComputeOnlyRoles(groupRead.getRoles()));
    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());
  }
  return clusterRead;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public ClusterRead toClusterRead(String clusterName,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.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"));
  }
  SoftwareManager softMgr=softwareManagerCollector.getSoftwareManager(cluster.getAppManager());
  if (softMgr == null) {
    logger.error("String_Node_Str");
    throw ClusterConfigException.FAILED_TO_GET_SOFTWARE_MANAGER(cluster.getAppManager());
  }
  List<NodeGroupRead> groupList=new ArrayList<NodeGroupRead>();
  for (  NodeGroupEntity group : cluster.getNodeGroups()) {
    NodeGroupRead groupRead=group.toNodeGroupRead(ignoreObsoleteNode);
    groupRead.setComputeOnly(softMgr.isComputeOnlyRoles(groupRead.getRoles()));
    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());
  }
  return clusterRead;
}