Program: 160396
Project: 160396
Buggy source:
@Override public DataObject execute() throws UserException, BimserverLockConflictException, BimserverDatabaseException {
  Revision virtualRevision=getRevisionByRoid(roid);
  EObject eObject=null;
  IfcModelSet ifcModelSet=new IfcModelSet();
  PackageMetaData lastPackageMetaData=null;
  Map<Integer,Long> pidRoidMap=new HashMap<>();
  pidRoidMap.put(virtualRevision.getProject().getId(),virtualRevision.getOid());
  for (  ConcreteRevision concreteRevision : virtualRevision.getConcreteRevisions()) {
    PackageMetaData packageMetaData=getBimServer().getMetaDataManager().getPackageMetaData(concreteRevision.getProject().getSchema());
    lastPackageMetaData=packageMetaData;
    IfcModel subModel=new BasicIfcModel(packageMetaData,pidRoidMap);
    int highestStopId=findHighestStopRid(concreteRevision.getProject(),concreteRevision);
    OldQuery query=new OldQuery(packageMetaData,concreteRevision.getProject().getId(),concreteRevision.getId(),virtualRevision.getOid(),null,Deep.NO,highestStopId);
    eObject=getDatabaseSession().get(null,oid,subModel,query);
    subModel.getModelMetaData().setDate(concreteRevision.getDate());
    ifcModelSet.add(subModel);
    if (eObject != null) {
      break;
    }
  }
  IfcModelInterface ifcModel=new BasicIfcModel(lastPackageMetaData,pidRoidMap);
  try {
    ifcModel=getBimServer().getMergerFactory().createMerger(getDatabaseSession(),getAuthorization().getUoid()).merge(virtualRevision.getProject(),ifcModelSet,new ModelHelper(getBimServer().getMetaDataManager(),ifcModel));
  }
 catch (  MergeException e) {
    throw new UserException(e);
  }
  if (eObject == null) {
    throw new UserException("String_Node_Str");
  }
  DataObject dataObject=null;
  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.setName("String_Node_Str");
    dataObject.setGuid("String_Node_Str");
  }
  fillDataObject(ifcModel.getObjects(),eObject,dataObject);
  return dataObject;
}

Fixed version (ground truth):
@Override public DataObject execute() throws UserException, BimserverLockConflictException, BimserverDatabaseException {
  Revision virtualRevision=getRevisionByRoid(roid);
  EObject eObject=null;
  IfcModelSet ifcModelSet=new IfcModelSet();
  PackageMetaData lastPackageMetaData=null;
  Map<Integer,Long> pidRoidMap=new HashMap<>();
  pidRoidMap.put(virtualRevision.getProject().getId(),virtualRevision.getOid());
  for (  ConcreteRevision concreteRevision : virtualRevision.getConcreteRevisions()) {
    PackageMetaData packageMetaData=getBimServer().getMetaDataManager().getPackageMetaData(concreteRevision.getProject().getSchema());
    lastPackageMetaData=packageMetaData;
    IfcModel subModel=new BasicIfcModel(packageMetaData,pidRoidMap);
    int highestStopId=findHighestStopRid(concreteRevision.getProject(),concreteRevision);
    OldQuery query=new OldQuery(packageMetaData,concreteRevision.getProject().getId(),concreteRevision.getId(),virtualRevision.getOid(),null,Deep.NO,highestStopId);
    eObject=getDatabaseSession().get(null,oid,subModel,query);
    subModel.getModelMetaData().setDate(concreteRevision.getDate());
    ifcModelSet.add(subModel);
    if (eObject != null) {
      break;
    }
  }
  IfcModelInterface ifcModel=new BasicIfcModel(lastPackageMetaData,pidRoidMap);
  if (ifcModelSet.size() > 1) {
    try {
      ifcModel=getBimServer().getMergerFactory().createMerger(getDatabaseSession(),getAuthorization().getUoid()).merge(virtualRevision.getProject(),ifcModelSet,new ModelHelper(getBimServer().getMetaDataManager(),ifcModel));
    }
 catch (    MergeException e) {
      throw new UserException(e);
    }
  }
 else {
    ifcModel=ifcModelSet.iterator().next();
  }
  if (eObject == null) {
    throw new UserException("String_Node_Str");
  }
  DataObject dataObject=null;
  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.setName("String_Node_Str");
    dataObject.setGuid("String_Node_Str");
  }
  fillDataObject(ifcModel.getObjects(),eObject,dataObject);
  return dataObject;
}