Program: 125338
Project: 125338
Buggy source:
@Override public void run(final IProgressMonitor monitor) throws CoreException {
  preImport(monitor,resManager,checkedItemRecords.toArray(new ImportItem[0]),allImportItemRecords);
  final IProxyRepositoryFactory factory=CoreRuntimePlugin.getInstance().getProxyRepositoryFactory();
  final Set<String> overwriteDeletedItems=new HashSet<String>();
  final Set<String> idDeletedBeforeImport=new HashSet<String>();
  Map<String,String> nameToIdMap=new HashMap<String,String>();
  for (  ImportItem itemRecord : checkedItemRecords) {
    if (monitor.isCanceled()) {
      return;
    }
    if (itemRecord.isValid()) {
      if (itemRecord.getState() == State.ID_EXISTED || itemRecord.getState() == State.NAME_AND_ID_EXISTED_BOTH) {
        String id=nameToIdMap.get(itemRecord.getProperty().getLabel() + ERepositoryObjectType.getItemType(itemRecord.getProperty().getItem()).toString());
        if (id == null) {
          try {
            if (overwrite && itemRecord.getState() == State.NAME_AND_ID_EXISTED_BOTH) {
              IRepositoryViewObject object=itemRecord.getExistingItemWithSameName();
              if (object != null) {
                if (ProjectManager.getInstance().isInCurrentMainProject(object.getProperty())) {
                  id=object.getId();
                }
              }
            }
          }
 catch (          Exception e) {
            ExceptionHandler.process(e,Priority.WARN);
          }
          if (id == null) {
            id=EcoreUtil.generateUUID();
          }
          nameToIdMap.put(itemRecord.getProperty().getLabel() + ERepositoryObjectType.getItemType(itemRecord.getProperty().getItem()).toString(),id);
        }
        String oldId=itemRecord.getProperty().getId();
        itemRecord.getProperty().setId(id);
        try {
          changeIdManager.mapOldId2NewId(oldId,id);
        }
 catch (        Exception e) {
          ExceptionHandler.process(e);
        }
      }
    }
  }
  try {
    importItemRecordsWithRelations(monitor,resManager,checkedItemRecords,overwrite,allImportItemRecords,destinationPath,overwriteDeletedItems,idDeletedBeforeImport);
  }
 catch (  Exception e) {
    if (Platform.inDebugMode()) {
      ExceptionHandler.process(e);
    }
    throw new CoreException(new Status(IStatus.ERROR,FrameworkUtil.getBundle(this.getClass()).getSymbolicName(),Messages.getString("String_Node_Str"),e));
  }
  if (PluginChecker.isJobLetPluginLoaded()) {
    IJobletProviderService service=(IJobletProviderService)GlobalServiceRegister.getDefault().getService(IJobletProviderService.class);
    if (service != null) {
      service.loadComponentsFromProviders();
    }
  }
  ImportCacheHelper.getInstance().checkDeletedFolders();
  ImportCacheHelper.getInstance().checkDeletedItems();
  monitor.done();
  TimeMeasure.step("String_Node_Str","String_Node_Str");
  if (RelationshipItemBuilder.getInstance().isNeedSaveRelations()) {
    RelationshipItemBuilder.getInstance().saveRelations();
    TimeMeasure.step("String_Node_Str","String_Node_Str");
  }
 else {
    try {
      factory.saveProject(ProjectManager.getInstance().getCurrentProject());
    }
 catch (    PersistenceException e) {
      if (Platform.inDebugMode()) {
        ExceptionHandler.process(e);
      }
      throw new CoreException(new Status(IStatus.ERROR,FrameworkUtil.getBundle(this.getClass()).getSymbolicName(),Messages.getString("String_Node_Str"),e));
    }
    TimeMeasure.step("String_Node_Str","String_Node_Str");
  }
  if (!checkedFolders.isEmpty()) {
    for (    EmptyFolderImportItem folder : checkedFolders) {
      boolean exist=false;
      ERepositoryObjectType repositoryType=folder.getRepositoryType();
      IPath path=folder.getPath();
      if (destinationPath != null) {
        IPath desPath=destinationPath.makeRelativeTo(new Path(repositoryType.getFolder()));
        path=desPath.append(folder.getPath());
      }
      String label=folder.getLabel();
      FolderItem getFolderItem=factory.getFolderItem(ProjectManager.getInstance().getCurrentProject(),repositoryType,path);
      if (getFolderItem != null) {
        for (        Object obj : getFolderItem.getChildren()) {
          if (obj instanceof FolderItem) {
            FolderItem existFolder=(FolderItem)obj;
            if (label.equals(existFolder.getProperty().getLabel())) {
              exist=true;
              break;
            }
          }
        }
      }
      if (!exist) {
        try {
          factory.createFolder(repositoryType,path,label);
        }
 catch (        PersistenceException e) {
          ExceptionHandler.process(e);
        }
      }
    }
  }
  List<ImportItem> importedItemRecords=ImportCacheHelper.getInstance().getImportedItemRecords();
  postImport(monitor,resManager,importedItemRecords.toArray(new ImportItem[0]));
  try {
    changeIdManager.changeIds();
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
  unloadImportItems(allImportItemRecords);
}

Fixed version (ground truth):
@Override public void run(final IProgressMonitor monitor) throws CoreException {
  preImport(monitor,resManager,checkedItemRecords.toArray(new ImportItem[0]),allImportItemRecords);
  final IProxyRepositoryFactory factory=CoreRuntimePlugin.getInstance().getProxyRepositoryFactory();
  final Set<String> overwriteDeletedItems=new HashSet<String>();
  final Set<String> idDeletedBeforeImport=new HashSet<String>();
  Map<String,String> nameToIdMap=new HashMap<String,String>();
  for (  ImportItem itemRecord : checkedItemRecords) {
    if (monitor.isCanceled()) {
      return;
    }
    if (itemRecord.isValid()) {
      if (itemRecord.getState() == State.ID_EXISTED || itemRecord.getState() == State.NAME_AND_ID_EXISTED_BOTH) {
        String id=nameToIdMap.get(itemRecord.getProperty().getLabel() + ERepositoryObjectType.getItemType(itemRecord.getProperty().getItem()).toString());
        if (id == null) {
          try {
            if (overwrite && itemRecord.getState() == State.NAME_AND_ID_EXISTED_BOTH) {
              IRepositoryViewObject object=itemRecord.getExistingItemWithSameName();
              if (object != null) {
                if (ProjectManager.getInstance().isInCurrentMainProject(object.getProperty())) {
                  id=object.getId();
                }
              }
            }
          }
 catch (          Exception e) {
            ExceptionHandler.process(e,Priority.WARN);
          }
          if (id == null) {
            id=EcoreUtil.generateUUID();
          }
          nameToIdMap.put(itemRecord.getProperty().getLabel() + ERepositoryObjectType.getItemType(itemRecord.getProperty().getItem()).toString(),id);
        }
        String oldId=itemRecord.getProperty().getId();
        itemRecord.getProperty().setId(id);
        try {
          changeIdManager.mapOldId2NewId(oldId,id);
        }
 catch (        Exception e) {
          ExceptionHandler.process(e);
        }
      }
    }
  }
  try {
    importItemRecordsWithRelations(monitor,resManager,checkedItemRecords,overwrite,allImportItemRecords,destinationPath,overwriteDeletedItems,idDeletedBeforeImport);
  }
 catch (  Exception e) {
    if (Platform.inDebugMode()) {
      ExceptionHandler.process(e);
    }
    throw new CoreException(new Status(IStatus.ERROR,FrameworkUtil.getBundle(this.getClass()).getSymbolicName(),Messages.getString("String_Node_Str"),e));
  }
  ImportCacheHelper.getInstance().checkDeletedFolders();
  ImportCacheHelper.getInstance().checkDeletedItems();
  monitor.done();
  TimeMeasure.step("String_Node_Str","String_Node_Str");
  if (RelationshipItemBuilder.getInstance().isNeedSaveRelations()) {
    RelationshipItemBuilder.getInstance().saveRelations();
    TimeMeasure.step("String_Node_Str","String_Node_Str");
  }
 else {
    try {
      factory.saveProject(ProjectManager.getInstance().getCurrentProject());
    }
 catch (    PersistenceException e) {
      if (Platform.inDebugMode()) {
        ExceptionHandler.process(e);
      }
      throw new CoreException(new Status(IStatus.ERROR,FrameworkUtil.getBundle(this.getClass()).getSymbolicName(),Messages.getString("String_Node_Str"),e));
    }
    TimeMeasure.step("String_Node_Str","String_Node_Str");
  }
  if (!checkedFolders.isEmpty()) {
    for (    EmptyFolderImportItem folder : checkedFolders) {
      boolean exist=false;
      ERepositoryObjectType repositoryType=folder.getRepositoryType();
      IPath path=folder.getPath();
      if (destinationPath != null) {
        IPath desPath=destinationPath.makeRelativeTo(new Path(repositoryType.getFolder()));
        path=desPath.append(folder.getPath());
      }
      String label=folder.getLabel();
      FolderItem getFolderItem=factory.getFolderItem(ProjectManager.getInstance().getCurrentProject(),repositoryType,path);
      if (getFolderItem != null) {
        for (        Object obj : getFolderItem.getChildren()) {
          if (obj instanceof FolderItem) {
            FolderItem existFolder=(FolderItem)obj;
            if (label.equals(existFolder.getProperty().getLabel())) {
              exist=true;
              break;
            }
          }
        }
      }
      if (!exist) {
        try {
          factory.createFolder(repositoryType,path,label);
        }
 catch (        PersistenceException e) {
          ExceptionHandler.process(e);
        }
      }
    }
  }
  List<ImportItem> importedItemRecords=ImportCacheHelper.getInstance().getImportedItemRecords();
  postImport(monitor,resManager,importedItemRecords.toArray(new ImportItem[0]));
  try {
    changeIdManager.changeIds();
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
  unloadImportItems(allImportItemRecords);
}