Program: 175858
Project: 175858
Buggy source:
public FacadeFinder(LoopL<Point2d> _edges,Map<Point2d,Pano> panos,PlanesGen drawnPlanes){
  MultiMap<Point2d,Integer> whichPoly=new MultiMap<>();
  LoopL<Point2d> edges=simplify(_edges,whichPoly);
  List<FacadeDirection> fs=new ArrayList<>();
  List<Loopable<Point2d>> longestFirst=edges.stream().flatMap(x -> Streamz.stream(x.loopableIterator())).sorted((b,a) -> Double.compare(a.get().distanceSquared(a.getNext().get()),b.get().distanceSquared(b.getNext().get()))).collect(Collectors.toList());
  for (  Loopable<Point2d> lp : longestFirst) {
    Point2d s=lp.get(), e=lp.getNext().get();
    Line l=new SuperLine(s,e);
    boolean found=false;
    for (    FacadeDirection f : fs)     if (f.addIfMatches(l)) {
      found=true;
      break;
    }
    if (!found)     fs.add(new FacadeDirection(l));
  }
  for (  FacadeDirection f : fs) {
    if (f.length < 2)     continue;
    Line drawnPlane=null;
    if (drawnPlanes != null) {
      Line outl=f.getExtent();
      Optional<Plane> op=drawnPlanes.planes.stream().filter(p -> {
        Line pl=new Line(Jme3z.to2(p.a),Jme3z.to2(p.b));
        double angle=pl.absAngle(outl);
        return pl.distance(outl) < 5 && (angle < 0.3 || angle > Math.PI - 0.3);
      }
).findAny();
      if (op.isPresent()) {
        drawnPlane=new Line(Jme3z.to2(op.get().a),Jme3z.to2(op.get().b));
      }
      if (drawnPlane == null)       continue;
    }
    ToProjMega megaResults=new ToProjMega(f.getExtent().reverse());
    results.add(megaResults);
    if (facadeMode == FacadeMode.PER_GIS) {
      for (      Line l : f.facades) {
        if (l.lengthSquared() < 5 * 5)         continue;
        String description=createDescription(l,(SuperLoop<Point2d>)_edges.get(findOrigPoly(whichPoly,l.start,l.end)),new double[1]);
        if (description == null)         continue;
        double height=10;
        System.out.println("String_Node_Str" + height);
        Line ex=new Line(l);
        ex=ex.reverse();
        Vector2d dir=ex.dir();
        dir.scale(5 / dir.length());
        Point2d mid=ex.fromPPram(0.5);
        ex.start.set(mid);
        ex.start.sub(dir);
        ex.end.set(mid);
        ex.end.add(dir);
        ToProject out=new ToProject(ex.start,ex.end,0,height);
        out.description=description;
        for (        Point2d p : panos.keySet()) {
          if (ex.isOnLeft(p))           if (Mathz.inRange(ex.findPPram(p),0,1))           out.toProject.add(panos.get(p));
        }
        if (out.toProject.size() > 0)         megaResults.add(out);
      }
    }
 else     if (facadeMode == FacadeMode.KANGAROO) {
      List<Line> filtered=f.facades.stream().filter(l -> l.lengthSquared() > 3 * 3).collect(Collectors.toList());
      Collections.shuffle(filtered);
      for (      Line l : filtered) {
        SuperLoop<Point2d> orig=(SuperLoop<Point2d>)_edges.get(findOrigPoly(whichPoly,l.start,l.end));
        double[] ho=new double[1];
        String description=createDescription(l,orig,ho);
        if (description == null)         continue;
        double height=ho[0];
        System.out.println("String_Node_Str" + height);
        Line ex=new Line(l);
        ex.reverseLocal();
        Point2d mid=ex.fromPPram(0.5);
{
          Vector2d dir=ex.dir();
          dir.scale(2 / dir.length());
          ex.start.sub(dir);
          ex.end.add(dir);
        }
        Pano pano=new SVLatLongQuery(TweedFrame.instance.tweed.worldToLatLong(Pointz.to3(mid))).query(new Score(){
          @Override public double score(          Pano query){
            Point2d p=new Point2d(query.location.x,query.location.z);
            double d2=ex.distance(p);
            if (ex.isOnLeft(p) && d2 < 25)             if (ex.distance(ex.project(p,false)) < 3)             return -d2;
            return -Double.MAX_VALUE;
          }
        }
);
        if (pano == null)         continue;
        ToProject out=new ToProject(ex.start,ex.end,0,height);
        out.description=description;
        out.toProject.add(pano);
        megaResults.add(out);
        break;
      }
    }
 else     if (facadeMode == FacadeMode.PER_MEGA) {
      Line mega=f.getExtent();
      Vector2d dir=mega.dir();
      dir.scale(7 / dir.length());
      Point2d s=new Point2d(mega.start), e=new Point2d(mega.end);
      e.add(dir);
      s.sub(dir);
      for (      Point2d p : panos.keySet()) {
        Point2d cen=mega.project(p,false);
        if (mega.isOnLeft(p) && mega.distance(p,true) < 20 && Mathz.inRange(mega.findPPram(cen),0,1)) {
          double height=panos.get(p).location.y;
          ToProject out=new ToProject(s,e,0,height + 30);
          megaResults.add(out);
          out.toProject.add(panos.get(p));
        }
      }
    }
 else     if (facadeMode == FacadeMode.PER_CAMERA || facadeMode == FacadeMode.PER_CAMERA_CROPPED) {
      Line l=f.getExtent();
      double lLength=l.length();
      for (      Point2d p : panos.keySet()) {
        if (l.isOnLeft(p) && l.distance(p,true) < 20) {
          double fovX2=Math.PI / 3;
          Point2d cen=l.project(p,false);
          double dist=cen.distance(p), frac=l.findPPram(cen);
          if (dist > 20 || !Mathz.inRange(frac * lLength,-2,lLength + 2))           continue;
          double xLen=dist * Math.tan(fovX2);
          Vector2d dirX=l.dir();
          dirX.normalize();
          Point2d left=new Point2d(dirX);
          left.scaleAdd(xLen,cen);
          Point2d right=new Point2d(dirX);
          right.scaleAdd(-xLen,cen);
          if (facadeMode == FacadeMode.PER_CAMERA_CROPPED) {
            double beyond=6;
            double min=-beyond / l.length(), max=1 + (beyond / l.length());
            if (drawnPlane != null) {
              double s=l.findPPram(drawnPlane.start), e=l.findPPram(drawnPlane.end);
              if (s > e) {
                double tmp=e;
                e=s;
                s=tmp;
              }
              min=Mathz.clamp(min,s,e);
              max=Mathz.clamp(max,s,e);
            }
            if (l.findPPram(right) < min)             right=l.fromPPram(min);
            if (l.findPPram(left) > max)             left=l.fromPPram(max);
          }
          double height=panos.get(p).location.y;
          ToProject out=new ToProject(right,left,0,height + 30);
          if (left.distance(right) > 3) {
            out.toProject.add(panos.get(p));
            megaResults.add(out);
          }
        }
      }
    }
    Collections.sort(megaResults,new Comparator<ToProject>(){
      @Override public int compare(      ToProject o1,      ToProject o2){
        return Double.compare(pram(o1),pram(o2));
      }
      private double pram(      ToProject o1){
        Vector3d pt=o1.toProject.iterator().next().location;
        return megaResults.megafacade.findPPram(new Point2d(pt.x,pt.z));
      }
    }
);
  }
}

Fixed version (ground truth):
public FacadeFinder(LoopL<Point2d> _edges,Map<Point2d,Pano> panos,PlanesGen drawnPlanes){
}