Program: 28907
Project: 28907
Buggy source:
/** 
 * Run the command using the specified arguments. Return the output of the command.
 */
public ParameterMap processParams(ParameterMap opts) throws CommandException {
  if (opts == null) {
    opts=new ParameterMap();
  }
  getCommandModel();
  options=new ParameterMap();
  for (  Map.Entry<String,List<String>> o : opts.entrySet()) {
    String key=o.getKey();
    List<String> value=o.getValue();
    options.set(key.toLowerCase(Locale.ENGLISH),value);
  }
  operands=options.get("String_Node_Str");
  try {
    initializeDoUpload();
    if (doUpload) {
      outboundPayload=new RestPayloadImpl.Outbound(true);
    }
    ParameterMap result=new ParameterMap();
    ParamModel operandParam=null;
    for (    ParamModel opt : commandModel.getParameters()) {
      if (opt.getParam().primary()) {
        operandParam=opt;
        continue;
      }
      String paramName=opt.getName();
      List<String> paramValues=new ArrayList<String>(options.get(paramName.toLowerCase(Locale.ENGLISH)));
      if (!opt.getParam().alias().isEmpty()) {
        paramValues.addAll(options.get(opt.getParam().alias().toLowerCase(Locale.ENGLISH)));
      }
      if (!opt.getParam().multiple() && paramValues.size() > 1) {
        throw new CommandException(strings.get("String_Node_Str",paramName));
      }
      if (paramValues.isEmpty()) {
        String envValue=getFromEnvironment(paramName);
        if (envValue != null) {
          paramValues.add(envValue);
        }
      }
      if (paramValues.isEmpty()) {
        if (!opt.getParam().optional()) {
          throw new CommandException(strings.get("String_Node_Str",paramName));
        }
        continue;
      }
      for (      String paramValue : paramValues) {
        if (opt.getType() == File.class || opt.getType() == File[].class) {
          addFileOption(result,paramName,paramValue);
        }
 else         if (opt.getParam().password()) {
          addPasswordOption(result,paramName,paramValue);
        }
 else {
          addStringOption(result,paramName,paramValue);
        }
      }
    }
    for (    String operand : operands) {
      if (operandParam.getType() == File.class || operandParam.getType() == File[].class) {
        addFileOption(result,"String_Node_Str",operand);
      }
 else {
        addStringOption(result,"String_Node_Str",operand);
      }
    }
    return result;
  }
 catch (  IOException ioex) {
    throw new CommandException("String_Node_Str",ioex);
  }
}

Fixed version (ground truth):
/** 
 * Run the command using the specified arguments. Return the output of the command.
 */
public ParameterMap processParams(ParameterMap opts) throws CommandException {
  if (opts == null) {
    opts=new ParameterMap();
  }
  getCommandModel();
  options=new ParameterMap();
  for (  Map.Entry<String,List<String>> o : opts.entrySet()) {
    String key=o.getKey();
    List<String> value=o.getValue();
    options.set(key.toLowerCase(Locale.ENGLISH),value);
  }
  operands=options.get("String_Node_Str");
  try {
    initializeDoUpload();
    if (doUpload) {
      outboundPayload=new RestPayloadImpl.Outbound(true);
    }
    ParameterMap result=new ParameterMap();
    ParamModel operandParam=null;
    for (    ParamModel opt : commandModel.getParameters()) {
      if (opt.getParam().primary()) {
        operandParam=opt;
        continue;
      }
      String paramName=opt.getName();
      List<String> paramValues=new ArrayList<String>(options.get(paramName.toLowerCase(Locale.ENGLISH)));
      if (!opt.getParam().alias().isEmpty() && !paramName.equalsIgnoreCase(opt.getParam().alias())) {
        paramValues.addAll(options.get(opt.getParam().alias().toLowerCase(Locale.ENGLISH)));
      }
      if (!opt.getParam().multiple() && paramValues.size() > 1) {
        throw new CommandException(strings.get("String_Node_Str",paramName));
      }
      if (paramValues.isEmpty()) {
        String envValue=getFromEnvironment(paramName);
        if (envValue != null) {
          paramValues.add(envValue);
        }
      }
      if (paramValues.isEmpty()) {
        if (!opt.getParam().optional()) {
          throw new CommandException(strings.get("String_Node_Str",paramName));
        }
        continue;
      }
      for (      String paramValue : paramValues) {
        if (opt.getType() == File.class || opt.getType() == File[].class) {
          addFileOption(result,paramName,paramValue);
        }
 else         if (opt.getParam().password()) {
          addPasswordOption(result,paramName,paramValue);
        }
 else {
          addStringOption(result,paramName,paramValue);
        }
      }
    }
    for (    String operand : operands) {
      if (operandParam.getType() == File.class || operandParam.getType() == File[].class) {
        addFileOption(result,"String_Node_Str",operand);
      }
 else {
        addStringOption(result,"String_Node_Str",operand);
      }
    }
    return result;
  }
 catch (  IOException ioex) {
    throw new CommandException("String_Node_Str",ioex);
  }
}