Program: 28912
Project: 28912
Buggy source:
/** 
 * Search all the parameters that were actually specified to see if any of them are FILE type parameters.  If so, check for the "--upload" option.
 */
private void initializeDoUpload() throws CommandException {
  boolean sawFile=false;
  boolean sawDirectory=false;
  boolean sawUploadableFile=false;
  for (  Map.Entry<String,List<String>> param : options.entrySet()) {
    String paramName=param.getKey();
    if (paramName.equals("String_Node_Str"))     continue;
    ParamModel opt=commandModel.getModelFor(paramName);
    if (opt != null && opt.getType() == File.class) {
      sawFile=true;
      final File optionFile=new File(options.getOne(opt.getName()));
      sawDirectory|=optionFile.isDirectory();
      sawUploadableFile|=optionFile.isFile();
    }
  }
  ParamModel operandParam=getOperandModel();
  if (operandParam != null && (operandParam.getType() == File.class || operandParam.getType() == File[].class)) {
    sawFile|=!operands.isEmpty();
    for (    String operandValue : operands) {
      final File operandFile=new File(operandValue);
      sawDirectory|=operandFile.isDirectory();
      sawUploadableFile|=operandFile.isFile();
    }
  }
  if (sawFile) {
    logger.finer("String_Node_Str");
    String upString=getOption("String_Node_Str");
    if (ok(upString)) {
      doUpload=Boolean.parseBoolean(upString);
    }
 else {
      doUpload=!isLocal(host) && sawUploadableFile;
    }
    if (prohibitDirectoryUploads && sawDirectory && doUpload) {
      logger.finer("String_Node_Str" + upString + "String_Node_Str"+ doUpload);
      throw new CommandException(strings.get("String_Node_Str"));
    }
  }
  if (addedUploadOption) {
    logger.finer("String_Node_Str");
    ParameterMap noptions=new ParameterMap();
    for (    Map.Entry<String,List<String>> e : options.entrySet()) {
      if (!e.getKey().equals("String_Node_Str"))       noptions.set(e.getKey(),e.getValue());
    }
    options=noptions;
  }
  logger.finer("String_Node_Str" + doUpload);
}

Fixed version (ground truth):
/** 
 * Search all the parameters that were actually specified to see if any of them are FILE type parameters.  If so, check for the "--upload" option.
 */
private void initializeDoUpload() throws CommandException {
  boolean sawFile=false;
  boolean sawDirectory=false;
  boolean sawUploadableFile=false;
  for (  Map.Entry<String,List<String>> param : options.entrySet()) {
    String paramName=param.getKey();
    if (paramName.equals("String_Node_Str"))     continue;
    ParamModel opt=commandModel.getModelFor(paramName);
    if (opt != null && (opt.getType() == File.class || opt.getType() == File[].class)) {
      sawFile=true;
      for (      String fname : options.get(opt.getName())) {
        final File optionFile=new File(fname);
        sawDirectory|=optionFile.isDirectory();
        sawUploadableFile|=optionFile.isFile();
      }
    }
  }
  ParamModel operandParam=getOperandModel();
  if (operandParam != null && (operandParam.getType() == File.class || operandParam.getType() == File[].class)) {
    sawFile|=!operands.isEmpty();
    for (    String operandValue : operands) {
      final File operandFile=new File(operandValue);
      sawDirectory|=operandFile.isDirectory();
      sawUploadableFile|=operandFile.isFile();
    }
  }
  if (sawFile) {
    logger.finer("String_Node_Str");
    String upString=getOption("String_Node_Str");
    if (ok(upString)) {
      doUpload=Boolean.parseBoolean(upString);
    }
 else {
      doUpload=!isLocal(host) && sawUploadableFile;
    }
    if (prohibitDirectoryUploads && sawDirectory && doUpload) {
      logger.finer("String_Node_Str" + upString + "String_Node_Str"+ doUpload);
      throw new CommandException(strings.get("String_Node_Str"));
    }
  }
  if (addedUploadOption) {
    logger.finer("String_Node_Str");
    ParameterMap noptions=new ParameterMap();
    for (    Map.Entry<String,List<String>> e : options.entrySet()) {
      if (!e.getKey().equals("String_Node_Str"))       noptions.set(e.getKey(),e.getValue());
    }
    options=noptions;
  }
  logger.finer("String_Node_Str" + doUpload);
}