Program: 160589
Project: 160589
Buggy source:
private void writeGeometries(OutputStream outputStream) throws IOException {
  DataOutputStream dataOutputStream=new DataOutputStream(outputStream);
  dataOutputStream.writeUTF("String_Node_Str");
  dataOutputStream.writeByte(FORMAT_VERSION);
  dataOutputStream.write(new byte[2]);
  Bounds modelBounds=new Bounds();
  int nrObjects=0;
  for (  IfcProduct ifcProduct : getModel().getAllWithSubTypes(IfcProduct.class)) {
    GeometryInfo geometryInfo=ifcProduct.getGeometry();
    if (geometryInfo != null) {
      Bounds objectBounds=new Bounds(new Float3(geometryInfo.getMinBounds().getX(),geometryInfo.getMinBounds().getY(),geometryInfo.getMinBounds().getZ()),new Float3(geometryInfo.getMaxBounds().getX(),geometryInfo.getMaxBounds().getY(),geometryInfo.getMaxBounds().getZ()));
      modelBounds.integrate(objectBounds);
      nrObjects++;
    }
  }
  modelBounds.writeTo(dataOutputStream);
  dataOutputStream.writeInt(nrObjects);
  for (  IfcProduct ifcProduct : getModel().getAllWithSubTypes(IfcProduct.class)) {
    GeometryInfo geometryInfo=ifcProduct.getGeometry();
    if (geometryInfo != null) {
      String materialName=getMaterial(ifcProduct);
      dataOutputStream.writeUTF(materialName);
      String type=null;
      if (ifcProduct instanceof IfcSlab && ((IfcSlab)ifcProduct).getPredefinedType() == IfcSlabTypeEnum.ROOF) {
        type="String_Node_Str";
      }
 else {
        type=ifcProduct.eClass().getName();
      }
      dataOutputStream.writeUTF(type);
      dataOutputStream.writeLong(ifcProduct.getOid());
      dataOutputStream.write(new byte[4 - ((materialName + type).getBytes(Charsets.UTF_8).length % 4)]);
      Bounds objectBounds=new Bounds(geometryInfo.getMinBounds(),geometryInfo.getMaxBounds());
      objectBounds.writeTo(dataOutputStream);
      dataOutputStream.writeInt(geometryInfo.getPrimitiveCount() * 3);
      GeometryData geometryData=geometryInfo.getData();
      byte[] vertices=geometryData.getVertices();
      ByteBuffer buffer=ByteBuffer.wrap(vertices);
      convertOrder(buffer);
      dataOutputStream.writeInt(buffer.capacity() / 4);
      dataOutputStream.write(buffer.array());
      byte[] normals=geometryData.getNormals();
      buffer=ByteBuffer.wrap(normals);
      convertOrder(buffer);
      dataOutputStream.writeInt(buffer.capacity() / 4);
      dataOutputStream.write(buffer.array());
    }
  }
  dataOutputStream.flush();
}

Fixed version (ground truth):
private void writeGeometries(OutputStream outputStream) throws IOException {
  DataOutputStream dataOutputStream=new DataOutputStream(outputStream);
  dataOutputStream.writeUTF("String_Node_Str");
  dataOutputStream.writeByte(FORMAT_VERSION);
  dataOutputStream.write(new byte[2]);
  Bounds modelBounds=new Bounds();
  int nrObjects=0;
  for (  IfcProduct ifcProduct : getModel().getAllWithSubTypes(IfcProduct.class)) {
    GeometryInfo geometryInfo=ifcProduct.getGeometry();
    if (geometryInfo != null) {
      Bounds objectBounds=new Bounds(new Float3(geometryInfo.getMinBounds().getX(),geometryInfo.getMinBounds().getY(),geometryInfo.getMinBounds().getZ()),new Float3(geometryInfo.getMaxBounds().getX(),geometryInfo.getMaxBounds().getY(),geometryInfo.getMaxBounds().getZ()));
      modelBounds.integrate(objectBounds);
      nrObjects++;
    }
  }
  modelBounds.writeTo(dataOutputStream);
  dataOutputStream.writeInt(nrObjects);
  for (  IfcProduct ifcProduct : getModel().getAllWithSubTypes(IfcProduct.class)) {
    GeometryInfo geometryInfo=ifcProduct.getGeometry();
    if (geometryInfo != null) {
      String materialName=getMaterial(ifcProduct);
      dataOutputStream.writeUTF(materialName);
      String type=null;
      if (ifcProduct instanceof IfcSlab && ((IfcSlab)ifcProduct).getPredefinedType() == IfcSlabTypeEnum.ROOF) {
        type="String_Node_Str";
      }
 else {
        type=ifcProduct.eClass().getName();
      }
      dataOutputStream.writeUTF(type);
      int skip=4 - (dataOutputStream.size() % 4);
      if (skip > 0 && skip != 4)       dataOutputStream.write(new byte[skip]);
      dataOutputStream.writeLong(ifcProduct.getOid());
      skip=4 - (dataOutputStream.size() % 4);
      if (skip > 0 && skip != 4)       dataOutputStream.write(new byte[skip]);
      Bounds objectBounds=new Bounds(geometryInfo.getMinBounds(),geometryInfo.getMaxBounds());
      objectBounds.writeTo(dataOutputStream);
      dataOutputStream.writeInt(geometryInfo.getPrimitiveCount() * 3);
      GeometryData geometryData=geometryInfo.getData();
      byte[] vertices=geometryData.getVertices();
      ByteBuffer buffer=ByteBuffer.wrap(vertices);
      convertOrder(buffer);
      dataOutputStream.writeInt(buffer.capacity() / 4);
      dataOutputStream.write(buffer.array());
      byte[] normals=geometryData.getNormals();
      buffer=ByteBuffer.wrap(normals);
      convertOrder(buffer);
      dataOutputStream.writeInt(buffer.capacity() / 4);
      dataOutputStream.write(buffer.array());
    }
  }
  dataOutputStream.flush();
}