Program: 138399
Project: 138399
Buggy source:
public void write(ItemRecord[] records,IProgressMonitor monitor){
  if (monitor == null) {
    monitor=new NullProgressMonitor();
  }
  final ItemRecord[] fRecords=records;
  final IProgressMonitor fMonitor=monitor;
  RepositoryWorkUnit<Object> workUnit=new RepositoryWorkUnit<Object>("String_Node_Str"){
    @Override protected void run(){
      try {
        for (        ItemRecord record : fRecords) {
          if (fMonitor.isCanceled()) {
            break;
          }
          Map<IPath,IPath> toImportMap=mapping(record);
          fMonitor.subTask("String_Node_Str" + record.getName());
          if (record.isValid()) {
            log.info("String_Node_Str" + record.getFile().getAbsolutePath());
            for (            IPath resPath : toImportMap.keySet()) {
              IPath desPath=toImportMap.get(resPath);
synchronized (ProxyRepositoryFactory.getInstance().getRepositoryFactoryFromProvider().getResourceManager().resourceSet) {
                write(resPath,desPath);
              }
            }
          }
 else {
            for (            String error : record.getErrors()) {
              log.error(error);
            }
          }
          fMonitor.worked(1);
        }
        finish(fRecords,fMonitor);
      }
 catch (      Exception e) {
        log.error(e,e);
      }
    }
  }
;
  workUnit.setAvoidUnloadResources(Boolean.TRUE);
  ProxyRepositoryFactory.getInstance().executeRepositoryWorkUnit(workUnit);
}

Fixed version (ground truth):
public void write(ItemRecord[] records,IProgressMonitor monitor){
  if (monitor == null) {
    monitor=new NullProgressMonitor();
  }
  final ItemRecord[] fRecords=records;
  final IProgressMonitor fMonitor=monitor;
  RepositoryWorkUnit<Object> workUnit=new RepositoryWorkUnit<Object>("String_Node_Str"){
    @Override protected void run(){
      try {
        for (        ItemRecord record : fRecords) {
          if (fMonitor.isCanceled()) {
            break;
          }
          Map<IPath,IPath> toImportMap=mapping(record);
          fMonitor.subTask("String_Node_Str" + record.getName());
          if (record.isValid()) {
            log.info("String_Node_Str" + record.getFile().getAbsolutePath());
            IRepositoryNode conflictNode=record.getConflictNode();
            if (conflictNode != null) {
              IRepositoryViewObject object=conflictNode.getObject();
              ProxyRepositoryFactory.getInstance().deleteObjectPhysical(object);
            }
            for (            IPath resPath : toImportMap.keySet()) {
              IPath desPath=toImportMap.get(resPath);
              ResourceSet resourceSet=ProxyRepositoryFactory.getInstance().getRepositoryFactoryFromProvider().getResourceManager().resourceSet;
synchronized (resourceSet) {
                write(resPath,desPath);
              }
            }
          }
 else {
            for (            String error : record.getErrors()) {
              log.error(error);
            }
          }
          fMonitor.worked(1);
        }
        finish(fRecords,fMonitor);
      }
 catch (      Exception e) {
        log.error(e,e);
      }
    }
  }
;
  workUnit.setAvoidUnloadResources(Boolean.TRUE);
  ProxyRepositoryFactory.getInstance().executeRepositoryWorkUnit(workUnit);
}