Program: 51960
Project: 51960
Buggy source:
@Override public void run(){
  Context context=null;
  String importDir=null;
  EPerson eperson=null;
  try {
    context=new Context();
    eperson=ePersonService.find(context,oldEPerson.getID());
    context.setCurrentUser(eperson);
    context.setIgnoreAuthorization(true);
    boolean isResume=theResumeDir != null;
    List<Collection> collectionList=new ArrayList<>();
    if (theOtherCollections != null) {
      for (      String colID : theOtherCollections) {
        UUID colId=UUID.fromString(colID);
        if (!theOwningCollection.getID().equals(colId)) {
          Collection col=collectionService.find(context,colId);
          if (col != null) {
            collectionList.add(col);
          }
        }
      }
    }
    importDir=ConfigurationManager.getProperty("String_Node_Str") + File.separator + "String_Node_Str"+ File.separator+ context.getCurrentUser().getID()+ File.separator+ (isResume ? theResumeDir : (new GregorianCalendar()).getTimeInMillis());
    File importDirFile=new File(importDir);
    if (!importDirFile.exists()) {
      boolean success=importDirFile.mkdirs();
      if (!success) {
        log.info("String_Node_Str");
        throw new Exception("String_Node_Str");
      }
    }
    String dataPath=null;
    String dataDir=null;
    if (theInputType.equals("String_Node_Str")) {
      dataPath=importDirFile + File.separator + "String_Node_Str";
      dataDir=importDirFile + File.separator + "String_Node_Str"+ File.separator;
    }
 else     if (theInputType.equals("String_Node_Str")) {
      FileUtils.copyFileToDirectory(new File(theFilePath),importDirFile);
      dataPath=importDirFile + File.separator + (new File(theFilePath)).getName();
      dataDir=importDirFile + File.separator + "String_Node_Str"+ File.separator;
    }
 else {
      dataPath=importDirFile + File.separator + (new File(theFilePath)).getName();
      dataDir=importDirFile + File.separator + "String_Node_Str"+ File.separator;
    }
    if (isResume) {
      if (!theInputType.equals("String_Node_Str")) {
        (new File(dataPath)).delete();
      }
      (new File(importDirFile + File.separator + "String_Node_Str")).delete();
      FileDeleteStrategy.FORCE.delete(new File(dataDir));
      FileDeleteStrategy.FORCE.delete(new File(importDirFile + File.separator + "String_Node_Str"+ File.separator));
    }
    String sourcePath=null;
    if (theInputType.equals("String_Node_Str")) {
      OutputStream os=new FileOutputStream(dataPath);
      byte[] b=new byte[2048];
      int length;
      InputStream is=new URL(theFilePath).openStream();
      while ((length=is.read(b)) != -1) {
        os.write(b,0,length);
      }
      is.close();
      os.close();
      sourcePath=unzip(new File(dataPath),dataDir);
      FileUtils.moveDirectory(new File(sourcePath),new File(importDirFile + File.separator + "String_Node_Str"+ File.separator));
      FileDeleteStrategy.FORCE.delete(new File(dataDir));
      dataDir=importDirFile + File.separator + "String_Node_Str"+ File.separator;
    }
 else     if (theInputType.equals("String_Node_Str")) {
      sourcePath=unzip(new File(dataPath),dataDir);
      FileUtils.moveDirectory(new File(sourcePath),new File(importDirFile + File.separator + "String_Node_Str"+ File.separator));
      FileDeleteStrategy.FORCE.delete(new File(dataDir));
      dataDir=importDirFile + File.separator + "String_Node_Str"+ File.separator;
    }
    String mapFilePath=importDirFile + File.separator + "String_Node_Str";
    List<Collection> finalCollections=null;
    if (theOwningCollection != null) {
      finalCollections.add(theOwningCollection);
      finalCollections.addAll(collectionList);
    }
    setResume(isResume);
    if (theInputType.equals("String_Node_Str") || theInputType.equals("String_Node_Str")) {
      addItems(context,finalCollections,dataDir,mapFilePath,template);
    }
 else {
      addBTEItems(context,finalCollections,theFilePath,mapFilePath,useTemplateItem,theInputType,dataDir);
    }
    emailSuccessMessage(context,eperson,mapFilePath);
    context.complete();
  }
 catch (  Exception e) {
    e.printStackTrace();
    String exceptionString=ExceptionUtils.getStackTrace(e);
    try {
      File importDirFile=new File(importDir + File.separator + "String_Node_Str");
      PrintWriter errorWriter=new PrintWriter(importDirFile);
      errorWriter.print(exceptionString);
      errorWriter.close();
      emailErrorMessage(eperson,exceptionString);
      throw new Exception(e.getMessage());
    }
 catch (    Exception e2) {
    }
  }
 finally {
    try {
      context.complete();
    }
 catch (    SQLException sqle) {
      context.abort();
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  Context context=null;
  String importDir=null;
  EPerson eperson=null;
  try {
    context=new Context();
    eperson=ePersonService.find(context,oldEPerson.getID());
    context.setCurrentUser(eperson);
    context.setIgnoreAuthorization(true);
    boolean isResume=theResumeDir != null;
    List<Collection> collectionList=new ArrayList<>();
    if (theOtherCollections != null) {
      for (      String colID : theOtherCollections) {
        UUID colId=UUID.fromString(colID);
        if (!theOwningCollection.getID().equals(colId)) {
          Collection col=collectionService.find(context,colId);
          if (col != null) {
            collectionList.add(col);
          }
        }
      }
    }
    importDir=ConfigurationManager.getProperty("String_Node_Str") + File.separator + "String_Node_Str"+ File.separator+ context.getCurrentUser().getID()+ File.separator+ (isResume ? theResumeDir : (new GregorianCalendar()).getTimeInMillis());
    File importDirFile=new File(importDir);
    if (!importDirFile.exists()) {
      boolean success=importDirFile.mkdirs();
      if (!success) {
        log.info("String_Node_Str");
        throw new Exception("String_Node_Str");
      }
    }
    String dataPath=null;
    String dataDir=null;
    if (theInputType.equals("String_Node_Str")) {
      dataPath=importDirFile + File.separator + "String_Node_Str";
      dataDir=importDirFile + File.separator + "String_Node_Str"+ File.separator;
    }
 else     if (theInputType.equals("String_Node_Str")) {
      FileUtils.copyFileToDirectory(new File(theFilePath),importDirFile);
      dataPath=importDirFile + File.separator + (new File(theFilePath)).getName();
      dataDir=importDirFile + File.separator + "String_Node_Str"+ File.separator;
    }
 else {
      dataPath=importDirFile + File.separator + (new File(theFilePath)).getName();
      dataDir=importDirFile + File.separator + "String_Node_Str"+ File.separator;
    }
    if (isResume) {
      if (!theInputType.equals("String_Node_Str")) {
        (new File(dataPath)).delete();
      }
      (new File(importDirFile + File.separator + "String_Node_Str")).delete();
      FileDeleteStrategy.FORCE.delete(new File(dataDir));
      FileDeleteStrategy.FORCE.delete(new File(importDirFile + File.separator + "String_Node_Str"+ File.separator));
    }
    String sourcePath=null;
    if (theInputType.equals("String_Node_Str")) {
      OutputStream os=new FileOutputStream(dataPath);
      byte[] b=new byte[2048];
      int length;
      InputStream is=new URL(theFilePath).openStream();
      while ((length=is.read(b)) != -1) {
        os.write(b,0,length);
      }
      is.close();
      os.close();
      sourcePath=unzip(new File(dataPath),dataDir);
      FileUtils.moveDirectory(new File(sourcePath),new File(importDirFile + File.separator + "String_Node_Str"+ File.separator));
      FileDeleteStrategy.FORCE.delete(new File(dataDir));
      dataDir=importDirFile + File.separator + "String_Node_Str"+ File.separator;
    }
 else     if (theInputType.equals("String_Node_Str")) {
      sourcePath=unzip(new File(dataPath),dataDir);
      FileUtils.moveDirectory(new File(sourcePath),new File(importDirFile + File.separator + "String_Node_Str"+ File.separator));
      FileDeleteStrategy.FORCE.delete(new File(dataDir));
      dataDir=importDirFile + File.separator + "String_Node_Str"+ File.separator;
    }
    String mapFilePath=importDirFile + File.separator + "String_Node_Str";
    List<Collection> finalCollections=null;
    if (theOwningCollection != null) {
      finalCollections=new ArrayList<>();
      finalCollections.add(theOwningCollection);
      finalCollections.addAll(collectionList);
    }
    setResume(isResume);
    if (theInputType.equals("String_Node_Str") || theInputType.equals("String_Node_Str")) {
      addItems(context,finalCollections,dataDir,mapFilePath,template);
    }
 else {
      addBTEItems(context,finalCollections,theFilePath,mapFilePath,useTemplateItem,theInputType,dataDir);
    }
    emailSuccessMessage(context,eperson,mapFilePath);
    context.complete();
  }
 catch (  Exception e) {
    e.printStackTrace();
    String exceptionString=ExceptionUtils.getStackTrace(e);
    try {
      File importDirFile=new File(importDir + File.separator + "String_Node_Str");
      PrintWriter errorWriter=new PrintWriter(importDirFile);
      errorWriter.print(exceptionString);
      errorWriter.close();
      emailErrorMessage(eperson,exceptionString);
      throw new Exception(e.getMessage());
    }
 catch (    Exception e2) {
    }
  }
 finally {
    try {
      context.complete();
    }
 catch (    SQLException sqle) {
      context.abort();
    }
  }
}