Program: 70990
Project: 70990
Buggy source:
public static PolygonalMesh readBinary(PolygonalMesh mesh,InputStream is,double tol) throws IOException {
  boolean _printDebug=false;
  is.skip(80);
  byte[] bbuf=new byte[4];
  is.read(bbuf,0,4);
  long numFacets=0;
  numFacets|=bbuf[3] & 0xFF;
  numFacets<<=8;
  numFacets|=bbuf[2] & 0xFF;
  numFacets<<=8;
  numFacets|=bbuf[1] & 0xFF;
  numFacets<<=8;
  numFacets|=bbuf[0] & 0xFF;
  if (_printDebug) {
    System.out.println("String_Node_Str" + numFacets);
  }
  ArrayList<Point3d> nodeList=new ArrayList<Point3d>();
  ArrayList<ArrayList<Integer>> faceList=new ArrayList<ArrayList<Integer>>();
  if (_printDebug) {
    System.out.print("String_Node_Str");
  }
  long start=System.nanoTime();
  int facetSize=50;
  bbuf=new byte[facetSize];
  List<Point3d> allPoints=new ArrayList<>(3 * (int)numFacets);
  List<Point3d[]> allFaces=new ArrayList<>((int)numFacets);
  for (long i=0; i < numFacets; i++) {
    int nBytesRead=is.read(bbuf,0,facetSize);
    if (nBytesRead < facetSize) {
      throw new IOException("String_Node_Str");
    }
    ByteBuffer bb=ByteBuffer.wrap(bbuf);
    bb.order(ByteOrder.LITTLE_ENDIAN);
    bb.getFloat();
    bb.getFloat();
    bb.getFloat();
    Point3d[] face=new Point3d[3];
    double[] vals=new double[3];
    for (int j=0; j < 3; j++) {
      vals[0]=bb.getFloat();
      vals[1]=bb.getFloat();
      vals[2]=bb.getFloat();
      Point3d pnt;
      pnt=new Point3d(vals);
      allPoints.add(pnt);
      face[j]=pnt;
    }
    allFaces.add(face);
    bb.getShort();
  }
  if (_printDebug) {
    System.out.println("String_Node_Str" + 1.e-9 * (System.nanoTime() - start) + "String_Node_Str");
    System.out.print("String_Node_Str");
    start=System.nanoTime();
  }
  SpatialHashTable<Point3d> table=new SpatialHashTable<>(tol);
  table.setup(allPoints,allPoints);
  if (_printDebug) {
    System.out.println("String_Node_Str" + 1.e-9 * (System.nanoTime() - start) + "String_Node_Str");
    System.out.print("String_Node_Str");
    start=System.nanoTime();
  }
  HashMap<Point3d,Integer> allToUniqueMap=new HashMap<>(allPoints.size());
  double tolSq=tol * tol;
  for (  Point3d pnt : allPoints) {
    if (allToUniqueMap.containsKey(pnt)) {
      continue;
    }
    List<Point3d> results=new ArrayList<>();
    Iterator<List<Point3d>> it=table.getCellsNearOld(pnt);
    while (it.hasNext()) {
      List<Point3d> cell=it.next();
      if (cell == null)       continue;
      for (      Point3d neighbour : cell) {
        if (neighbour.distanceSquared(pnt) < tolSq) {
          results.add(neighbour);
        }
      }
    }
    int idx=nodeList.size();
    nodeList.add(pnt);
    for (    Point3d neighbour : results) {
      allToUniqueMap.put(neighbour,idx);
    }
  }
  if (_printDebug) {
    System.out.println("String_Node_Str" + 1.e-9 * (System.nanoTime() - start) + "String_Node_Str");
    System.out.print("String_Node_Str");
    start=System.nanoTime();
  }
  for (  Point3d[] face : allFaces) {
    ArrayList<Integer> faceNodes=new ArrayList<Integer>(3);
    for (int i=0; i < 3; i++) {
      int idx=allToUniqueMap.get(face[i]);
      faceNodes.add(idx);
    }
    faceList.add(faceNodes);
  }
  if (_printDebug) {
    System.out.println("String_Node_Str" + 1.e-9 * (System.nanoTime() - start) + "String_Node_Str");
    System.out.print("String_Node_Str");
    start=System.nanoTime();
  }
  mesh=buildMesh(mesh,nodeList,faceList);
  if (_printDebug) {
    System.out.println("String_Node_Str" + 1.e-9 * (System.nanoTime() - start) + "String_Node_Str");
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str" + nodeList.size());
    System.out.println("String_Node_Str" + allFaces.size());
  }
  return mesh;
}

Fixed version (ground truth):
public static PolygonalMesh readBinary(PolygonalMesh mesh,InputStream is,double tol) throws IOException {
  boolean _printDebug=false;
  is.skip(80);
  byte[] bbuf=new byte[4];
  is.read(bbuf,0,4);
  long numFacets=0;
  numFacets|=bbuf[3] & 0xFF;
  numFacets<<=8;
  numFacets|=bbuf[2] & 0xFF;
  numFacets<<=8;
  numFacets|=bbuf[1] & 0xFF;
  numFacets<<=8;
  numFacets|=bbuf[0] & 0xFF;
  if (_printDebug) {
    System.out.println("String_Node_Str" + numFacets);
  }
  ArrayList<Point3d> nodeList=new ArrayList<Point3d>();
  ArrayList<ArrayList<Integer>> faceList=new ArrayList<ArrayList<Integer>>();
  if (_printDebug) {
    System.out.print("String_Node_Str");
  }
  long start=System.nanoTime();
  int facetSize=50;
  bbuf=new byte[facetSize];
  List<Point3d> allPoints=new ArrayList<Point3d>(3 * (int)numFacets);
  List<Point3d[]> allFaces=new ArrayList<Point3d[]>((int)numFacets);
  for (long i=0; i < numFacets; i++) {
    int nBytesRead=is.read(bbuf,0,facetSize);
    if (nBytesRead < facetSize) {
      throw new IOException("String_Node_Str");
    }
    ByteBuffer bb=ByteBuffer.wrap(bbuf);
    bb.order(ByteOrder.LITTLE_ENDIAN);
    bb.getFloat();
    bb.getFloat();
    bb.getFloat();
    Point3d[] face=new Point3d[3];
    double[] vals=new double[3];
    for (int j=0; j < 3; j++) {
      vals[0]=bb.getFloat();
      vals[1]=bb.getFloat();
      vals[2]=bb.getFloat();
      Point3d pnt;
      pnt=new Point3d(vals);
      allPoints.add(pnt);
      face[j]=pnt;
    }
    allFaces.add(face);
    bb.getShort();
  }
  if (_printDebug) {
    System.out.println("String_Node_Str" + 1.e-9 * (System.nanoTime() - start) + "String_Node_Str");
    System.out.print("String_Node_Str");
    start=System.nanoTime();
  }
  SpatialHashTable<Point3d> table=new SpatialHashTable<Point3d>(tol);
  table.setup(allPoints,allPoints);
  if (_printDebug) {
    System.out.println("String_Node_Str" + 1.e-9 * (System.nanoTime() - start) + "String_Node_Str");
    System.out.print("String_Node_Str");
    start=System.nanoTime();
  }
  HashMap<Point3d,Integer> allToUniqueMap=new HashMap<Point3d,Integer>(allPoints.size());
  double tolSq=tol * tol;
  for (  Point3d pnt : allPoints) {
    if (allToUniqueMap.containsKey(pnt)) {
      continue;
    }
    List<Point3d> results=new ArrayList<Point3d>();
    Iterator<List<Point3d>> it=table.getCellsNearOld(pnt);
    while (it.hasNext()) {
      List<Point3d> cell=it.next();
      if (cell == null)       continue;
      for (      Point3d neighbour : cell) {
        if (neighbour.distanceSquared(pnt) < tolSq) {
          results.add(neighbour);
        }
      }
    }
    int idx=nodeList.size();
    nodeList.add(pnt);
    for (    Point3d neighbour : results) {
      allToUniqueMap.put(neighbour,idx);
    }
  }
  if (_printDebug) {
    System.out.println("String_Node_Str" + 1.e-9 * (System.nanoTime() - start) + "String_Node_Str");
    System.out.print("String_Node_Str");
    start=System.nanoTime();
  }
  for (  Point3d[] face : allFaces) {
    ArrayList<Integer> faceNodes=new ArrayList<Integer>(3);
    for (int i=0; i < 3; i++) {
      int idx=allToUniqueMap.get(face[i]);
      faceNodes.add(idx);
    }
    faceList.add(faceNodes);
  }
  if (_printDebug) {
    System.out.println("String_Node_Str" + 1.e-9 * (System.nanoTime() - start) + "String_Node_Str");
    System.out.print("String_Node_Str");
    start=System.nanoTime();
  }
  mesh=buildMesh(mesh,nodeList,faceList);
  if (_printDebug) {
    System.out.println("String_Node_Str" + 1.e-9 * (System.nanoTime() - start) + "String_Node_Str");
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str" + nodeList.size());
    System.out.println("String_Node_Str" + allFaces.size());
  }
  return mesh;
}