Program: 52226
Project: 52226
Buggy source:
/** 
 * main method to run the metadata exporter
 * @param argv the command line arguments given
 * @throws Exception Thrown if something goes wrong with the import
 */
public static void main(String[] argv){
  CommandLineParser parser=new PosixParser();
  Options options=new Options();
  options.addOption("String_Node_Str","String_Node_Str",true,"String_Node_Str");
  options.addOption("String_Node_Str","String_Node_Str",true,"String_Node_Str");
  options.addOption("String_Node_Str","String_Node_Str",false,"String_Node_Str");
  options.addOption("String_Node_Str","String_Node_Str",false,"String_Node_Str");
  options.addOption("String_Node_Str","String_Node_Str",false,"String_Node_Str");
  options.addOption("String_Node_Str","String_Node_Str",false,"String_Node_Str");
  options.addOption("String_Node_Str","String_Node_Str",false,"String_Node_Str");
  CommandLine line;
  try {
    line=parser.parse(options,argv);
  }
 catch (  ParseException pe) {
    System.err.println("String_Node_Str" + pe.getMessage());
    System.exit(1);
    return;
  }
  if (line.hasOption('h')) {
    printHelp(options,0);
  }
  if (!line.hasOption('f')) {
    System.err.println("String_Node_Str");
    printHelp(options,1);
  }
  String filename=line.getOptionValue('f');
  boolean useTemplate=false;
  if (line.hasOption('t')) {
    useTemplate=true;
  }
  boolean useWorkflow=false;
  boolean workflowNotify=false;
  if (line.hasOption('w')) {
    useWorkflow=true;
    if (line.hasOption('n')) {
      workflowNotify=true;
    }
  }
 else   if (line.hasOption('n')) {
    System.err.println("String_Node_Str");
    System.exit(1);
  }
  Context c;
  try {
    c=new Context();
    c.turnOffAuthorisationSystem();
  }
 catch (  Exception e) {
    System.err.println("String_Node_Str" + e.getMessage());
    System.exit(1);
    return;
  }
  try {
    if (line.hasOption('e')) {
      EPerson eperson=null;
      String e=line.getOptionValue('e');
      if (e.indexOf('@') != -1) {
        eperson=EPerson.findByEmail(c,e);
      }
 else {
        eperson=EPerson.find(c,Integer.parseInt(e));
      }
      if (eperson == null) {
        System.out.println("String_Node_Str" + e);
        System.exit(1);
      }
      c.setCurrentUser(eperson);
    }
  }
 catch (  Exception e) {
    System.err.println("String_Node_Str" + e.getMessage());
    System.exit(1);
    return;
  }
  boolean change=false;
  DSpaceCSV csv;
  try {
    csv=new DSpaceCSV(new File(filename));
  }
 catch (  Exception e) {
    System.err.println("String_Node_Str" + e.getMessage());
    System.exit(1);
    return;
  }
  MetadataImport importer=new MetadataImport(c,csv.getCSVLines());
  ArrayList<BulkEditChange> changes;
  if (!line.hasOption('s')) {
    try {
      changes=importer.runImport(false,useWorkflow,workflowNotify,useTemplate);
    }
 catch (    MetadataImportException mie) {
      System.err.println("String_Node_Str" + mie.getMessage());
      System.exit(1);
      return;
    }
    int changeCounter=displayChanges(changes,false);
    if (changeCounter > 0) {
      try {
        System.out.println("String_Node_Str" + changeCounter + "String_Node_Str");
        System.out.print("String_Node_Str");
        String yn=(new BufferedReader(new InputStreamReader(System.in))).readLine();
        if ("String_Node_Str".equalsIgnoreCase(yn)) {
          change=true;
        }
 else {
          System.out.println("String_Node_Str");
        }
      }
 catch (      IOException ioe) {
        System.err.println("String_Node_Str" + ioe.getMessage());
        System.err.println("String_Node_Str");
        System.exit(1);
      }
    }
 else {
      System.out.println("String_Node_Str");
    }
  }
 else {
    change=true;
  }
  try {
    if (change) {
      try {
        changes=importer.runImport(true,useWorkflow,workflowNotify,useTemplate);
      }
 catch (      MetadataImportException mie) {
        System.err.println("String_Node_Str" + mie.getMessage());
        System.exit(1);
        return;
      }
      displayChanges(changes,true);
      c.commit();
    }
    c.restoreAuthSystemState();
    c.complete();
  }
 catch (  Exception e) {
    c.abort();
    System.err.println("String_Node_Str" + e.getMessage());
    System.err.println("String_Node_Str");
    System.exit(1);
  }
}

Fixed version (ground truth):
/** 
 * main method to run the metadata exporter
 * @param argv the command line arguments given
 */
public static void main(String[] argv){
  CommandLineParser parser=new PosixParser();
  Options options=new Options();
  options.addOption("String_Node_Str","String_Node_Str",true,"String_Node_Str");
  options.addOption("String_Node_Str","String_Node_Str",true,"String_Node_Str");
  options.addOption("String_Node_Str","String_Node_Str",false,"String_Node_Str");
  options.addOption("String_Node_Str","String_Node_Str",false,"String_Node_Str");
  options.addOption("String_Node_Str","String_Node_Str",false,"String_Node_Str");
  options.addOption("String_Node_Str","String_Node_Str",false,"String_Node_Str");
  options.addOption("String_Node_Str","String_Node_Str",false,"String_Node_Str");
  CommandLine line;
  try {
    line=parser.parse(options,argv);
  }
 catch (  ParseException pe) {
    System.err.println("String_Node_Str" + pe.getMessage());
    System.exit(1);
    return;
  }
  if (line.hasOption('h')) {
    printHelp(options,0);
  }
  if (!line.hasOption('f')) {
    System.err.println("String_Node_Str");
    printHelp(options,1);
  }
  String filename=line.getOptionValue('f');
  boolean useTemplate=false;
  if (line.hasOption('t')) {
    useTemplate=true;
  }
  boolean useWorkflow=false;
  boolean workflowNotify=false;
  if (line.hasOption('w')) {
    useWorkflow=true;
    if (line.hasOption('n')) {
      workflowNotify=true;
    }
  }
 else   if (line.hasOption('n')) {
    System.err.println("String_Node_Str");
    System.exit(1);
  }
  Context c;
  try {
    c=new Context();
    c.turnOffAuthorisationSystem();
  }
 catch (  Exception e) {
    System.err.println("String_Node_Str" + e.getMessage());
    System.exit(1);
    return;
  }
  try {
    if (line.hasOption('e')) {
      EPerson eperson;
      String e=line.getOptionValue('e');
      if (e.indexOf('@') != -1) {
        eperson=EPerson.findByEmail(c,e);
      }
 else {
        eperson=EPerson.find(c,Integer.parseInt(e));
      }
      if (eperson == null) {
        System.out.println("String_Node_Str" + e);
        System.exit(1);
      }
      c.setCurrentUser(eperson);
    }
  }
 catch (  Exception e) {
    System.err.println("String_Node_Str" + e.getMessage());
    System.exit(1);
    return;
  }
  boolean change=false;
  DSpaceCSV csv;
  try {
    csv=new DSpaceCSV(new File(filename));
  }
 catch (  Exception e) {
    System.err.println("String_Node_Str" + e.getMessage());
    System.exit(1);
    return;
  }
  MetadataImport importer=new MetadataImport(c,csv.getCSVLines());
  ArrayList<BulkEditChange> changes;
  if (!line.hasOption('s')) {
    try {
      changes=importer.runImport(false,useWorkflow,workflowNotify,useTemplate);
    }
 catch (    MetadataImportException mie) {
      System.err.println("String_Node_Str" + mie.getMessage());
      System.exit(1);
      return;
    }
    int changeCounter=displayChanges(changes,false);
    if (changeCounter > 0) {
      try {
        System.out.println("String_Node_Str" + changeCounter + "String_Node_Str");
        System.out.print("String_Node_Str");
        String yn=(new BufferedReader(new InputStreamReader(System.in))).readLine();
        if ("String_Node_Str".equalsIgnoreCase(yn)) {
          change=true;
        }
 else {
          System.out.println("String_Node_Str");
        }
      }
 catch (      IOException ioe) {
        System.err.println("String_Node_Str" + ioe.getMessage());
        System.err.println("String_Node_Str");
        System.exit(1);
      }
    }
 else {
      System.out.println("String_Node_Str");
    }
  }
 else {
    change=true;
  }
  try {
    if (change) {
      try {
        changes=importer.runImport(true,useWorkflow,workflowNotify,useTemplate);
      }
 catch (      MetadataImportException mie) {
        System.err.println("String_Node_Str" + mie.getMessage());
        System.exit(1);
        return;
      }
      displayChanges(changes,true);
      c.commit();
    }
    c.restoreAuthSystemState();
    c.complete();
  }
 catch (  Exception e) {
    c.abort();
    System.err.println("String_Node_Str" + e.getMessage());
    System.err.println("String_Node_Str");
    System.exit(1);
  }
}