Program: 175829
Project: 175829
Buggy source:
public void createMesh(Output output){
  float[] roofColor=BLANK_ROOF;
  if (output.faces == null)   return;
  double bestRoofArea=0;
  roofColor=Colourz.toF4(HasApp.get(miniroof).color);
  Set<MiniFacade> allMFs=new HashSet<>();
  for (  Face f : output.faces.values()) {
    WallTag wt=((WallTag)GreebleHelper.getTag(f.profile,WallTag.class));
    if (wt != null)     if (wt.miniFacade != null)     allMFs.add(wt.miniFacade);
  }
  if (tweed != null)   for (  MiniFacade mf : allMFs) {
    mf.postState=new PostProcessState();
  }
  List<List<Face>> chains=Campz.findChains(output);
  if (tweed != null)   for (  List<Face> chain : chains) {
    Set<WallTag> opt=chain.stream().flatMap(f -> f.profile.stream()).filter(tag -> tag instanceof WallTag).map(t -> (WallTag)t).collect(Collectors.toSet());
    for (    WallTag wt : opt) {
      MiniFacade mf=wt.miniFacade;
      Edge e=chain.get(0).edge;
      Line megafacade=new Line(e.end.x,e.end.y,e.start.x,e.start.y);
      double mfl=megafacade.length();
      Vector2d dir=megafacade.dir();
      LinearForm3D lf=new LinearForm3D(new Vector3d(-dir.y,dir.x,0),e.start);
      for (      Face f : chain)       for (      Loop<Point2d> face : projectTo(megafacade,mfl,lf,f))       if (GreebleHelper.getTag(f.profile,WallTag.class) != null)       mf.postState.wallFaces.add(face);
 else       mf.postState.roofFaces.add(face);
      if (occluderLookup != null)       for (      Object o : wt.occlusions) {
        Face f=occluderLookup.get(o);
        if (f != null)         mf.postState.occluders.addAll(projectTo(megafacade,mfl,lf,f));
      }
      mf.width=chain.get(0).edge.length();
    }
  }
  for (  MiniFacade mf : allMFs) {
    mf.postState.outerWallRect=GreebleHelper.findRect(mf.postState.wallFaces);
    mf.featureGen.update();
  }
  if (tweed != null)   greebleGrid=new GreebleGrid(tweed,new MMeshBuilderCache());
  for (  List<Face> chain : chains) {
    Optional<Tag> opt=chain.stream().flatMap(f -> f.profile.stream()).filter(tag -> tag instanceof WallTag).findAny();
    WallTag wt=null;
    MiniFacade mf2=null;
    Set<QuadF> processedFeatures=new HashSet<>();
    Line megafacade=new Line();
    if (opt.isPresent() && (wt=(WallTag)opt.get()).miniFacade != null) {
      mf2=wt.miniFacade;
{
        Edge e=chain.get(0).edge;
        megafacade.set(e.end.x,e.end.y,e.start.x,e.start.y);
      }
      if (false && TweedSettings.settings.snapFacadeWidth) {
        mf2=new MiniFacade(wt.miniFacade);
        mf2.postState=wt.miniFacade.postState;
        double[] meshSE=findSE(wt.miniFacade,megafacade,chain);
        mf2.scaleX(meshSE[0],meshSE[1]);
      }
      mf2.featureGen.values().stream().flatMap(k -> k.stream()).map(r -> new QuadF(r,megafacade)).forEach(q -> processedFeatures.add(q));
    }
    if (tweed != null) {
      Set<QuadF> allFeatures=new LinkedHashSet<>();
      allFeatures.addAll(processedFeatures);
      for (      Face f : chain)       face(f,mf2,processedFeatures,megafacade);
      allFeatures.removeAll(processedFeatures);
      for (      QuadF q1 : allFeatures) {
        mf2.postState.generatedWindows.add(q1.original);
      }
    }
    if ((wt != null && wt.miniFacade.app.dormer) || TweedSettings.settings.createDormers) {
      Iterator<QuadF> quit=processedFeatures.iterator();
      while (quit.hasNext()) {
        QuadF w=quit.next();
        if ((w.original.f == Feature.WINDOW || w.original.f == Feature.SHOP) && w.foundAll()) {
          mf2.postState.generatedWindows.add(w.original);
          if (greebleGrid != null)           greebleGrid.createDormerWindow(miniroof,w,greebleGrid.mbs.WOOD,greebleGrid.mbs.GLASS,(float)wt.sillDepth,(float)wt.sillHeight,(float)wt.corniceHeight,0.6,0.9);
          quit.remove();
        }
      }
    }
    if (greebleGrid != null) {
      edges(output,roofColor);
      greebleGrid.attachAll(node,chain,output,new ClickMe(){
        @Override public void clicked(        Object data){
          try {
            SwingUtilities.invokeAndWait(new Runnable(){
              @Override public void run(){
                selected(output,node,findSuperEdge(output,chain),data instanceof Spatial ? ((HasApp)((Object[])((Spatial)data).getUserData(Appearance))[0]) : null);
              }
            }
);
          }
 catch (          Throwable th) {
            th.printStackTrace();
          }
        }
      }
);
    }
  }
}

Fixed version (ground truth):
public void createMesh(Output output){
  float[] roofColor=BLANK_ROOF;
  if (output.faces == null)   return;
  double bestRoofArea=0;
  roofColor=Colourz.toF4(HasApp.get(miniroof).color);
  Set<MiniFacade> allMFs=new HashSet<>();
  for (  Face f : output.faces.values()) {
    WallTag wt=((WallTag)GreebleHelper.getTag(f.profile,WallTag.class));
    if (wt != null) {
      if (wt.miniFacade != null)       allMFs.add(wt.miniFacade);
    }
  }
  if (tweed != null)   for (  MiniFacade mf : allMFs) {
    mf.postState=new PostProcessState();
  }
  List<List<Face>> chains=Campz.findChains(output);
  if (tweed != null)   for (  List<Face> chain : chains) {
    Set<WallTag> opt=chain.stream().flatMap(f -> f.profile.stream()).filter(tag -> tag instanceof WallTag).map(t -> (WallTag)t).collect(Collectors.toSet());
    for (    WallTag wt : opt) {
      MiniFacade mf=wt.miniFacade;
      Edge e=chain.get(0).edge;
      Line megafacade=new Line(e.end.x,e.end.y,e.start.x,e.start.y);
      double mfl=megafacade.length();
      Vector2d dir=megafacade.dir();
      LinearForm3D lf=new LinearForm3D(new Vector3d(-dir.y,dir.x,0),e.start);
      for (      Face f : chain)       for (      Loop<Point2d> face : projectTo(megafacade,mfl,lf,f))       if (GreebleHelper.getTag(f.profile,WallTag.class) != null)       mf.postState.wallFaces.add(face);
 else       mf.postState.roofFaces.add(face);
      if (occluderLookup != null)       for (      Object o : wt.occlusions) {
        Face f=occluderLookup.get(o);
        if (f != null)         mf.postState.occluders.addAll(projectTo(megafacade,mfl,lf,f));
      }
      mf.width=chain.get(0).edge.length();
    }
  }
  for (  MiniFacade mf : allMFs) {
    mf.postState.outerWallRect=GreebleHelper.findRect(mf.postState.wallFaces);
    mf.featureGen.update();
  }
  if (tweed != null)   greebleGrid=new GreebleGrid(tweed,new MMeshBuilderCache());
  for (  List<Face> chain : chains) {
    Optional<Tag> opt=chain.stream().flatMap(f -> f.profile.stream()).filter(tag -> tag instanceof WallTag).findAny();
    WallTag wt=null;
    MiniFacade mf2=null;
    Set<QuadF> processedFeatures=new HashSet<>();
    Line megafacade=new Line();
    if (opt.isPresent() && (wt=(WallTag)opt.get()).miniFacade != null) {
      mf2=wt.miniFacade;
{
        Edge e=chain.get(0).edge;
        megafacade.set(e.end.x,e.end.y,e.start.x,e.start.y);
      }
      if (false && TweedSettings.settings.snapFacadeWidth) {
        mf2=new MiniFacade(wt.miniFacade);
        mf2.postState=wt.miniFacade.postState;
        double[] meshSE=findSE(wt.miniFacade,megafacade,chain);
        mf2.scaleX(meshSE[0],meshSE[1]);
      }
      mf2.featureGen.values().stream().flatMap(k -> k.stream()).map(r -> new QuadF(r,megafacade)).forEach(q -> processedFeatures.add(q));
    }
    if (tweed != null) {
      Set<QuadF> allFeatures=new LinkedHashSet<>();
      allFeatures.addAll(processedFeatures);
      for (      Face f : chain)       face(f,mf2,processedFeatures,megafacade);
      allFeatures.removeAll(processedFeatures);
      for (      QuadF q1 : allFeatures) {
        if (q1.original.f == Feature.WINDOW || q1.original.f == Feature.SHOP) {
          mf2.postState.generatedWindows.add(q1.original);
        }
      }
    }
    if ((wt != null && wt.miniFacade.app.dormer) || TweedSettings.settings.createDormers) {
      Iterator<QuadF> quit=processedFeatures.iterator();
      while (quit.hasNext()) {
        QuadF w=quit.next();
        if ((w.original.f == Feature.WINDOW || w.original.f == Feature.SHOP) && w.foundAll()) {
          mf2.postState.generatedWindows.add(w.original);
          if (greebleGrid != null)           greebleGrid.createDormerWindow(miniroof,w,greebleGrid.mbs.WOOD,greebleGrid.mbs.GLASS,(float)wt.sillDepth,(float)wt.sillHeight,(float)wt.corniceHeight,0.6,0.9);
          quit.remove();
        }
      }
    }
    if (greebleGrid != null) {
      edges(output,roofColor);
      greebleGrid.attachAll(node,chain,output,new ClickMe(){
        @Override public void clicked(        Object data){
          try {
            SwingUtilities.invokeAndWait(new Runnable(){
              @Override public void run(){
                selected(output,node,findSuperEdge(output,chain),data instanceof Spatial ? ((HasApp)((Object[])((Spatial)data).getUserData(Appearance))[0]) : null);
              }
            }
);
          }
 catch (          Throwable th) {
            th.printStackTrace();
          }
        }
      }
);
    }
  }
}