Program: 160385
Project: 160385
Buggy source:
public GenerateGeometryResult generateGeometry(long uoid,final DatabaseSession databaseSession,QueryContext queryContext) throws BimserverDatabaseException, GeometryGeneratingException {
  GenerateGeometryResult generateGeometryResult=new GenerateGeometryResult();
  packageMetaData=queryContext.getPackageMetaData();
  productClass=packageMetaData.getEClass("String_Node_Str");
  geometryFeature=productClass.getEStructuralFeature("String_Node_Str");
  representationFeature=productClass.getEStructuralFeature("String_Node_Str");
  long start=System.nanoTime();
  String pluginName="String_Node_Str";
  if (queryContext.getPackageMetaData().getSchema() == Schema.IFC4) {
    pluginName="String_Node_Str";
  }
 else   if (queryContext.getPackageMetaData().getSchema() == Schema.IFC2X3TC1) {
    pluginName="String_Node_Str";
  }
  try {
    final StreamingSerializerPlugin ifcSerializerPlugin=(StreamingSerializerPlugin)bimServer.getPluginManager().getPlugin(pluginName,true);
    if (ifcSerializerPlugin == null) {
      throw new UserException("String_Node_Str");
    }
    User user=(User)databaseSession.get(uoid,org.bimserver.database.OldQuery.getDefault());
    UserSettings userSettings=user.getUserSettings();
    RenderEnginePluginConfiguration defaultRenderEngine=userSettings.getDefaultRenderEngine();
    if (defaultRenderEngine == null) {
      throw new UserException("String_Node_Str");
    }
    int maxSimultanousThreads=Math.min(bimServer.getServerSettingsCache().getServerSettings().getRenderEngineProcesses(),Runtime.getRuntime().availableProcessors());
    if (maxSimultanousThreads < 1) {
      maxSimultanousThreads=1;
    }
    final RenderEngineSettings settings=new RenderEngineSettings();
    settings.setPrecision(Precision.SINGLE);
    settings.setIndexFormat(IndexFormat.AUTO_DETECT);
    settings.setGenerateNormals(true);
    settings.setGenerateTriangles(true);
    settings.setGenerateWireFrame(false);
    final RenderEngineFilter renderEngineFilter=new RenderEngineFilter();
    RenderEnginePool renderEnginePool=bimServer.getRenderEnginePools().getRenderEnginePool(packageMetaData.getSchema(),defaultRenderEngine.getPluginDescriptor().getPluginClassName());
    ThreadPoolExecutor executor=new ThreadPoolExecutor(maxSimultanousThreads,maxSimultanousThreads,24,TimeUnit.HOURS,new ArrayBlockingQueue<Runnable>(10000000));
    for (    EClass eClass : queryContext.getOidCounters().keySet()) {
      if (packageMetaData.getEClass("String_Node_Str").isSuperTypeOf(eClass)) {
        Query query2=new Query("String_Node_Str",packageMetaData);
        QueryPart queryPart2=query2.createQueryPart();
        queryPart2.addType(eClass,false);
        QueryObjectProvider queryObjectProvider2=new QueryObjectProvider(databaseSession,bimServer,query2,Collections.singleton(queryContext.getRoid()),packageMetaData);
        HashMapVirtualObject next=queryObjectProvider2.next();
        while (next != null) {
          if (next.eClass() == eClass) {
            Query query=new Query("String_Node_Str",packageMetaData);
            QueryPart queryPart=query.createQueryPart();
            queryPart.addType(eClass,false);
            int x=0;
            queryPart.addOid(next.getOid());
            while (next != null && x < 99) {
              next=queryObjectProvider2.next();
              if (next != null) {
                if (next.eClass() == eClass) {
                  x++;
                  queryPart.addOid(next.getOid());
                }
              }
            }
            JsonQueryObjectModelConverter jsonQueryObjectModelConverter=new JsonQueryObjectModelConverter(packageMetaData);
            queryPart.addInclude(jsonQueryObjectModelConverter.getDefineFromFile("String_Node_Str"));
            queryPart.addInclude(jsonQueryObjectModelConverter.getDefineFromFile("String_Node_Str"));
            Include representation=jsonQueryObjectModelConverter.getDefineFromFile("String_Node_Str");
            queryPart.addInclude(representation);
            Include objectPlacement=jsonQueryObjectModelConverter.getDefineFromFile("String_Node_Str");
            queryPart.addInclude(objectPlacement);
            if (packageMetaData.getEClass("String_Node_Str").isSuperTypeOf(eClass)) {
              Include ifcWall=queryPart.createInclude();
              ifcWall.addType(packageMetaData.getEClass(eClass.getName()),false);
              ifcWall.addField("String_Node_Str");
              Include hasOpenings=ifcWall.createInclude();
              hasOpenings.addType(packageMetaData.getEClass("String_Node_Str"),false);
              hasOpenings.addField("String_Node_Str");
              hasOpenings.addInclude(representation);
              hasOpenings.addInclude(objectPlacement);
            }
            QueryObjectProvider queryObjectProvider=new QueryObjectProvider(databaseSession,bimServer,query,Collections.singleton(queryContext.getRoid()),packageMetaData);
            Runner runner=new Runner(eClass,renderEnginePool,databaseSession,settings,queryObjectProvider,ifcSerializerPlugin,renderEngineFilter,generateGeometryResult,queryContext);
            executor.submit(runner);
            jobsTotal.incrementAndGet();
          }
          next=queryObjectProvider2.next();
        }
      }
    }
    allJobsPushed=true;
    executor.shutdown();
    executor.awaitTermination(24,TimeUnit.HOURS);
    long end=System.nanoTime();
    LOGGER.info("String_Node_Str" + ((end - start) / 1000000) + "String_Node_Str"+ "String_Node_Str"+ Formatters.bytesToString(bytesSaved.get())+ "String_Node_Str"+ Formatters.bytesToString(totalBytes.get())+ "String_Node_Str"+ Formatters.bytesToString(totalBytes.get() - bytesSaved.get()));
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str",e);
    throw new GeometryGeneratingException(e);
  }
  return generateGeometryResult;
}

Fixed version (ground truth):
public GenerateGeometryResult generateGeometry(long uoid,final DatabaseSession databaseSession,QueryContext queryContext) throws BimserverDatabaseException, GeometryGeneratingException {
  GenerateGeometryResult generateGeometryResult=new GenerateGeometryResult();
  packageMetaData=queryContext.getPackageMetaData();
  productClass=packageMetaData.getEClass("String_Node_Str");
  geometryFeature=productClass.getEStructuralFeature("String_Node_Str");
  representationFeature=productClass.getEStructuralFeature("String_Node_Str");
  long start=System.nanoTime();
  String pluginName="String_Node_Str";
  if (queryContext.getPackageMetaData().getSchema() == Schema.IFC4) {
    pluginName="String_Node_Str";
  }
 else   if (queryContext.getPackageMetaData().getSchema() == Schema.IFC2X3TC1) {
    pluginName="String_Node_Str";
  }
  try {
    final StreamingSerializerPlugin ifcSerializerPlugin=(StreamingSerializerPlugin)bimServer.getPluginManager().getPlugin(pluginName,true);
    if (ifcSerializerPlugin == null) {
      throw new UserException("String_Node_Str");
    }
    User user=(User)databaseSession.get(uoid,org.bimserver.database.OldQuery.getDefault());
    UserSettings userSettings=user.getUserSettings();
    RenderEnginePluginConfiguration defaultRenderEngine=userSettings.getDefaultRenderEngine();
    if (defaultRenderEngine == null) {
      throw new UserException("String_Node_Str");
    }
    int maxSimultanousThreads=Math.min(bimServer.getServerSettingsCache().getServerSettings().getRenderEngineProcesses(),Runtime.getRuntime().availableProcessors());
    if (maxSimultanousThreads < 1) {
      maxSimultanousThreads=1;
    }
    final RenderEngineSettings settings=new RenderEngineSettings();
    settings.setPrecision(Precision.SINGLE);
    settings.setIndexFormat(IndexFormat.AUTO_DETECT);
    settings.setGenerateNormals(true);
    settings.setGenerateTriangles(true);
    settings.setGenerateWireFrame(false);
    final RenderEngineFilter renderEngineFilter=new RenderEngineFilter();
    RenderEnginePool renderEnginePool=bimServer.getRenderEnginePools().getRenderEnginePool(packageMetaData.getSchema(),defaultRenderEngine.getPluginDescriptor().getPluginClassName());
    ThreadPoolExecutor executor=new ThreadPoolExecutor(maxSimultanousThreads,maxSimultanousThreads,24,TimeUnit.HOURS,new ArrayBlockingQueue<Runnable>(10000000));
    for (    EClass eClass : queryContext.getOidCounters().keySet()) {
      if (packageMetaData.getEClass("String_Node_Str").isSuperTypeOf(eClass)) {
        Query query2=new Query("String_Node_Str",packageMetaData);
        QueryPart queryPart2=query2.createQueryPart();
        queryPart2.addType(eClass,false);
        QueryObjectProvider queryObjectProvider2=new QueryObjectProvider(databaseSession,bimServer,query2,Collections.singleton(queryContext.getRoid()),packageMetaData);
        HashMapVirtualObject next=queryObjectProvider2.next();
        while (next != null) {
          if (next.eClass() == eClass) {
            Query query=new Query("String_Node_Str",packageMetaData);
            QueryPart queryPart=query.createQueryPart();
            queryPart.addType(eClass,false);
            int x=0;
            queryPart.addOid(next.getOid());
            while (next != null && x < 99) {
              next=queryObjectProvider2.next();
              if (next != null) {
                if (next.eClass() == eClass) {
                  x++;
                  queryPart.addOid(next.getOid());
                }
              }
            }
            JsonQueryObjectModelConverter jsonQueryObjectModelConverter=new JsonQueryObjectModelConverter(packageMetaData);
            queryPart.addInclude(jsonQueryObjectModelConverter.getDefineFromFile("String_Node_Str"));
            queryPart.addInclude(jsonQueryObjectModelConverter.getDefineFromFile("String_Node_Str"));
            Include representation=jsonQueryObjectModelConverter.getDefineFromFile("String_Node_Str");
            queryPart.addInclude(representation);
            Include objectPlacement=jsonQueryObjectModelConverter.getDefineFromFile("String_Node_Str");
            queryPart.addInclude(objectPlacement);
            if (packageMetaData.getEClass("String_Node_Str").isSuperTypeOf(eClass)) {
              Include ifcWall=queryPart.createInclude();
              ifcWall.addType(packageMetaData.getEClass(eClass.getName()),false);
              ifcWall.addField("String_Node_Str");
              Include hasOpenings=ifcWall.createInclude();
              hasOpenings.addType(packageMetaData.getEClass("String_Node_Str"),false);
              hasOpenings.addField("String_Node_Str");
              hasOpenings.addInclude(representation);
              hasOpenings.addInclude(objectPlacement);
            }
            QueryObjectProvider queryObjectProvider=new QueryObjectProvider(databaseSession,bimServer,query,Collections.singleton(queryContext.getRoid()),packageMetaData);
            Runner runner=new Runner(eClass,renderEnginePool,databaseSession,settings,queryObjectProvider,ifcSerializerPlugin,renderEngineFilter,generateGeometryResult,queryContext,query);
            executor.submit(runner);
            jobsTotal.incrementAndGet();
          }
          next=queryObjectProvider2.next();
        }
      }
    }
    allJobsPushed=true;
    executor.shutdown();
    executor.awaitTermination(24,TimeUnit.HOURS);
    long end=System.nanoTime();
    LOGGER.info("String_Node_Str" + ((end - start) / 1000000) + "String_Node_Str"+ "String_Node_Str"+ Formatters.bytesToString(bytesSaved.get())+ "String_Node_Str"+ Formatters.bytesToString(totalBytes.get())+ "String_Node_Str"+ Formatters.bytesToString(totalBytes.get() - bytesSaved.get()));
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str",e);
    throw new GeometryGeneratingException(e);
  }
  return generateGeometryResult;
}