Program: 95747
Project: 95747
Buggy source:
/** 
 * parses command line parameter and set them into job object
 * @param cmd CommandLine
 */
public void parseJobOptions(CommandLine cmd){
  if (cmd.hasOption(ClientTestStrings.PROJECT)) {
    setProjectName(cmd.getOptionValue(ClientTestStrings.PROJECT));
  }
  if (cmd.hasOption(ClientTestStrings.PROJECT_VERSION)) {
    try {
      ProjectVersion version=VersionStringUtils.createProjectVersion(cmd.getOptionValue(ClientTestStrings.PROJECT_VERSION));
      m_projectVersion=version;
    }
 catch (    VersionStringUtils.MalformedVersionException e) {
    }
  }
  if (cmd.hasOption(ClientTestStrings.SERVER)) {
    setServer(cmd.getOptionValue(ClientTestStrings.SERVER));
  }
  if (cmd.hasOption(ClientTestStrings.PORT)) {
    setPort(validateAndParseIntPortNumber(cmd.getOptionValue(ClientTestStrings.PORT)));
  }
  parseDBOptions(cmd);
  parseResultDirOptions(cmd);
  parseDataDirOptions(cmd);
  if (cmd.hasOption(ClientTestStrings.AUT_CONFIG)) {
    setAutConfigName(cmd.getOptionValue(ClientTestStrings.AUT_CONFIG));
  }
  if (cmd.hasOption(ClientTestStrings.AUT_ID)) {
    String autIdString=cmd.getOptionValue(ClientTestStrings.AUT_ID);
    if (autIdString != null) {
      setAutId(new AutIdentifier(autIdString));
    }
  }
  if (cmd.hasOption(ClientTestStrings.LANGUAGE)) {
    setLanguage(LocaleUtil.convertStrToLocale(cmd.getOptionValue(ClientTestStrings.LANGUAGE)));
  }
  if (cmd.hasOption(ClientTestStrings.TESTSUITE)) {
    String tsName=cmd.getOptionValue(ClientTestStrings.TESTSUITE);
    List<String> tsNamesList=new ArrayList<String>();
    tsNamesList.add(tsName);
    setTestSuiteNames(tsNamesList);
  }
  if (cmd.hasOption(ClientTestStrings.TESTJOB)) {
    setTestJobName(cmd.getOptionValue(ClientTestStrings.TESTJOB));
  }
  if (cmd.hasOption(ClientTestStrings.AUTO_SCREENSHOT)) {
    setAutoScreenshot(false);
  }
  if (cmd.hasOption(ClientTestStrings.NO_XML_SCREENSHOT)) {
    setXMLScreenshot(false);
  }
  if (cmd.hasOption(ClientTestStrings.TIMEOUT)) {
    try {
      setTimeout(Integer.parseInt(cmd.getOptionValue(ClientTestStrings.TIMEOUT)));
    }
 catch (    NumberFormatException e) {
      setTimeout(Constants.INVALID_VALUE);
    }
  }
  if (cmd.hasOption(ClientStrings.NORUN)) {
    setNoRunOptMode(TestExecutionConstants.runSteps.validateRunStep(cmd.getOptionValue(ClientStrings.NORUN)));
  }
  if (cmd.hasOption(ClientStrings.RESULT_NAME)) {
    setFileName(cmd.getOptionValue(ClientStrings.RESULT_NAME));
  }
}

Fixed version (ground truth):
/** 
 * parses command line parameter and set them into job object
 * @param cmd CommandLine
 */
public void parseJobOptions(CommandLine cmd){
  if (cmd.hasOption(ClientTestStrings.PROJECT)) {
    setProjectName(cmd.getOptionValue(ClientTestStrings.PROJECT));
  }
  if (cmd.hasOption(ClientTestStrings.PROJECT_VERSION)) {
    try {
      ProjectVersion version=VersionStringUtils.createProjectVersion(cmd.getOptionValue(ClientTestStrings.PROJECT_VERSION));
      m_projectVersion=version;
    }
 catch (    VersionStringUtils.MalformedVersionException e) {
    }
  }
  if (cmd.hasOption(ClientTestStrings.SERVER)) {
    setServer(cmd.getOptionValue(ClientTestStrings.SERVER));
  }
  if (cmd.hasOption(ClientTestStrings.PORT)) {
    setPort(validateAndParseIntPortNumber(cmd.getOptionValue(ClientTestStrings.PORT)));
  }
  parseDBOptions(cmd);
  parseResultDirOptions(cmd);
  parseDataDirOptions(cmd);
  if (cmd.hasOption(ClientTestStrings.AUT_CONFIG)) {
    setAutConfigName(cmd.getOptionValue(ClientTestStrings.AUT_CONFIG));
  }
  if (cmd.hasOption(ClientTestStrings.AUT_ID)) {
    String autIdString=cmd.getOptionValue(ClientTestStrings.AUT_ID);
    if (autIdString != null) {
      setAutId(new AutIdentifier(autIdString));
    }
  }
  if (cmd.hasOption(ClientTestStrings.LANGUAGE)) {
    setLanguage(LocaleUtil.convertStrToLocale(cmd.getOptionValue(ClientTestStrings.LANGUAGE)));
  }
  if (cmd.hasOption(ClientTestStrings.TESTSUITE)) {
    String tsName=cmd.getOptionValue(ClientTestStrings.TESTSUITE);
    List<String> tsNamesList=new ArrayList<String>();
    tsNamesList.add(tsName);
    setTestSuiteNames(tsNamesList);
  }
  if (cmd.hasOption(ClientTestStrings.TESTJOB)) {
    setTestJobName(cmd.getOptionValue(ClientTestStrings.TESTJOB));
  }
  if (cmd.hasOption(ClientTestStrings.AUTO_SCREENSHOT)) {
    setAutoScreenshot(false);
  }
  if (cmd.hasOption(ClientTestStrings.NO_XML_SCREENSHOT)) {
    setXMLScreenshot(false);
  }
  if (cmd.hasOption(ClientTestStrings.TIMEOUT)) {
    try {
      setTimeout(Integer.parseInt(cmd.getOptionValue(ClientTestStrings.TIMEOUT)));
    }
 catch (    NumberFormatException e) {
      setTimeout(Constants.INVALID_VALUE);
    }
  }
  if (cmd.hasOption(ClientStrings.NORUN)) {
    setNoRunOptMode(TestExecutionConstants.RunSteps.validateRunStep(cmd.getOptionValue(ClientStrings.NORUN)));
  }
  if (cmd.hasOption(ClientStrings.RESULT_NAME)) {
    setFileName(cmd.getOptionValue(ClientStrings.RESULT_NAME));
  }
}