Program: 49189
Project: 49189
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 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,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){
  if (name.indexOf("String_Node_Str") != -1) {
    CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,name,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,Constants.PARAM_CLUSTER + Constants.PARAM_NOT_CONTAIN_HORIZONTAL_LINE);
    return;
  }
  if (resume) {
    resumeCreateCluster(name);
    return;
  }
  ClusterCreate clusterCreate=new ClusterCreate();
  clusterCreate.setName(name);
  if (distro != null) {
    List<String> distroNames=getDistroNames();
    if (validName(distro,distroNames)) {
      clusterCreate.setDistro(distro);
    }
 else {
      CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,name,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,Constants.PARAM_DISTRO + Constants.PARAM_NOT_SUPPORTED + distroNames);
      return;
    }
  }
  if (rpNames != null) {
    List<String> rpNamesList=CommandsUtils.inputsConvert(rpNames);
    if (rpNamesList.isEmpty()) {
      CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,name,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,name,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,Constants.INPUT_DSNAMES_PARAM + Constants.MULTI_INPUTS_CHECK);
      return;
    }
 else {
      clusterCreate.setDsNames(dsNamesList);
    }
  }
  try {
    if (specFilePath != null) {
      ClusterCreate clusterSpec=CommandsUtils.getObjectByJsonString(ClusterCreate.class,CommandsUtils.dataFromFile(specFilePath));
      clusterCreate.setNodeGroups(clusterSpec.getNodeGroups());
      clusterCreate.setConfiguration(clusterSpec.getConfiguration());
      if (!skipConfigValidation) {
        if (!validateConfiguration(clusterCreate)) {
          return;
        }
      }
 else {
        clusterCreate.setValidateConfig(false);
      }
    }
  }
 catch (  Exception e) {
    CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,name,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,e.getMessage());
    return;
  }
  List<String> networkNames=getNetworkNames();
  if (networkNames.isEmpty()) {
    CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,name,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,Constants.PARAM_NETWORK_NAME + Constants.PARAM_NOT_EXISTED);
    return;
  }
 else {
    if (networkName != null) {
      if (validName(networkName,networkNames)) {
        clusterCreate.setNetworkName(networkName);
      }
 else {
        CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,name,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,Constants.PARAM_NETWORK_NAME + Constants.PARAM_NOT_SUPPORTED + networkNames);
        return;
      }
    }
 else {
      if (networkNames.size() == 1) {
        clusterCreate.setNetworkName(networkNames.get(0));
      }
 else {
        CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,name,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,Constants.PARAM_NETWORK_NAME + Constants.PARAM_NOT_SPECIFIED);
        return;
      }
    }
  }
  if (specFilePath != null) {
    if (!validateClusterCreate(clusterCreate)) {
      return;
    }
  }
  try {
    restClient.create(clusterCreate);
    CommandsUtils.printCmdSuccess(Constants.OUTPUT_OBJECT_CLUSTER,name,Constants.OUTPUT_OP_RESULT_CREAT);
  }
 catch (  CliRestException e) {
    CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,name,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,e.getMessage());
  }
}

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 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,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){
  if (name.indexOf("String_Node_Str") != -1) {
    CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,name,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,Constants.PARAM_CLUSTER + Constants.PARAM_NOT_CONTAIN_HORIZONTAL_LINE);
    return;
  }
  if (resume) {
    resumeCreateCluster(name);
    return;
  }
  ClusterCreate clusterCreate=new ClusterCreate();
  clusterCreate.setName(name);
  if (distro != null) {
    List<String> distroNames=getDistroNames();
    if (validName(distro,distroNames)) {
      clusterCreate.setDistro(distro);
    }
 else {
      CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,name,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,Constants.PARAM_DISTRO + Constants.PARAM_NOT_SUPPORTED + distroNames);
      return;
    }
  }
  if (rpNames != null) {
    List<String> rpNamesList=CommandsUtils.inputsConvert(rpNames);
    if (rpNamesList.isEmpty()) {
      CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,name,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,name,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,Constants.INPUT_DSNAMES_PARAM + Constants.MULTI_INPUTS_CHECK);
      return;
    }
 else {
      clusterCreate.setDsNames(dsNamesList);
    }
  }
  ValidateResult blackListResult=null;
  try {
    if (specFilePath != null) {
      ClusterCreate clusterSpec=CommandsUtils.getObjectByJsonString(ClusterCreate.class,CommandsUtils.dataFromFile(specFilePath));
      clusterCreate.setNodeGroups(clusterSpec.getNodeGroups());
      clusterCreate.setConfiguration(clusterSpec.getConfiguration());
      blackListResult=validateBlackList(clusterCreate);
      if (!skipConfigValidation) {
        ValidateResult whiteListResult=validateWhiteList(clusterCreate);
        if (!showWhiteListWarning(clusterCreate.getName(),whiteListResult)) {
          return;
        }
      }
 else {
        clusterCreate.setValidateConfig(false);
      }
    }
  }
 catch (  Exception e) {
    CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,name,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,e.getMessage());
    return;
  }
  List<String> networkNames=getNetworkNames();
  if (networkNames.isEmpty()) {
    CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,name,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,Constants.PARAM_NETWORK_NAME + Constants.PARAM_NOT_EXISTED);
    return;
  }
 else {
    if (networkName != null) {
      if (validName(networkName,networkNames)) {
        clusterCreate.setNetworkName(networkName);
      }
 else {
        CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,name,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,Constants.PARAM_NETWORK_NAME + Constants.PARAM_NOT_SUPPORTED + networkNames);
        return;
      }
    }
 else {
      if (networkNames.size() == 1) {
        clusterCreate.setNetworkName(networkNames.get(0));
      }
 else {
        CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,name,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,Constants.PARAM_NETWORK_NAME + Constants.PARAM_NOT_SPECIFIED);
        return;
      }
    }
  }
  if (specFilePath != null) {
    if (!validateClusterCreate(clusterCreate)) {
      return;
    }
  }
  try {
    if (blackListResult != null) {
      showBlackListWarning(blackListResult);
    }
    restClient.create(clusterCreate);
    if (specFilePath == null) {
      createDefalutFile(clusterCreate);
    }
    CommandsUtils.printCmdSuccess(Constants.OUTPUT_OBJECT_CLUSTER,name,Constants.OUTPUT_OP_RESULT_CREAT);
  }
 catch (  CliRestException e) {
    CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,name,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,e.getMessage());
  }
}