Program: 69594
Project: 69594
Buggy source:
public static RepositoryEntry deployCourseFromZIP(File exportedCourseZIPFile,String softKey,int access){
  OLATResource newCourseResource=olatResourceManager.createOLATResourceInstance(CourseModule.class);
  ICourse course=CourseFactory.importCourseFromZip(newCourseResource,exportedCourseZIPFile);
  if (course == null) {
    log.error("String_Node_Str" + exportedCourseZIPFile.getAbsolutePath());
    return null;
  }
  File courseExportData=course.getCourseExportDataDir().getBasefile();
  RepositoryEntryImportExport importExport=new RepositoryEntryImportExport(courseExportData);
  if (!StringHelper.containsNonWhitespace(softKey)) {
    softKey=importExport.getSoftkey();
  }
  RepositoryEntry existingEntry=repositoryManager.lookupRepositoryEntryBySoftkey(softKey,false);
  if (existingEntry != null) {
    log.info("String_Node_Str" + softKey + "String_Node_Str");
    UserCourseInformationsManager userCourseInformationsManager=CoreSpringFactory.getImpl(UserCourseInformationsManager.class);
    userCourseInformationsManager.deleteUserCourseInformations(existingEntry);
    CourseFactory.deleteCourse(newCourseResource);
    return existingEntry;
  }
  newCourseResource=olatResourceManager.findOrPersistResourceable(newCourseResource);
  RepositoryEntry re=repositoryService.create(importExport.getInitialAuthor(),importExport.getResourceName(),importExport.getDisplayName(),importExport.getDescription(),newCourseResource);
  re.setOlatResource(newCourseResource);
  re.setSoftkey(softKey);
  re.setAccess(access);
  repositoryService.update(re);
  course=openCourseEditSession(course.getResourceableId());
  CourseGroupManager cgm=course.getCourseEnvironment().getCourseGroupManager();
  cgm.importCourseBusinessGroups(courseExportData);
  deployReferencedRepositoryEntries(courseExportData,course,(CourseEditorTreeNode)course.getEditorTreeModel().getRootNode());
  registerReferences(course,course.getRunStructure().getRootNode());
  deployReferencedSharedFolders(courseExportData,course);
  deployReferencedGlossary(courseExportData,course);
  closeCourseEditSession(course.getResourceableId(),true);
  FileUtils.deleteDirsAndFiles(courseExportData,true,true);
  log.info("String_Node_Str" + re.getDisplayname() + "String_Node_Str"+ exportedCourseZIPFile.getAbsolutePath());
  return re;
}

Fixed version (ground truth):
public static RepositoryEntry deployCourseFromZIP(File exportedCourseZIPFile,String softKey,int access){
  OLATResource newCourseResource=olatResourceManager.createOLATResourceInstance(CourseModule.class);
  ICourse course=CourseFactory.importCourseFromZip(newCourseResource,exportedCourseZIPFile);
  if (course == null) {
    log.error("String_Node_Str" + exportedCourseZIPFile.getAbsolutePath());
    return null;
  }
  File courseExportData=course.getCourseExportDataDir().getBasefile();
  RepositoryEntryImportExport importExport=new RepositoryEntryImportExport(courseExportData);
  if (!StringHelper.containsNonWhitespace(softKey)) {
    softKey=importExport.getSoftkey();
  }
  RepositoryEntry existingEntry=repositoryManager.lookupRepositoryEntryBySoftkey(softKey,false);
  if (existingEntry != null) {
    log.info("String_Node_Str" + softKey + "String_Node_Str");
    UserCourseInformationsManager userCourseInformationsManager=CoreSpringFactory.getImpl(UserCourseInformationsManager.class);
    userCourseInformationsManager.deleteUserCourseInformations(existingEntry);
    CourseFactory.deleteCourse(newCourseResource);
    return existingEntry;
  }
  newCourseResource=olatResourceManager.findOrPersistResourceable(newCourseResource);
  RepositoryEntry re=repositoryService.create(importExport.getInitialAuthor(),importExport.getResourceName(),importExport.getDisplayName(),importExport.getDescription(),newCourseResource);
  re.setOlatResource(newCourseResource);
  re.setSoftkey(softKey);
  re.setAccess(access);
  repositoryService.update(re);
  course=openCourseEditSession(course.getResourceableId());
  CourseGroupManager cgm=course.getCourseEnvironment().getCourseGroupManager();
  cgm.importCourseBusinessGroups(courseExportData);
  deployReferencedRepositoryEntries(courseExportData,course,(CourseEditorTreeNode)course.getEditorTreeModel().getRootNode());
  registerReferences(course,(CourseEditorTreeNode)course.getEditorTreeModel().getRootNode());
  deployReferencedSharedFolders(courseExportData,course);
  deployReferencedGlossary(courseExportData,course);
  closeCourseEditSession(course.getResourceableId(),true);
  FileUtils.deleteDirsAndFiles(courseExportData,true,true);
  log.info("String_Node_Str" + re.getDisplayname() + "String_Node_Str"+ exportedCourseZIPFile.getAbsolutePath());
  return re;
}