Program: 160437
Project: 160437
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");
    }
    final RenderEnginePlugin renderEnginePlugin=bimServer.getPluginManager().getRenderEngine(defaultRenderEngine.getPluginDescriptor().getPluginClassName(),true);
    if (renderEnginePlugin == null) {
      throw new UserException("String_Node_Str" + defaultRenderEngine.getPluginDescriptor().getPluginClassName());
    }
    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();
    ThreadPoolExecutor executor=new ThreadPoolExecutor(maxSimultanousThreads,maxSimultanousThreads,24,TimeUnit.HOURS,new ArrayBlockingQueue<Runnable>(queryContext.getOidCounters().size()));
    for (    EClass eClass : queryContext.getOidCounters().keySet()) {
      if (packageMetaData.getEClass("String_Node_Str").isSuperTypeOf(eClass)) {
        Query query=new Query("String_Node_Str",packageMetaData);
        QueryPart queryPart=query.createQueryPart();
        queryPart.addType(eClass,false);
        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);
        HashMapVirtualObject next=queryObjectProvider.next();
        query=new Query("String_Node_Str",packageMetaData);
        queryPart=query.createQueryPart();
        while (next != null) {
          queryPart.addOid(next.getOid());
          next=queryObjectProvider.next();
        }
        queryObjectProvider=new QueryObjectProvider(databaseSession,bimServer,query,Collections.singleton(queryContext.getRoid()),packageMetaData);
        Runner runner=new Runner(eClass,renderEnginePlugin,databaseSession,settings,queryObjectProvider,ifcSerializerPlugin,null,renderEngineFilter,generateGeometryResult,queryContext);
        executor.submit(runner);
        jobsTotal.incrementAndGet();
      }
    }
    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");
    }
    final RenderEnginePlugin renderEnginePlugin=bimServer.getPluginManager().getRenderEngine(defaultRenderEngine.getPluginDescriptor().getPluginClassName(),true);
    if (renderEnginePlugin == null) {
      throw new UserException("String_Node_Str" + defaultRenderEngine.getPluginDescriptor().getPluginClassName());
    }
    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();
    ThreadPoolExecutor executor=new ThreadPoolExecutor(maxSimultanousThreads,maxSimultanousThreads,24,TimeUnit.HOURS,new ArrayBlockingQueue<Runnable>(queryContext.getOidCounters().size()));
    for (    EClass eClass : queryContext.getOidCounters().keySet()) {
      if (packageMetaData.getEClass("String_Node_Str").isSuperTypeOf(eClass)) {
        Query query=new Query("String_Node_Str",packageMetaData);
        QueryPart queryPart=query.createQueryPart();
        queryPart.addType(eClass,false);
        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);
        HashMapVirtualObject next=queryObjectProvider.next();
        query=new Query("String_Node_Str",packageMetaData);
        queryPart=query.createQueryPart();
        while (next != null) {
          queryPart.addOid(next.getOid());
          next=queryObjectProvider.next();
        }
        queryObjectProvider=new QueryObjectProvider(databaseSession,bimServer,query,Collections.singleton(queryContext.getRoid()),packageMetaData);
        Runner runner=new Runner(eClass,renderEnginePlugin,databaseSession,settings,queryObjectProvider,ifcSerializerPlugin,renderEngineFilter,generateGeometryResult,queryContext);
        executor.submit(runner);
        jobsTotal.incrementAndGet();
      }
    }
    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;
}