Program: 51957
Project: 51957
Buggy source:
/** 
 * Command to delete an EPerson. 
 */
private static int cmdDelete(Context context,String[] argv){
  Options options=new Options();
  options.addOption(VERB_DELETE);
  final OptionGroup identityOptions=new OptionGroup();
  identityOptions.addOption(OPT_EMAIL);
  identityOptions.addOption(OPT_NETID);
  options.addOptionGroup(identityOptions);
  options.addOption("String_Node_Str","String_Node_Str",false,"String_Node_Str");
  GnuParser parser=new GnuParser();
  CommandLine command;
  try {
    command=parser.parse(options,argv);
  }
 catch (  ParseException e) {
    System.err.println(e.getMessage());
    return 1;
  }
  if (command.hasOption('h')) {
    new HelpFormatter().printHelp("String_Node_Str",options);
    return 0;
  }
  EPerson eperson=null;
  try {
    if (command.hasOption(OPT_NETID.getOpt())) {
      eperson=ePersonService.findByNetid(context,command.getOptionValue(OPT_NETID.getOpt()));
    }
 else     if (command.hasOption(OPT_EMAIL.getOpt())) {
      eperson=ePersonService.findByEmail(context,command.getOptionValue(OPT_EMAIL.getOpt()));
    }
 else {
      System.err.println("String_Node_Str");
      return 1;
    }
  }
 catch (  SQLException e) {
    System.err.append(e.getMessage());
    return 1;
  }
  if (null == eperson) {
    System.err.println("String_Node_Str");
    return 1;
  }
  try {
    ePersonService.delete(context,eperson);
    context.complete();
    System.out.printf("String_Node_Str",eperson.getID());
  }
 catch (  SQLException ex) {
    System.err.println(ex.getMessage());
    return 1;
  }
catch (  AuthorizeException ex) {
    System.err.println(ex.getMessage());
    return 1;
  }
catch (  IOException ex) {
    System.err.println(ex.getMessage());
    return 1;
  }
  return 0;
}

Fixed version (ground truth):
/** 
 * Command to delete an EPerson. 
 */
private static int cmdDelete(Context context,String[] argv){
  Options options=new Options();
  options.addOption(VERB_DELETE);
  final OptionGroup identityOptions=new OptionGroup();
  identityOptions.addOption(OPT_EMAIL);
  identityOptions.addOption(OPT_NETID);
  options.addOptionGroup(identityOptions);
  options.addOption("String_Node_Str","String_Node_Str",false,"String_Node_Str");
  GnuParser parser=new GnuParser();
  CommandLine command;
  try {
    command=parser.parse(options,argv);
  }
 catch (  ParseException e) {
    System.err.println(e.getMessage());
    return 1;
  }
  if (command.hasOption('h')) {
    new HelpFormatter().printHelp("String_Node_Str",options);
    return 0;
  }
  EPerson eperson=null;
  try {
    if (command.hasOption(OPT_NETID.getOpt())) {
      eperson=ePersonService.findByNetid(context,command.getOptionValue(OPT_NETID.getOpt()));
    }
 else     if (command.hasOption(OPT_EMAIL.getOpt())) {
      eperson=ePersonService.findByEmail(context,command.getOptionValue(OPT_EMAIL.getOpt()));
    }
 else {
      System.err.println("String_Node_Str");
      return 1;
    }
  }
 catch (  SQLException e) {
    System.err.append(e.getMessage());
    return 1;
  }
  if (null == eperson) {
    System.err.println("String_Node_Str");
    return 1;
  }
  try {
    ePersonService.delete(context,eperson);
    context.complete();
    System.out.printf("String_Node_Str",eperson.getID().toString());
  }
 catch (  SQLException ex) {
    System.err.println(ex.getMessage());
    return 1;
  }
catch (  AuthorizeException ex) {
    System.err.println(ex.getMessage());
    return 1;
  }
catch (  IOException ex) {
    System.err.println(ex.getMessage());
    return 1;
  }
  return 0;
}