Program: 48393
Project: 48393
Buggy source:
@CliCommand(value="String_Node_Str",help="String_Node_Str") public void createCluster(@CliOption(key={"String_Node_Str"},mandatory=true,help="String_Node_Str") final String name,@CliOption(key={"String_Node_Str"},mandatory=false,help="String_Node_Str") final String appManager,@CliOption(key={"String_Node_Str"},mandatory=false,help="String_Node_Str") final String type,@CliOption(key={"String_Node_Str"},mandatory=false,help="String_Node_Str") final String distro,@CliOption(key={"String_Node_Str"},mandatory=false,help="String_Node_Str") final String specFilePath,@CliOption(key={"String_Node_Str"},mandatory=false,help="String_Node_Str") final String rpNames,@CliOption(key={"String_Node_Str"},mandatory=false,help="String_Node_Str") final String dsNames,@CliOption(key={"String_Node_Str"},mandatory=false,help="String_Node_Str") final String networkName,@CliOption(key={"String_Node_Str"},mandatory=false,help="String_Node_Str") final String hdfsNetworkName,@CliOption(key={"String_Node_Str"},mandatory=false,help="String_Node_Str") final String mapredNetworkName,@CliOption(key={"String_Node_Str"},mandatory=false,help="String_Node_Str") final String topology,@CliOption(key={"String_Node_Str"},mandatory=false,specifiedDefaultValue="String_Node_Str",unspecifiedDefaultValue="String_Node_Str",help="String_Node_Str") final boolean resume,@CliOption(key={"String_Node_Str"},mandatory=false,unspecifiedDefaultValue="String_Node_Str",specifiedDefaultValue="String_Node_Str",help="String_Node_Str") final boolean skipConfigValidation,@CliOption(key={"String_Node_Str"},mandatory=false,unspecifiedDefaultValue="String_Node_Str",specifiedDefaultValue="String_Node_Str",help="String_Node_Str") final boolean alwaysAnswerYes,@CliOption(key={"String_Node_Str"},mandatory=false,specifiedDefaultValue="String_Node_Str",unspecifiedDefaultValue="String_Node_Str",help="String_Node_Str") final boolean setClusterPassword,@CliOption(key={"String_Node_Str"},mandatory=false,help="String_Node_Str") final String localRepoURL,@CliOption(key={"String_Node_Str"},mandatory=false,help="String_Node_Str") final String adminGroupName,@CliOption(key={"String_Node_Str"},mandatory=false,help="String_Node_Str") final String userGroupName,@CliOption(key={"String_Node_Str"},mandatory=false,help="String_Node_Str") final Boolean disableLocalUsersFlag){
  if (name.indexOf("String_Node_Str") != -1) {
    CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,Constants.PARAM_CLUSTER + Constants.PARAM_NOT_CONTAIN_HORIZONTAL_LINE);
    return;
  }
 else   if (name.indexOf("String_Node_Str") != -1) {
    CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,Constants.PARAM_CLUSTER + Constants.PARAM_NOT_CONTAIN_BLANK_SPACE);
    return;
  }
  if (resume && setClusterPassword) {
    CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,Constants.RESUME_DONOT_NEED_SET_PASSWORD);
    return;
  }
 else   if (resume) {
    resumeCreateCluster(name);
    return;
  }
  ClusterCreate clusterCreate=new ClusterCreate();
  clusterCreate.setName(name);
  if (!CommandsUtils.isBlank(appManager) && !Constants.IRONFAN.equalsIgnoreCase(appManager)) {
    AppManagerRead appManagerRead=appManagerRestClient.get(appManager);
    if (appManagerRead == null) {
      CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,appManager + "String_Node_Str");
      return;
    }
  }
  if (CommandsUtils.isBlank(appManager)) {
    clusterCreate.setAppManager(Constants.IRONFAN);
  }
 else {
    clusterCreate.setAppManager(appManager);
    if (!CommandsUtils.isBlank(localRepoURL)) {
      clusterCreate.setLocalRepoURL(localRepoURL);
    }
  }
  if (setClusterPassword) {
    String password=getPassword();
    if (password == null) {
      return;
    }
 else {
      clusterCreate.setPassword(password);
    }
  }
  if (type != null) {
    ClusterType clusterType=ClusterType.getByDescription(type);
    if (clusterType == null) {
      CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,Constants.INVALID_VALUE + "String_Node_Str" + "String_Node_Str"+ type);
      return;
    }
    clusterCreate.setType(clusterType);
  }
 else   if (specFilePath == null) {
    clusterCreate.setType(ClusterType.HDFS_MAPRED);
  }
  TopologyType policy=null;
  if (topology != null) {
    policy=validateTopologyValue(name,topology);
    if (policy == null) {
      return;
    }
  }
 else {
    policy=TopologyType.NONE;
  }
  clusterCreate.setTopologyPolicy(policy);
  DistroRead distroRead4Create;
  try {
    if (distro != null) {
      DistroRead[] distroReads=appManagerRestClient.getDistros(clusterCreate.getAppManager());
      distroRead4Create=getDistroByName(distroReads,distro);
      if (distroRead4Create == null) {
        CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,Constants.PARAM_DISTRO + Constants.PARAM_NOT_SUPPORTED + getDistroNames(distroReads));
        return;
      }
    }
 else {
      distroRead4Create=appManagerRestClient.getDefaultDistro(clusterCreate.getAppManager());
      if (distroRead4Create == null || CommandsUtils.isBlank(distroRead4Create.getName())) {
        CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,Constants.PARAM_NO_DEFAULT_DISTRO);
        return;
      }
    }
  }
 catch (  CliRestException e) {
    CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,e.getMessage());
    return;
  }
  Map<String,Map<String,String>> infraConfigs=new HashMap<String,Map<String,String>>();
  if (StringUtils.isBlank(adminGroupName) && StringUtils.isBlank(userGroupName)) {
  }
 else   if (!StringUtils.isBlank(adminGroupName) && !StringUtils.isBlank(userGroupName)) {
    if (MapUtils.isEmpty(infraConfigs.get(UserMgmtConstants.LDAP_USER_MANAGEMENT))) {
      initInfraConfigs(infraConfigs,disableLocalUsersFlag);
    }
    Map<String,String> userMgmtConfig=infraConfigs.get(UserMgmtConstants.LDAP_USER_MANAGEMENT);
    userMgmtConfig.put(UserMgmtConstants.ADMIN_GROUP_NAME,adminGroupName);
    userMgmtConfig.put(UserMgmtConstants.USER_GROUP_NAME,userGroupName);
    clusterCreate.setInfrastructure_config(infraConfigs);
  }
 else {
    CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,"String_Node_Str");
    return;
  }
  clusterCreate.setDistro(distroRead4Create.getName());
  clusterCreate.setDistroVendor(distroRead4Create.getVendor());
  clusterCreate.setDistroVersion(distroRead4Create.getVersion());
  if (rpNames != null) {
    List<String> rpNamesList=CommandsUtils.inputsConvert(rpNames);
    if (rpNamesList.isEmpty()) {
      CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,Constants.INPUT_RPNAMES_PARAM + Constants.MULTI_INPUTS_CHECK);
      return;
    }
 else {
      clusterCreate.setRpNames(rpNamesList);
    }
  }
  if (dsNames != null) {
    List<String> dsNamesList=CommandsUtils.inputsConvert(dsNames);
    if (dsNamesList.isEmpty()) {
      CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,Constants.INPUT_DSNAMES_PARAM + Constants.MULTI_INPUTS_CHECK);
      return;
    }
 else {
      clusterCreate.setDsNames(dsNamesList);
    }
  }
  List<String> failedMsgList=new ArrayList<String>();
  List<String> warningMsgList=new ArrayList<String>();
  Set<String> allNetworkNames=new HashSet<String>();
  try {
    if (specFilePath != null) {
      ClusterCreate clusterSpec=CommandsUtils.getObjectByJsonString(ClusterCreate.class,CommandsUtils.dataFromFile(specFilePath));
      clusterCreate.setSpecFile(true);
      clusterCreate.setExternalHDFS(clusterSpec.getExternalHDFS());
      clusterCreate.setExternalMapReduce(clusterSpec.getExternalMapReduce());
      clusterCreate.setExternalNamenode(clusterSpec.getExternalNamenode());
      clusterCreate.setExternalSecondaryNamenode(clusterSpec.getExternalSecondaryNamenode());
      clusterCreate.setExternalDatanodes(clusterSpec.getExternalDatanodes());
      clusterCreate.setNodeGroups(clusterSpec.getNodeGroups());
      clusterCreate.setConfiguration(clusterSpec.getConfiguration());
      if (CommandsUtils.isBlank(appManager) || Constants.IRONFAN.equalsIgnoreCase(appManager)) {
        validateConfiguration(clusterCreate,skipConfigValidation,warningMsgList,failedMsgList);
      }
      clusterCreate.validateNodeGroupNames();
      if (!validateHAInfo(clusterCreate.getNodeGroups())) {
        CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,Constants.PARAM_CLUSTER_SPEC_HA_ERROR + specFilePath);
        return;
      }
      Map<String,Map<String,String>> specInfraConfigs=clusterSpec.getInfrastructure_config();
      if (!MapUtils.isEmpty(specInfraConfigs)) {
        if (MapUtils.isNotEmpty(infraConfigs)) {
          System.out.println("String_Node_Str");
        }
 else {
          clusterCreate.setInfrastructure_config(specInfraConfigs);
        }
      }
      Map<String,Object> configuration=clusterSpec.getConfiguration();
      if (MapUtils.isNotEmpty(configuration)) {
        Map<String,Map<String,String>> serviceUserConfig=(Map<String,Map<String,String>>)configuration.get(UserMgmtConstants.SERVICE_USER_CONFIG_IN_SPEC_FILE);
        if (MapUtils.isNotEmpty(serviceUserConfig)) {
          if (hasLdapServiceUser(serviceUserConfig) && (clusterCreate.getInfrastructure_config() == null)) {
            Map<String,Map<String,String>> infraConfig=new HashMap<>();
            initInfraConfigs(infraConfig,disableLocalUsersFlag);
            clusterCreate.setInfrastructure_config(infraConfig);
          }
          validateServiceUserConfigs(appManager,clusterSpec,failedMsgList);
        }
      }
    }
    allNetworkNames=getAllNetworkNames();
  }
 catch (  Exception e) {
    CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,e.getMessage());
    return;
  }
  if (allNetworkNames.isEmpty()) {
    CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,Constants.PARAM_CANNOT_FIND_NETWORK);
    return;
  }
  Map<NetTrafficType,List<String>> networkConfig=new HashMap<NetTrafficType,List<String>>();
  if (networkName == null) {
    if (allNetworkNames.size() == 1) {
      networkConfig.put(NetTrafficType.MGT_NETWORK,new ArrayList<String>());
      networkConfig.get(NetTrafficType.MGT_NETWORK).addAll(allNetworkNames);
    }
 else {
      CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,Constants.PARAM_NETWORK_NAME + Constants.PARAM_NOT_SPECIFIED);
      return;
    }
  }
 else {
    if (!allNetworkNames.contains(networkName) || (hdfsNetworkName != null && !allNetworkNames.contains(hdfsNetworkName)) || (mapredNetworkName != null && !allNetworkNames.contains(mapredNetworkName))) {
      CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,Constants.PARAM_NETWORK_NAME + Constants.PARAM_NOT_SUPPORTED + allNetworkNames.toString());
      return;
    }
    networkConfig.put(NetTrafficType.MGT_NETWORK,new ArrayList<String>());
    networkConfig.get(NetTrafficType.MGT_NETWORK).add(networkName);
    if (hdfsNetworkName != null) {
      networkConfig.put(NetTrafficType.HDFS_NETWORK,new ArrayList<String>());
      networkConfig.get(NetTrafficType.HDFS_NETWORK).add(hdfsNetworkName);
    }
    if (mapredNetworkName != null) {
      networkConfig.put(NetTrafficType.MAPRED_NETWORK,new ArrayList<String>());
      networkConfig.get(NetTrafficType.MAPRED_NETWORK).add(mapredNetworkName);
    }
  }
  notifyNetsUsage(networkConfig,warningMsgList);
  clusterCreate.setNetworkConfig(networkConfig);
  clusterCreate.validateCDHVersion(warningMsgList);
  if (specFilePath != null) {
    validateClusterSpec(clusterCreate,failedMsgList,warningMsgList);
  }
  if (type != null && specFilePath != null) {
    warningMsgList.add(Constants.TYPE_SPECFILE_CONFLICT);
  }
  if (!failedMsgList.isEmpty()) {
    showFailedMsg(clusterCreate.getName(),Constants.OUTPUT_OP_CREATE,failedMsgList);
    return;
  }
  try {
    if (!CommandsUtils.showWarningMsg(clusterCreate.getName(),Constants.OUTPUT_OBJECT_CLUSTER,Constants.OUTPUT_OP_CREATE,warningMsgList,alwaysAnswerYes,null)) {
      return;
    }
    restClient.create(clusterCreate);
    CommandsUtils.printCmdSuccess(Constants.OUTPUT_OBJECT_CLUSTER,Constants.OUTPUT_OP_RESULT_CREAT);
  }
 catch (  CliRestException e) {
    CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,CommandsUtils.getExceptionMessage(e));
  }
}

Fixed version (ground truth):
@CliCommand(value="String_Node_Str",help="String_Node_Str") public void createCluster(@CliOption(key={"String_Node_Str"},mandatory=true,help="String_Node_Str") final String name,@CliOption(key={"String_Node_Str"},mandatory=false,help="String_Node_Str") final String appManager,@CliOption(key={"String_Node_Str"},mandatory=false,help="String_Node_Str") final String type,@CliOption(key={"String_Node_Str"},mandatory=false,help="String_Node_Str") final String distro,@CliOption(key={"String_Node_Str"},mandatory=false,help="String_Node_Str") final String specFilePath,@CliOption(key={"String_Node_Str"},mandatory=false,help="String_Node_Str") final String rpNames,@CliOption(key={"String_Node_Str"},mandatory=false,help="String_Node_Str") final String dsNames,@CliOption(key={"String_Node_Str"},mandatory=false,help="String_Node_Str") final String networkName,@CliOption(key={"String_Node_Str"},mandatory=false,help="String_Node_Str") final String hdfsNetworkName,@CliOption(key={"String_Node_Str"},mandatory=false,help="String_Node_Str") final String mapredNetworkName,@CliOption(key={"String_Node_Str"},mandatory=false,help="String_Node_Str") final String topology,@CliOption(key={"String_Node_Str"},mandatory=false,specifiedDefaultValue="String_Node_Str",unspecifiedDefaultValue="String_Node_Str",help="String_Node_Str") final boolean resume,@CliOption(key={"String_Node_Str"},mandatory=false,unspecifiedDefaultValue="String_Node_Str",specifiedDefaultValue="String_Node_Str",help="String_Node_Str") final boolean skipConfigValidation,@CliOption(key={"String_Node_Str"},mandatory=false,unspecifiedDefaultValue="String_Node_Str",specifiedDefaultValue="String_Node_Str",help="String_Node_Str") final boolean alwaysAnswerYes,@CliOption(key={"String_Node_Str"},mandatory=false,specifiedDefaultValue="String_Node_Str",unspecifiedDefaultValue="String_Node_Str",help="String_Node_Str") final boolean setClusterPassword,@CliOption(key={"String_Node_Str"},mandatory=false,help="String_Node_Str") final String localRepoURL,@CliOption(key={"String_Node_Str"},mandatory=false,help="String_Node_Str") final String adminGroupName,@CliOption(key={"String_Node_Str"},mandatory=false,help="String_Node_Str") final String userGroupName,@CliOption(key={"String_Node_Str"},mandatory=false,help="String_Node_Str") final Boolean disableLocalUsersFlag){
  if (name.indexOf("String_Node_Str") != -1) {
    CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,Constants.PARAM_CLUSTER + Constants.PARAM_NOT_CONTAIN_HORIZONTAL_LINE);
    return;
  }
 else   if (name.indexOf("String_Node_Str") != -1) {
    CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,Constants.PARAM_CLUSTER + Constants.PARAM_NOT_CONTAIN_BLANK_SPACE);
    return;
  }
  if (resume && setClusterPassword) {
    CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,Constants.RESUME_DONOT_NEED_SET_PASSWORD);
    return;
  }
 else   if (resume) {
    resumeCreateCluster(name);
    return;
  }
  ClusterCreate clusterCreate=new ClusterCreate();
  clusterCreate.setName(name);
  if (!CommandsUtils.isBlank(appManager) && !Constants.IRONFAN.equalsIgnoreCase(appManager)) {
    AppManagerRead appManagerRead=appManagerRestClient.get(appManager);
    if (appManagerRead == null) {
      CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,appManager + "String_Node_Str");
      return;
    }
  }
  if (CommandsUtils.isBlank(appManager)) {
    clusterCreate.setAppManager(Constants.IRONFAN);
  }
 else {
    clusterCreate.setAppManager(appManager);
    if (!CommandsUtils.isBlank(localRepoURL)) {
      clusterCreate.setLocalRepoURL(localRepoURL);
    }
  }
  if (setClusterPassword) {
    String password=getPassword();
    if (password == null) {
      return;
    }
 else {
      clusterCreate.setPassword(password);
    }
  }
  if (type != null) {
    ClusterType clusterType=ClusterType.getByDescription(type);
    if (clusterType == null) {
      CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,Constants.INVALID_VALUE + "String_Node_Str" + "String_Node_Str"+ type);
      return;
    }
    clusterCreate.setType(clusterType);
  }
 else   if (specFilePath == null) {
    clusterCreate.setType(ClusterType.HDFS_MAPRED);
  }
  TopologyType policy=null;
  if (topology != null) {
    policy=validateTopologyValue(name,topology);
    if (policy == null) {
      return;
    }
  }
 else {
    policy=TopologyType.NONE;
  }
  clusterCreate.setTopologyPolicy(policy);
  DistroRead distroRead4Create;
  try {
    if (distro != null) {
      DistroRead[] distroReads=appManagerRestClient.getDistros(clusterCreate.getAppManager());
      distroRead4Create=getDistroByName(distroReads,distro);
      if (distroRead4Create == null) {
        CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,Constants.PARAM_DISTRO + Constants.PARAM_NOT_SUPPORTED + getDistroNames(distroReads));
        return;
      }
    }
 else {
      distroRead4Create=appManagerRestClient.getDefaultDistro(clusterCreate.getAppManager());
      if (distroRead4Create == null || CommandsUtils.isBlank(distroRead4Create.getName())) {
        CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,Constants.PARAM_NO_DEFAULT_DISTRO);
        return;
      }
    }
  }
 catch (  CliRestException e) {
    CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,e.getMessage());
    return;
  }
  Map<String,Map<String,String>> infraConfigs=new HashMap<String,Map<String,String>>();
  if (StringUtils.isBlank(adminGroupName) && StringUtils.isBlank(userGroupName)) {
  }
 else   if (!StringUtils.isBlank(adminGroupName) && !StringUtils.isBlank(userGroupName)) {
    if (MapUtils.isEmpty(infraConfigs.get(UserMgmtConstants.LDAP_USER_MANAGEMENT))) {
      initInfraConfigs(infraConfigs,disableLocalUsersFlag);
    }
    Map<String,String> userMgmtConfig=infraConfigs.get(UserMgmtConstants.LDAP_USER_MANAGEMENT);
    userMgmtConfig.put(UserMgmtConstants.ADMIN_GROUP_NAME,adminGroupName);
    userMgmtConfig.put(UserMgmtConstants.USER_GROUP_NAME,userGroupName);
    clusterCreate.setInfrastructure_config(infraConfigs);
  }
 else {
    CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,"String_Node_Str");
    return;
  }
  clusterCreate.setDistro(distroRead4Create.getName());
  clusterCreate.setDistroVendor(distroRead4Create.getVendor());
  clusterCreate.setDistroVersion(distroRead4Create.getVersion());
  if (rpNames != null) {
    List<String> rpNamesList=CommandsUtils.inputsConvert(rpNames);
    if (rpNamesList.isEmpty()) {
      CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,Constants.INPUT_RPNAMES_PARAM + Constants.MULTI_INPUTS_CHECK);
      return;
    }
 else {
      clusterCreate.setRpNames(rpNamesList);
    }
  }
  if (dsNames != null) {
    List<String> dsNamesList=CommandsUtils.inputsConvert(dsNames);
    if (dsNamesList.isEmpty()) {
      CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,Constants.INPUT_DSNAMES_PARAM + Constants.MULTI_INPUTS_CHECK);
      return;
    }
 else {
      clusterCreate.setDsNames(dsNamesList);
    }
  }
  List<String> failedMsgList=new ArrayList<String>();
  List<String> warningMsgList=new ArrayList<String>();
  Set<String> allNetworkNames=new HashSet<String>();
  try {
    if (specFilePath != null) {
      ClusterCreate clusterSpec=CommandsUtils.getObjectByJsonString(ClusterCreate.class,CommandsUtils.dataFromFile(specFilePath));
      clusterCreate.setSpecFile(true);
      clusterCreate.setExternalHDFS(clusterSpec.getExternalHDFS());
      clusterCreate.setExternalMapReduce(clusterSpec.getExternalMapReduce());
      clusterCreate.setExternalNamenode(clusterSpec.getExternalNamenode());
      clusterCreate.setExternalSecondaryNamenode(clusterSpec.getExternalSecondaryNamenode());
      clusterCreate.setExternalDatanodes(clusterSpec.getExternalDatanodes());
      clusterCreate.setNodeGroups(clusterSpec.getNodeGroups());
      clusterCreate.setConfiguration(clusterSpec.getConfiguration());
      if (CommandsUtils.isBlank(appManager) || Constants.IRONFAN.equalsIgnoreCase(appManager)) {
        validateConfiguration(clusterCreate,skipConfigValidation,warningMsgList,failedMsgList);
      }
      clusterCreate.validateNodeGroupNames();
      if (!validateHAInfo(clusterCreate.getNodeGroups())) {
        CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,Constants.PARAM_CLUSTER_SPEC_HA_ERROR + specFilePath);
        return;
      }
      Map<String,Map<String,String>> specInfraConfigs=clusterSpec.getInfrastructure_config();
      if (!MapUtils.isEmpty(specInfraConfigs)) {
        if (MapUtils.isNotEmpty(infraConfigs)) {
          System.out.println("String_Node_Str");
        }
 else {
          clusterCreate.setInfrastructure_config(specInfraConfigs);
        }
      }
      Map<String,Object> configuration=clusterSpec.getConfiguration();
      if (MapUtils.isNotEmpty(configuration)) {
        Map<String,Map<String,String>> serviceUserConfig=(Map<String,Map<String,String>>)configuration.get(UserMgmtConstants.SERVICE_USER_CONFIG_IN_SPEC_FILE);
        if (MapUtils.isNotEmpty(serviceUserConfig)) {
          if (hasLdapServiceUser(serviceUserConfig) && (clusterCreate.getInfrastructure_config() == null)) {
            Map<String,Map<String,String>> infraConfig=new HashMap<>();
            initInfraConfigs(infraConfig,disableLocalUsersFlag);
            clusterCreate.setInfrastructure_config(infraConfig);
          }
          validateServiceUserConfigs(appManager,clusterSpec,failedMsgList);
        }
      }
    }
    allNetworkNames=getAllNetworkNames();
  }
 catch (  Exception e) {
    CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,e.getMessage());
    return;
  }
  if (allNetworkNames.isEmpty()) {
    CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,Constants.PARAM_CANNOT_FIND_NETWORK);
    return;
  }
  Map<NetTrafficType,List<String>> networkConfig=new HashMap<NetTrafficType,List<String>>();
  if (networkName == null) {
    if (allNetworkNames.size() == 1) {
      networkConfig.put(NetTrafficType.MGT_NETWORK,new ArrayList<String>());
      networkConfig.get(NetTrafficType.MGT_NETWORK).addAll(allNetworkNames);
    }
 else {
      CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,Constants.PARAM_NETWORK_NAME + Constants.PARAM_NOT_SPECIFIED);
      return;
    }
  }
 else {
    if (!allNetworkNames.contains(networkName) || (hdfsNetworkName != null && !allNetworkNames.contains(hdfsNetworkName)) || (mapredNetworkName != null && !allNetworkNames.contains(mapredNetworkName))) {
      CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,Constants.PARAM_NETWORK_NAME + Constants.PARAM_NOT_SUPPORTED + allNetworkNames.toString());
      return;
    }
    networkConfig.put(NetTrafficType.MGT_NETWORK,new ArrayList<String>());
    networkConfig.get(NetTrafficType.MGT_NETWORK).add(networkName);
    if (hdfsNetworkName != null) {
      networkConfig.put(NetTrafficType.HDFS_NETWORK,new ArrayList<String>());
      networkConfig.get(NetTrafficType.HDFS_NETWORK).add(hdfsNetworkName);
    }
    if (mapredNetworkName != null) {
      networkConfig.put(NetTrafficType.MAPRED_NETWORK,new ArrayList<String>());
      networkConfig.get(NetTrafficType.MAPRED_NETWORK).add(mapredNetworkName);
    }
  }
  notifyNetsUsage(networkConfig,warningMsgList);
  clusterCreate.setNetworkConfig(networkConfig);
  clusterCreate.validateCDHVersion(warningMsgList);
  if (specFilePath != null) {
    validateClusterSpec(clusterCreate,failedMsgList,warningMsgList);
  }
  if (type != null && specFilePath != null) {
    warningMsgList.add(Constants.TYPE_SPECFILE_CONFLICT);
  }
  if (!failedMsgList.isEmpty()) {
    showFailedMsg(clusterCreate.getName(),Constants.OUTPUT_OP_CREATE,failedMsgList);
    return;
  }
  try {
    if (!CommandsUtils.showWarningMsg(clusterCreate.getName(),Constants.OUTPUT_OBJECT_CLUSTER,Constants.OUTPUT_OP_CREATE,warningMsgList,alwaysAnswerYes,null)) {
      return;
    }
    restClient.create(clusterCreate);
    CommandsUtils.printCmdSuccess(Constants.OUTPUT_OBJECT_CLUSTER,Constants.OUTPUT_OP_RESULT_CREAT);
  }
 catch (  CliRestException e) {
    CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,CommandsUtils.getExceptionMessage(e));
  }
  ClusterRead cluster=restClient.get(name,false);
  if (cluster != null) {
    String cloneType=cluster.getClusterCloneType();
    String INSTANT_CLONE=com.vmware.bdd.utils.Constants.CLUSTER_CLONE_TYPE_INSTANT_CLONE;
    if (null != cloneType && cloneType.equals(INSTANT_CLONE)) {
      String warningMsg=validateInstantCloneWithHA(specFilePath,clusterCreate);
      if (!CommonUtil.isBlank(warningMsg)) {
        System.out.println(warningMsg);
      }
    }
  }
}