Program: 160384
Project: 160384
Buggy source:
@Override public void run(){
  try {
    HashMapVirtualObject next;
    next=objectProvider.next();
    Query query=new Query("String_Node_Str",packageMetaData);
    QueryPart queryPart=query.createQueryPart();
    while (next != null) {
      queryPart.addOid(next.getOid());
      next=objectProvider.next();
    }
    objectProvider=new QueryObjectProvider(databaseSession,bimServer,query,Collections.singleton(queryContext.getRoid()),packageMetaData);
  }
 catch (  BimserverDatabaseException|IOException|QueryException e1) {
    e1.printStackTrace();
  }
  StreamingSerializer ifcSerializer=ifcSerializerPlugin.createSerializer(new PluginConfiguration());
  RenderEngine renderEngine=null;
  try {
    renderEngine=renderEnginePool.borrowObject();
    final Set<HashMapVirtualObject> oids=new HashSet<>();
    ObjectProviderProxy proxy=new ObjectProviderProxy(objectProvider,new ObjectListener(){
      @Override public void newObject(      HashMapVirtualObject next){
        if (eClass.isSuperTypeOf(next.eClass())) {
          oids.add(next);
        }
      }
    }
);
    ifcSerializer.init(proxy,null,null,bimServer.getPluginManager(),packageMetaData);
    boolean debug=true;
    InputStream in=null;
    if (debug) {
      String basefilenamename="String_Node_Str";
      if (eClass != null) {
        basefilenamename=eClass.getName();
      }
      File file=new File(basefilenamename + "String_Node_Str");
      int i=0;
      while (file.exists()) {
        file=new File(basefilenamename + "String_Node_Str" + i+ "String_Node_Str");
        i++;
      }
      FileOutputStream fos=new FileOutputStream(file);
      IOUtils.copy(ifcSerializer.getInputStream(),fos);
      fos.close();
      in=new FileInputStream(file);
    }
 else {
      in=ifcSerializer.getInputStream();
    }
    RenderEngineModel renderEngineModel=renderEngine.openModel(in);
    try {
      renderEngineModel.setSettings(renderEngineSettings);
      renderEngineModel.setFilter(renderEngineFilter);
      try {
        renderEngineModel.generateGeneralGeometry();
      }
 catch (      RenderEngineException e) {
        if (e.getCause() instanceof java.io.EOFException) {
          if (oids.isEmpty() || eClass.getName().equals("String_Node_Str")) {
          }
 else {
            LOGGER.error("String_Node_Str" + eClass.getName(),e);
          }
        }
      }
      OidConvertingSerializer oidConvertingSerializer=(OidConvertingSerializer)ifcSerializer;
      Map<Long,Integer> oidToEid=oidConvertingSerializer.getOidToEid();
      for (      HashMapVirtualObject ifcProduct : oids) {
        Integer expressId=oidToEid.get(ifcProduct.getOid());
        if (ifcProduct.eGet(representationFeature) != null) {
          try {
            RenderEngineInstance renderEngineInstance=renderEngineModel.getInstanceFromExpressId(expressId);
            RenderEngineGeometry geometry=renderEngineInstance.generateGeometry();
            boolean translate=true;
            if (geometry != null && geometry.getNrIndices() > 0) {
              VirtualObject geometryInfo=new HashMapVirtualObject(queryContext,GeometryPackage.eINSTANCE.getGeometryInfo());
              WrappedVirtualObject minBounds=new HashMapWrappedVirtualObject(queryContext,GeometryPackage.eINSTANCE.getVector3f());
              WrappedVirtualObject maxBounds=new HashMapWrappedVirtualObject(queryContext,GeometryPackage.eINSTANCE.getVector3f());
              minBounds.set("String_Node_Str",Double.POSITIVE_INFINITY);
              minBounds.set("String_Node_Str",Double.POSITIVE_INFINITY);
              minBounds.set("String_Node_Str",Double.POSITIVE_INFINITY);
              maxBounds.set("String_Node_Str",-Double.POSITIVE_INFINITY);
              maxBounds.set("String_Node_Str",-Double.POSITIVE_INFINITY);
              maxBounds.set("String_Node_Str",-Double.POSITIVE_INFINITY);
              geometryInfo.setAttribute(GeometryPackage.eINSTANCE.getGeometryInfo_MinBounds(),minBounds);
              geometryInfo.setAttribute(GeometryPackage.eINSTANCE.getGeometryInfo_MaxBounds(),maxBounds);
              VirtualObject geometryData=new HashMapVirtualObject(queryContext,GeometryPackage.eINSTANCE.getGeometryData());
              geometryData.setAttribute(GeometryPackage.eINSTANCE.getGeometryData_Indices(),intArrayToByteArray(geometry.getIndices()));
              geometryData.setAttribute(GeometryPackage.eINSTANCE.getGeometryData_Vertices(),floatArrayToByteArray(geometry.getVertices()));
              geometryData.setAttribute(GeometryPackage.eINSTANCE.getGeometryData_MaterialIndices(),intArrayToByteArray(geometry.getMaterialIndices()));
              geometryData.setAttribute(GeometryPackage.eINSTANCE.getGeometryData_Normals(),floatArrayToByteArray(geometry.getNormals()));
              geometryInfo.setAttribute(GeometryPackage.eINSTANCE.getGeometryInfo_PrimitiveCount(),geometry.getIndices().length / 3);
              if (geometry.getMaterialIndices() != null && geometry.getMaterialIndices().length > 0) {
                boolean hasMaterial=false;
                float[] vertex_colors=new float[geometry.getVertices().length / 3 * 4];
                for (int i=0; i < geometry.getMaterialIndices().length; ++i) {
                  int c=geometry.getMaterialIndices()[i];
                  for (int j=0; j < 3; ++j) {
                    int k=geometry.getIndices()[i * 3 + j];
                    if (c > -1) {
                      hasMaterial=true;
                      for (int l=0; l < 4; ++l) {
                        vertex_colors[4 * k + l]=geometry.getMaterials()[4 * c + l];
                      }
                    }
                  }
                }
                if (hasMaterial) {
                  geometryData.setAttribute(GeometryPackage.eINSTANCE.getGeometryData_Materials(),floatArrayToByteArray(vertex_colors));
                }
              }
              double[] tranformationMatrix=new double[16];
              if (translate && renderEngineInstance.getTransformationMatrix() != null) {
                tranformationMatrix=renderEngineInstance.getTransformationMatrix();
              }
 else {
                Matrix.setIdentityM(tranformationMatrix,0);
              }
              for (int i=0; i < geometry.getIndices().length; i++) {
                processExtends(geometryInfo,tranformationMatrix,geometry.getVertices(),geometry.getIndices()[i] * 3,generateGeometryResult);
              }
              calculateObb(geometryInfo,tranformationMatrix,geometry.getIndices(),geometry.getVertices(),generateGeometryResult);
              geometryInfo.setReference(GeometryPackage.eINSTANCE.getGeometryInfo_Data(),geometryData.getOid(),0);
              long size=getSize(geometryData);
              setTransformationMatrix(geometryInfo,tranformationMatrix);
              if (bimServer.getServerSettingsCache().getServerSettings().isReuseGeometry()) {
                int hash=hash(geometryData);
                if (hashes.containsKey(hash)) {
                  geometryInfo.setReference(GeometryPackage.eINSTANCE.getGeometryInfo_Data(),hashes.get(hash),0);
                  bytesSaved.addAndGet(size);
                }
 else {
                  hashes.put(hash,geometryData.getOid());
                  geometryData.save();
                }
              }
 else {
                geometryData.save();
              }
              geometryInfo.save();
              totalBytes.addAndGet(size);
              ifcProduct.setReference(geometryFeature,geometryInfo.getOid(),0);
              ifcProduct.saveOverwrite();
            }
          }
 catch (          EntityNotFoundException e) {
            boolean ignoreNotFound=eClass.getName().equals("String_Node_Str");
            if (!ignoreNotFound) {
              LOGGER.info("String_Node_Str" + ifcProduct.eClass().getName() + "String_Node_Str"+ (expressId)+ "String_Node_Str"+ ifcProduct.getOid());
            }
          }
catch (          BimserverDatabaseException|RenderEngineException e) {
            LOGGER.error("String_Node_Str",e);
          }
        }
      }
    }
  finally {
      in.close();
      renderEngineModel.close();
      if (renderEngine != null) {
        renderEnginePool.returnObject(renderEngine);
      }
      jobsDone.incrementAndGet();
      updateProgress();
    }
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    HashMapVirtualObject next;
    next=objectProvider.next();
    Query query=new Query("String_Node_Str",packageMetaData);
    QueryPart queryPart=query.createQueryPart();
    while (next != null) {
      queryPart.addOid(next.getOid());
      next=objectProvider.next();
    }
    objectProvider=new QueryObjectProvider(databaseSession,bimServer,query,Collections.singleton(queryContext.getRoid()),packageMetaData);
    StreamingSerializer ifcSerializer=ifcSerializerPlugin.createSerializer(new PluginConfiguration());
    RenderEngine renderEngine=null;
    byte[] bytes=null;
    try {
      renderEngine=renderEnginePool.borrowObject();
      final Set<HashMapVirtualObject> oids=new HashSet<>();
      ObjectProviderProxy proxy=new ObjectProviderProxy(objectProvider,new ObjectListener(){
        @Override public void newObject(        HashMapVirtualObject next){
          if (eClass.isSuperTypeOf(next.eClass())) {
            oids.add(next);
          }
        }
      }
);
      ifcSerializer.init(proxy,null,null,bimServer.getPluginManager(),packageMetaData);
      ByteArrayOutputStream baos=new ByteArrayOutputStream();
      IOUtils.copy(ifcSerializer.getInputStream(),baos);
      bytes=baos.toByteArray();
      InputStream in=new ByteArrayInputStream(bytes);
      RenderEngineModel renderEngineModel=renderEngine.openModel(in);
      try {
        if (!oids.isEmpty()) {
          renderEngineModel.setSettings(renderEngineSettings);
          renderEngineModel.setFilter(renderEngineFilter);
          try {
            renderEngineModel.generateGeneralGeometry();
          }
 catch (          RenderEngineException e) {
            if (e.getCause() instanceof java.io.EOFException) {
              if (oids.isEmpty() || eClass.getName().equals("String_Node_Str")) {
              }
 else {
                LOGGER.error("String_Node_Str" + eClass.getName(),e);
              }
            }
          }
          OidConvertingSerializer oidConvertingSerializer=(OidConvertingSerializer)ifcSerializer;
          Map<Long,Integer> oidToEid=oidConvertingSerializer.getOidToEid();
          for (          HashMapVirtualObject ifcProduct : oids) {
            Integer expressId=oidToEid.get(ifcProduct.getOid());
            if (ifcProduct.eGet(representationFeature) != null) {
              try {
                RenderEngineInstance renderEngineInstance=renderEngineModel.getInstanceFromExpressId(expressId);
                RenderEngineGeometry geometry=renderEngineInstance.generateGeometry();
                boolean translate=true;
                if (geometry != null && geometry.getNrIndices() > 0) {
                  VirtualObject geometryInfo=new HashMapVirtualObject(queryContext,GeometryPackage.eINSTANCE.getGeometryInfo());
                  WrappedVirtualObject minBounds=new HashMapWrappedVirtualObject(queryContext,GeometryPackage.eINSTANCE.getVector3f());
                  WrappedVirtualObject maxBounds=new HashMapWrappedVirtualObject(queryContext,GeometryPackage.eINSTANCE.getVector3f());
                  minBounds.set("String_Node_Str",Double.POSITIVE_INFINITY);
                  minBounds.set("String_Node_Str",Double.POSITIVE_INFINITY);
                  minBounds.set("String_Node_Str",Double.POSITIVE_INFINITY);
                  maxBounds.set("String_Node_Str",-Double.POSITIVE_INFINITY);
                  maxBounds.set("String_Node_Str",-Double.POSITIVE_INFINITY);
                  maxBounds.set("String_Node_Str",-Double.POSITIVE_INFINITY);
                  geometryInfo.setAttribute(GeometryPackage.eINSTANCE.getGeometryInfo_MinBounds(),minBounds);
                  geometryInfo.setAttribute(GeometryPackage.eINSTANCE.getGeometryInfo_MaxBounds(),maxBounds);
                  VirtualObject geometryData=new HashMapVirtualObject(queryContext,GeometryPackage.eINSTANCE.getGeometryData());
                  geometryData.setAttribute(GeometryPackage.eINSTANCE.getGeometryData_Indices(),intArrayToByteArray(geometry.getIndices()));
                  geometryData.setAttribute(GeometryPackage.eINSTANCE.getGeometryData_Vertices(),floatArrayToByteArray(geometry.getVertices()));
                  geometryData.setAttribute(GeometryPackage.eINSTANCE.getGeometryData_MaterialIndices(),intArrayToByteArray(geometry.getMaterialIndices()));
                  geometryData.setAttribute(GeometryPackage.eINSTANCE.getGeometryData_Normals(),floatArrayToByteArray(geometry.getNormals()));
                  geometryInfo.setAttribute(GeometryPackage.eINSTANCE.getGeometryInfo_PrimitiveCount(),geometry.getIndices().length / 3);
                  if (geometry.getMaterialIndices() != null && geometry.getMaterialIndices().length > 0) {
                    boolean hasMaterial=false;
                    float[] vertex_colors=new float[geometry.getVertices().length / 3 * 4];
                    for (int i=0; i < geometry.getMaterialIndices().length; ++i) {
                      int c=geometry.getMaterialIndices()[i];
                      for (int j=0; j < 3; ++j) {
                        int k=geometry.getIndices()[i * 3 + j];
                        if (c > -1) {
                          hasMaterial=true;
                          for (int l=0; l < 4; ++l) {
                            vertex_colors[4 * k + l]=geometry.getMaterials()[4 * c + l];
                          }
                        }
                      }
                    }
                    if (hasMaterial) {
                      geometryData.setAttribute(GeometryPackage.eINSTANCE.getGeometryData_Materials(),floatArrayToByteArray(vertex_colors));
                    }
                  }
                  double[] tranformationMatrix=new double[16];
                  if (translate && renderEngineInstance.getTransformationMatrix() != null) {
                    tranformationMatrix=renderEngineInstance.getTransformationMatrix();
                  }
 else {
                    Matrix.setIdentityM(tranformationMatrix,0);
                  }
                  for (int i=0; i < geometry.getIndices().length; i++) {
                    processExtends(geometryInfo,tranformationMatrix,geometry.getVertices(),geometry.getIndices()[i] * 3,generateGeometryResult);
                  }
                  calculateObb(geometryInfo,tranformationMatrix,geometry.getIndices(),geometry.getVertices(),generateGeometryResult);
                  geometryInfo.setReference(GeometryPackage.eINSTANCE.getGeometryInfo_Data(),geometryData.getOid(),0);
                  long size=getSize(geometryData);
                  setTransformationMatrix(geometryInfo,tranformationMatrix);
                  if (bimServer.getServerSettingsCache().getServerSettings().isReuseGeometry()) {
                    int hash=hash(geometryData);
                    if (hashes.containsKey(hash)) {
                      geometryInfo.setReference(GeometryPackage.eINSTANCE.getGeometryInfo_Data(),hashes.get(hash),0);
                      bytesSaved.addAndGet(size);
                    }
 else {
                      hashes.put(hash,geometryData.getOid());
                      geometryData.save();
                    }
                  }
 else {
                    geometryData.save();
                  }
                  geometryInfo.save();
                  totalBytes.addAndGet(size);
                  ifcProduct.setReference(geometryFeature,geometryInfo.getOid(),0);
                  ifcProduct.saveOverwrite();
                }
              }
 catch (              EntityNotFoundException e) {
                boolean ignoreNotFound=eClass.getName().equals("String_Node_Str");
                if (!ignoreNotFound) {
                  LOGGER.info("String_Node_Str" + ifcProduct.eClass().getName() + "String_Node_Str"+ (expressId)+ "String_Node_Str"+ ifcProduct.getOid());
                }
              }
catch (              BimserverDatabaseException|RenderEngineException e) {
                LOGGER.error("String_Node_Str",e);
              }
            }
          }
        }
      }
  finally {
        in.close();
        renderEngineModel.close();
        if (renderEngine != null) {
          renderEnginePool.returnObject(renderEngine);
        }
        jobsDone.incrementAndGet();
        updateProgress();
      }
    }
 catch (    Exception e) {
      boolean debug=true;
      if (debug) {
        String basefilenamename="String_Node_Str";
        if (eClass != null) {
          basefilenamename=eClass.getName();
        }
        File file=new File(basefilenamename + "String_Node_Str");
        int i=0;
        while (file.exists()) {
          file=new File(basefilenamename + "String_Node_Str" + i+ "String_Node_Str");
          i++;
        }
        FileOutputStream fos=new FileOutputStream(file);
        IOUtils.copy(new ByteArrayInputStream(bytes),fos);
        fos.close();
      }
      LOGGER.error("String_Node_Str" + originalQuery,e);
    }
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str" + originalQuery,e);
  }
}