Program: 160560
Project: 160560
Buggy source:
@Override public IfcModelInterface execute() throws UserException, BimserverLockConflictException, BimserverDatabaseException {
  User user=getUserByUoid(getAuthorization().getUoid());
  Set<String> foundNames=new HashSet<String>();
  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");
    }
    Map<ConcreteRevision,Set<Long>> map=new HashMap<ConcreteRevision,Set<Long>>();
    for (    String name : names) {
      if (!foundNames.contains(name)) {
        for (        ConcreteRevision concreteRevision : virtualRevision.getConcreteRevisions()) {
          for (          ObjectIdentifier objectIdentifier : getDatabaseSession().getOidsOfName(name,concreteRevision.getProject().getId(),concreteRevision.getId())) {
            foundNames.add(name);
            if (!map.containsKey(concreteRevision)) {
              map.put(concreteRevision,new HashSet<Long>());
              incrSize+=concreteRevision.getSize();
            }
            map.get(concreteRevision).add(objectIdentifier.getOid());
          }
        }
      }
    }
    final long totalSize=incrSize;
    final AtomicLong total=new AtomicLong();
    for (    ConcreteRevision concreteRevision : map.keySet()) {
      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);
        }
      }
);
      Set<Long> oids=map.get(concreteRevision);
      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));
    ifcModel.getModelMetaData().setName("String_Node_Str");
    for (    String name : names) {
      if (!foundNames.contains(name)) {
        throw new UserException("String_Node_Str" + name + "String_Node_Str");
      }
    }
    ifcModel.getModelMetaData().setRevisionId(1);
    ifcModel.getModelMetaData().setAuthorizedUser(getUserByUoid(getAuthorization().getUoid()).getName());
    ifcModel.getModelMetaData().setDate(new Date());
    return ifcModel;
  }
 catch (  MergeException e) {
    throw new UserException(e);
  }
}

Fixed version (ground truth):
@Override public IfcModelInterface execute() throws UserException, BimserverLockConflictException, BimserverDatabaseException {
  User user=getUserByUoid(getAuthorization().getUoid());
  Set<String> foundNames=new HashSet<String>();
  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");
    }
    Map<ConcreteRevision,Set<Long>> map=new HashMap<ConcreteRevision,Set<Long>>();
    for (    String name : names) {
      if (!foundNames.contains(name)) {
        for (        ConcreteRevision concreteRevision : virtualRevision.getConcreteRevisions()) {
          for (          ObjectIdentifier objectIdentifier : getDatabaseSession().getOidsOfName(name,concreteRevision.getProject().getId(),concreteRevision.getId())) {
            foundNames.add(name);
            if (!map.containsKey(concreteRevision)) {
              map.put(concreteRevision,new HashSet<Long>());
              incrSize+=concreteRevision.getSize();
            }
            map.get(concreteRevision).add(objectIdentifier.getOid());
          }
        }
      }
    }
    final long totalSize=incrSize;
    final AtomicLong total=new AtomicLong();
    for (    ConcreteRevision concreteRevision : map.keySet()) {
      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);
        }
      }
);
      Set<Long> oids=map.get(concreteRevision);
      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));
    ifcModel.getModelMetaData().setName("String_Node_Str");
    for (    String name : names) {
      if (!foundNames.contains(name)) {
        throw new UserException("String_Node_Str" + name + "String_Node_Str");
      }
    }
    ifcModel.getModelMetaData().setRevisionId(1);
    ifcModel.getModelMetaData().setAuthorizedUser(getUserByUoid(getAuthorization().getUoid()).getName());
    ifcModel.getModelMetaData().setDate(new Date());
    return ifcModel;
  }
 catch (  MergeException e) {
    throw new UserException(e);
  }
}