Program: 160562
Project: 160562
Buggy source:
@Override public IfcModelInterface execute() throws UserException, BimserverLockConflictException, BimserverDatabaseException {
  User user=getUserByUoid(getAuthorization().getUoid());
  IfcModelSet ifcModelSet=new IfcModelSet();
  Project project=null;
  long incrSize=0L;
  SerializerPluginConfiguration serializerPluginConfiguration=getDatabaseSession().get(StorePackage.eINSTANCE.getSerializerPluginConfiguration(),serializerOid,Query.getDefault());
  for (  Long roid : roids) {
    Revision virtualRevision=getRevisionByRoid(roid);
    project=virtualRevision.getProject();
    if (!getAuthorization().hasRightsOnProjectOrSuperProjectsOrSubProjects(user,project)) {
      throw new UserException("String_Node_Str");
    }
    incrSize+=virtualRevision.getConcreteRevisions().size();
    final long totalSize=incrSize;
    final AtomicLong total=new AtomicLong();
    for (    ConcreteRevision concreteRevision : virtualRevision.getConcreteRevisions()) {
      IfcModel subModel=new IfcModel();
      int highestStopId=findHighestStopRid(project,concreteRevision);
      Query query=new Query(concreteRevision.getProject().getId(),concreteRevision.getId(),objectIDM,deep,highestStopId);
      subModel.addChangeListener(new IfcModelChangeListener(){
        @Override public void objectAdded(){
          total.incrementAndGet();
          progress=Math.round(100L * total.get() / totalSize);
        }
      }
);
      getDatabaseSession().getMapWithOids(subModel,oids,query);
      subModel.getModelMetaData().setDate(concreteRevision.getDate());
      try {
        checkGeometry(serializerPluginConfiguration,bimServer.getPluginManager(),subModel,project,concreteRevision,virtualRevision);
      }
 catch (      GeometryGeneratingException e) {
        throw new UserException(e);
      }
      ifcModelSet.add(subModel);
    }
  }
  IfcModelInterface ifcModel=new IfcModel();
  try {
    ifcModel=bimServer.getMergerFactory().createMerger(getDatabaseSession(),getAuthorization().getUoid()).merge(project,ifcModelSet,new ModelHelper(ifcModel));
  }
 catch (  MergeException e) {
    throw new UserException(e);
  }
  ifcModel.getModelMetaData().setName("String_Node_Str");
  ifcModel.getModelMetaData().setRevisionId(1);
  ifcModel.getModelMetaData().setAuthorizedUser(getUserByUoid(getAuthorization().getUoid()).getName());
  ifcModel.getModelMetaData().setDate(new Date());
  return ifcModel;
}

Fixed version (ground truth):
@Override public IfcModelInterface execute() throws UserException, BimserverLockConflictException, BimserverDatabaseException {
  User user=getUserByUoid(getAuthorization().getUoid());
  IfcModelSet ifcModelSet=new IfcModelSet();
  Project project=null;
  long incrSize=0L;
  SerializerPluginConfiguration serializerPluginConfiguration=getDatabaseSession().get(StorePackage.eINSTANCE.getSerializerPluginConfiguration(),serializerOid,Query.getDefault());
  for (  Long roid : roids) {
    Revision virtualRevision=getRevisionByRoid(roid);
    project=virtualRevision.getProject();
    if (!getAuthorization().hasRightsOnProjectOrSuperProjectsOrSubProjects(user,project)) {
      throw new UserException("String_Node_Str");
    }
    incrSize+=virtualRevision.getConcreteRevisions().size();
    final long totalSize=incrSize;
    final AtomicLong total=new AtomicLong();
    for (    ConcreteRevision concreteRevision : virtualRevision.getConcreteRevisions()) {
      IfcModel subModel=new IfcModel();
      int highestStopId=findHighestStopRid(project,concreteRevision);
      Query query=new Query(concreteRevision.getProject().getId(),concreteRevision.getId(),objectIDM,deep,highestStopId);
      subModel.addChangeListener(new IfcModelChangeListener(){
        @Override public void objectAdded(){
          total.incrementAndGet();
          progress=(int)Math.round(100.0 * total.get() / totalSize);
        }
      }
);
      getDatabaseSession().getMapWithOids(subModel,oids,query);
      subModel.getModelMetaData().setDate(concreteRevision.getDate());
      try {
        checkGeometry(serializerPluginConfiguration,bimServer.getPluginManager(),subModel,project,concreteRevision,virtualRevision);
      }
 catch (      GeometryGeneratingException e) {
        throw new UserException(e);
      }
      ifcModelSet.add(subModel);
    }
  }
  IfcModelInterface ifcModel=new IfcModel();
  try {
    ifcModel=bimServer.getMergerFactory().createMerger(getDatabaseSession(),getAuthorization().getUoid()).merge(project,ifcModelSet,new ModelHelper(ifcModel));
  }
 catch (  MergeException e) {
    throw new UserException(e);
  }
  ifcModel.getModelMetaData().setName("String_Node_Str");
  ifcModel.getModelMetaData().setRevisionId(1);
  ifcModel.getModelMetaData().setAuthorizedUser(getUserByUoid(getAuthorization().getUoid()).getName());
  ifcModel.getModelMetaData().setDate(new Date());
  return ifcModel;
}