Program: 160564
Project: 160564
Buggy source:
@Override public IfcModelInterface execute() throws UserException, BimserverLockConflictException, BimserverDatabaseException, ServerException {
  Revision revision=getRevisionByRoid(roid);
  SerializerPluginConfiguration serializerPluginConfiguration=getDatabaseSession().get(StorePackage.eINSTANCE.getSerializerPluginConfiguration(),serializerOid,Query.getDefault());
  getAuthorization().canDownload(roid);
  if (revision == null) {
    throw new UserException("String_Node_Str" + roid + "String_Node_Str");
  }
  Project project=revision.getProject();
  User user=getUserByUoid(getAuthorization().getUoid());
  try {
    getAuthorization().canDownload(roid);
  }
 catch (  UserException e) {
    if (!getAuthorization().hasRightsOnProjectOrSuperProjectsOrSubProjects(user,project)) {
      throw new UserException("String_Node_Str");
    }
  }
  IfcModelSet ifcModelSet=new IfcModelSet();
  long incrSize=0;
  EList<ConcreteRevision> concreteRevisions=revision.getConcreteRevisions();
  if (concreteRevisions.size() == 0) {
    throw new ServerException("String_Node_Str");
  }
  for (  ConcreteRevision subRevision : concreteRevisions) {
    incrSize+=subRevision.getSize();
  }
  final long totalSize=incrSize;
  final AtomicLong total=new AtomicLong();
  IfcHeader ifcHeader=null;
  for (  ConcreteRevision subRevision : concreteRevisions) {
    if (subRevision.getUser().getOid() != ignoreUoid) {
      IfcModel subModel=new IfcModel();
      ifcHeader=subRevision.getIfcHeader();
      int highestStopId=findHighestStopRid(project,subRevision);
      Query query=new Query(subRevision.getProject().getId(),subRevision.getId(),objectIDM,Deep.YES,highestStopId);
      subModel.addChangeListener(new IfcModelChangeListener(){
        @Override public void objectAdded(){
          total.incrementAndGet();
          if (totalSize == 0) {
            setProgress("String_Node_Str",0);
          }
 else {
            setProgress("String_Node_Str",Math.round(100L * total.get() / totalSize));
          }
        }
      }
);
      getDatabaseSession().getMap(subModel,query);
      if (serializerPluginConfiguration != null) {
        try {
          checkGeometry(serializerPluginConfiguration,bimServer.getPluginManager(),subModel,project,subRevision,revision);
        }
 catch (        GeometryGeneratingException e) {
          throw new UserException(e);
        }
      }
      subModel.getModelMetaData().setDate(subRevision.getDate());
      ifcModelSet.add(subModel);
    }
  }
  IfcModelInterface ifcModel=new IfcModel();
  if (ifcModelSet.size() > 1) {
    try {
      ifcModel=bimServer.getMergerFactory().createMerger(getDatabaseSession(),getAuthorization().getUoid()).merge(revision.getProject(),ifcModelSet,new ModelHelper(ifcModel));
    }
 catch (    MergeException e) {
      throw new UserException(e);
    }
  }
 else {
    ifcModel=ifcModelSet.iterator().next();
  }
  if (ifcHeader != null) {
    ifcModel.getModelMetaData().setIfcHeader(bimServer.getSConverter().convertToSObject(ifcHeader));
  }
  ifcModel.getModelMetaData().setName(project.getName() + "String_Node_Str" + revision.getId());
  ifcModel.getModelMetaData().setRevisionId(project.getRevisions().indexOf(revision) + 1);
  if (user != null) {
    ifcModel.getModelMetaData().setAuthorizedUser(user.getName());
  }
  ifcModel.getModelMetaData().setDate(revision.getDate());
  if (revision.getProject().getGeoTag() != null) {
  }
  return ifcModel;
}

Fixed version (ground truth):
@Override public IfcModelInterface execute() throws UserException, BimserverLockConflictException, BimserverDatabaseException, ServerException {
  Revision revision=getRevisionByRoid(roid);
  SerializerPluginConfiguration serializerPluginConfiguration=getDatabaseSession().get(StorePackage.eINSTANCE.getSerializerPluginConfiguration(),serializerOid,Query.getDefault());
  getAuthorization().canDownload(roid);
  if (revision == null) {
    throw new UserException("String_Node_Str" + roid + "String_Node_Str");
  }
  Project project=revision.getProject();
  User user=getUserByUoid(getAuthorization().getUoid());
  try {
    getAuthorization().canDownload(roid);
  }
 catch (  UserException e) {
    if (!getAuthorization().hasRightsOnProjectOrSuperProjectsOrSubProjects(user,project)) {
      throw new UserException("String_Node_Str");
    }
  }
  IfcModelSet ifcModelSet=new IfcModelSet();
  long incrSize=0;
  EList<ConcreteRevision> concreteRevisions=revision.getConcreteRevisions();
  if (concreteRevisions.size() == 0) {
    throw new ServerException("String_Node_Str");
  }
  for (  ConcreteRevision subRevision : concreteRevisions) {
    incrSize+=subRevision.getSize();
  }
  final long totalSize=incrSize;
  final AtomicLong total=new AtomicLong();
  IfcHeader ifcHeader=null;
  for (  ConcreteRevision subRevision : concreteRevisions) {
    if (subRevision.getUser().getOid() != ignoreUoid) {
      IfcModel subModel=new IfcModel();
      ifcHeader=subRevision.getIfcHeader();
      int highestStopId=findHighestStopRid(project,subRevision);
      Query query=new Query(subRevision.getProject().getId(),subRevision.getId(),objectIDM,Deep.YES,highestStopId);
      subModel.addChangeListener(new IfcModelChangeListener(){
        @Override public void objectAdded(){
          total.incrementAndGet();
          if (totalSize == 0) {
            setProgress("String_Node_Str",0);
          }
 else {
            setProgress("String_Node_Str",(int)Math.round(100.0 * total.get() / totalSize));
          }
        }
      }
);
      getDatabaseSession().getMap(subModel,query);
      if (serializerPluginConfiguration != null) {
        try {
          checkGeometry(serializerPluginConfiguration,bimServer.getPluginManager(),subModel,project,subRevision,revision);
        }
 catch (        GeometryGeneratingException e) {
          throw new UserException(e);
        }
      }
      subModel.getModelMetaData().setDate(subRevision.getDate());
      ifcModelSet.add(subModel);
    }
  }
  IfcModelInterface ifcModel=new IfcModel();
  if (ifcModelSet.size() > 1) {
    try {
      ifcModel=bimServer.getMergerFactory().createMerger(getDatabaseSession(),getAuthorization().getUoid()).merge(revision.getProject(),ifcModelSet,new ModelHelper(ifcModel));
    }
 catch (    MergeException e) {
      throw new UserException(e);
    }
  }
 else {
    ifcModel=ifcModelSet.iterator().next();
  }
  if (ifcHeader != null) {
    ifcModel.getModelMetaData().setIfcHeader(bimServer.getSConverter().convertToSObject(ifcHeader));
  }
  ifcModel.getModelMetaData().setName(project.getName() + "String_Node_Str" + revision.getId());
  ifcModel.getModelMetaData().setRevisionId(project.getRevisions().indexOf(revision) + 1);
  if (user != null) {
    ifcModel.getModelMetaData().setAuthorizedUser(user.getName());
  }
  ifcModel.getModelMetaData().setDate(revision.getDate());
  if (revision.getProject().getGeoTag() != null) {
  }
  return ifcModel;
}