Program: 160397
Project: 160397
Buggy source:
@Override public List<DataObject> execute() throws UserException, BimserverLockConflictException, BimserverDatabaseException {
  EClass eClass=getDatabaseSession().getEClassForName(packageName,className);
  Revision virtualRevision=getRevisionByRoid(roid);
  if (virtualRevision == null) {
    throw new UserException("String_Node_Str" + roid + "String_Node_Str");
  }
  Map<Integer,Long> pidRoidMap=new HashMap<>();
  IfcModelSet ifcModelSet=new IfcModelSet();
  pidRoidMap.put(virtualRevision.getProject().getId(),virtualRevision.getOid());
  PackageMetaData lastPackageMetaData=null;
  Project project=virtualRevision.getProject();
  for (  ConcreteRevision concreteRevision : virtualRevision.getConcreteRevisions()) {
    PackageMetaData packageMetaData=getBimServer().getMetaDataManager().getPackageMetaData(concreteRevision.getProject().getSchema());
    int highestStopId=findHighestStopRid(project,concreteRevision);
    OldQuery query=new OldQuery(packageMetaData,concreteRevision.getProject().getId(),concreteRevision.getId(),-1,null,Deep.NO,highestStopId);
    lastPackageMetaData=packageMetaData;
    IfcModelInterface subModel=getDatabaseSession().getAllOfType(packageMetaData.getEPackage().getName(),className,query);
    subModel.getModelMetaData().setDate(concreteRevision.getDate());
    ifcModelSet.add(subModel);
  }
  IfcModelInterface ifcModel=new ServerIfcModel(lastPackageMetaData,pidRoidMap,getDatabaseSession());
  try {
    ifcModel=getBimServer().getMergerFactory().createMerger(getDatabaseSession(),getAuthorization().getUoid()).merge(project,ifcModelSet,new ModelHelper(getBimServer().getMetaDataManager(),ifcModel));
  }
 catch (  MergeException e) {
    throw new UserException(e);
  }
  List<DataObject> dataObjects=new ArrayList<DataObject>();
  for (  Long oid : ifcModel.keySet()) {
    EObject eObject=ifcModel.get(oid);
    if (eClass.isInstance(eObject)) {
      DataObject dataObject=StoreFactory.eINSTANCE.createDataObject();
      if (eObject instanceof IfcRoot) {
        IfcRoot ifcRoot=(IfcRoot)eObject;
        String guid=ifcRoot.getGlobalId() != null ? ifcRoot.getGlobalId() : "String_Node_Str";
        String name=ifcRoot.getName() != null ? ifcRoot.getName() : "String_Node_Str";
        dataObject=StoreFactory.eINSTANCE.createDataObject();
        dataObject.setType(eObject.eClass().getName());
        ((IdEObjectImpl)dataObject).setOid(oid);
        dataObject.setGuid(guid);
        dataObject.setName(name);
      }
 else {
        dataObject=StoreFactory.eINSTANCE.createDataObject();
        dataObject.setType(eObject.eClass().getName());
        ((IdEObjectImpl)dataObject).setOid(oid);
        dataObject.setGuid("String_Node_Str");
        dataObject.setName("String_Node_Str");
      }
      if (!flat) {
        GetDataObjectByOidDatabaseAction.fillDataObject(ifcModel.getObjects(),eObject,dataObject);
      }
      dataObjects.add(dataObject);
    }
  }
  return dataObjects;
}

Fixed version (ground truth):
@Override public List<DataObject> execute() throws UserException, BimserverLockConflictException, BimserverDatabaseException {
  EClass eClass=getDatabaseSession().getEClassForName(packageName,className);
  Revision virtualRevision=getRevisionByRoid(roid);
  if (virtualRevision == null) {
    throw new UserException("String_Node_Str" + roid + "String_Node_Str");
  }
  Map<Integer,Long> pidRoidMap=new HashMap<>();
  IfcModelSet ifcModelSet=new IfcModelSet();
  pidRoidMap.put(virtualRevision.getProject().getId(),virtualRevision.getOid());
  PackageMetaData lastPackageMetaData=null;
  Project project=virtualRevision.getProject();
  for (  ConcreteRevision concreteRevision : virtualRevision.getConcreteRevisions()) {
    PackageMetaData packageMetaData=getBimServer().getMetaDataManager().getPackageMetaData(concreteRevision.getProject().getSchema());
    int highestStopId=findHighestStopRid(project,concreteRevision);
    OldQuery query=new OldQuery(packageMetaData,concreteRevision.getProject().getId(),concreteRevision.getId(),-1,null,Deep.NO,highestStopId);
    lastPackageMetaData=packageMetaData;
    IfcModelInterface subModel=getDatabaseSession().getAllOfType(packageMetaData.getEPackage().getName(),className,query);
    subModel.getModelMetaData().setDate(concreteRevision.getDate());
    ifcModelSet.add(subModel);
  }
  IfcModelInterface ifcModel=new ServerIfcModel(lastPackageMetaData,pidRoidMap,getDatabaseSession());
  if (ifcModelSet.size() > 1) {
    try {
      ifcModel=getBimServer().getMergerFactory().createMerger(getDatabaseSession(),getAuthorization().getUoid()).merge(project,ifcModelSet,new ModelHelper(getBimServer().getMetaDataManager(),ifcModel));
    }
 catch (    MergeException e) {
      throw new UserException(e);
    }
  }
 else {
    ifcModel=ifcModelSet.iterator().next();
  }
  List<DataObject> dataObjects=new ArrayList<DataObject>();
  for (  Long oid : ifcModel.keySet()) {
    EObject eObject=ifcModel.get(oid);
    if (eClass.isInstance(eObject)) {
      DataObject dataObject=StoreFactory.eINSTANCE.createDataObject();
      if (eObject instanceof IfcRoot) {
        IfcRoot ifcRoot=(IfcRoot)eObject;
        String guid=ifcRoot.getGlobalId() != null ? ifcRoot.getGlobalId() : "String_Node_Str";
        String name=ifcRoot.getName() != null ? ifcRoot.getName() : "String_Node_Str";
        dataObject=StoreFactory.eINSTANCE.createDataObject();
        dataObject.setType(eObject.eClass().getName());
        ((IdEObjectImpl)dataObject).setOid(oid);
        dataObject.setGuid(guid);
        dataObject.setName(name);
      }
 else {
        dataObject=StoreFactory.eINSTANCE.createDataObject();
        dataObject.setType(eObject.eClass().getName());
        ((IdEObjectImpl)dataObject).setOid(oid);
        dataObject.setGuid("String_Node_Str");
        dataObject.setName("String_Node_Str");
      }
      if (!flat) {
        GetDataObjectByOidDatabaseAction.fillDataObject(ifcModel.getObjects(),eObject,dataObject);
      }
      dataObjects.add(dataObject);
    }
  }
  return dataObjects;
}