Program: 175827
Project: 175827
Buggy source:
protected void textureGrid(DRectangle allGeom,DRectangle allUV,Matrix4d to3d,FeatureGenerator filteredFeatures,MiniFacade mf){
  if (mf != null && mf.app.texture != null) {
    Grid g=new Grid(.010,allGeom.x,allGeom.getMaxX(),allGeom.y,allGeom.getMaxY());
    MatMeshBuilder mmb=mbs.getTexture("String_Node_Str" + mf.app.texture,mf.app.texture,mf);
    for (    FRect w : filteredFeatures.getRects(Feature.WINDOW,Feature.SHOP)) {
      if (allGeom.contains(w))       g.insert(w,new Griddable(){
        @Override public void instance(        DRectangle rect){
          if (w.app.texture == null)           createInnie(rect,allUV.normalize(rect),to3d,mbs.getTexture("String_Node_Str" + mf.app.texture + "String_Node_Str"+ w.hashCode(),mf.app.texture,w.app.hasA),0.2f,0,MeshBuilder.ALL_BUT_FRONT);
 else           if (w.app.panes == null) {
            createInnie(rect,allUV.normalize(rect),to3d,mmb,0.2f,0,MeshBuilder.NO_FRONT_OR_BACK);
            mbs.getTexture("String_Node_Str" + w.app.texture + "String_Node_Str"+ w.hashCode(),w.app.texture,w.app.hasA).add(rect,ZERO_ONE_UVS,to3d,-0.2);
          }
 else           if (w.app.textureUVs == TextureUVs.ZERO_ONE) {
            createInnie(rect,rect,to3d,mmb,0.2f,0,MeshBuilder.NO_FRONT_OR_BACK);
            createWindowFromPanes(w.app.panes,rect,rect,to3d,mbs.getTexture("String_Node_Str" + w.app.texture + "String_Node_Str"+ w.hashCode(),w.app.texture,w.app.hasA),0.3,0.2);
          }
 else {
            DRectangle uvs=allUV.normalize(rect);
            createInnie(rect,uvs,to3d,mmb,0.2f,0,MeshBuilder.NO_FRONT_OR_BACK);
            createWindowFromPanes(w.app.panes,rect,allUV,to3d,mbs.getTexture("String_Node_Str" + mf.app.texture + "String_Node_Str"+ w.hashCode(),mf.app.texture,w.app.hasA),0.3,0.2);
          }
        }
      }
);
    }
    for (    FRect w : filteredFeatures.get(Feature.DOOR)) {
      if (allGeom.contains(w))       g.insert(w,new Griddable(){
        @Override public void instance(        DRectangle rect){
          if (w.app.texture == null)           createInnie(rect,allUV.normalize(rect),to3d,mmb,0.5f,0,MeshBuilder.ALL_BUT_FRONT);
 else           createInnie(rect,ZERO_ONE_UVS,to3d,mbs.getTexture("String_Node_Str" + w.app.texture,w.app.texture,w.app.hasA),0.3f,0,MeshBuilder.ALL_BUT_FRONT);
        }
      }
);
    }
    for (    FRect w : filteredFeatures.getRects(Feature.MOULDING,Feature.SILL)) {
      if (allGeom.contains(w))       g.insert(w,new Griddable(){
        @Override public void instance(        DRectangle rect){
          createInnie(rect,allUV.normalize(rect),to3d,mmb,-0.1f,0,MeshBuilder.ALL_BUT_FRONT);
        }
      }
);
    }
    for (    FRect w : filteredFeatures.getRects(Feature.CORNICE)) {
      if (allGeom.contains(w))       g.insert(w,new Griddable(){
        @Override public void instance(        DRectangle rect){
          createInnie(rect,allUV.normalize(rect),to3d,mmb,-0.1f,0,MeshBuilder.ALL_BUT_FRONT);
        }
      }
);
    }
    for (    FRect b : filteredFeatures.get(Feature.BALCONY)) {
      if (allGeom.contains(b))       g.insert(b,new Griddable(){
        @Override public void instance(        DRectangle rect){
          createBalcony(rect,to3d,mbs.get("String_Node_Str" + b.app.color,b.app.color,mf),0.3);
        }
        @Override public boolean noneBehind(){
          return true;
        }
      }
);
    }
    g.instance(new Griddable(){
      @Override public void instance(      DRectangle rect){
        mmb.add(rect,allUV.normalize(rect),to3d);
      }
    }
);
  }
}

Fixed version (ground truth):
protected void textureGrid(DRectangle allGeom,DRectangle allUV,Matrix4d to3d,FeatureGenerator filteredFeatures,MiniFacade mf){
  if (mf != null && mf.app.texture != null) {
    Grid g=new Grid(.010,allGeom.x,allGeom.getMaxX(),allGeom.y,allGeom.getMaxY());
    MatMeshBuilder mmb=mbs.getTexture("String_Node_Str" + mf.app.texture,mf.app.texture,mf);
    for (    FRect w : filteredFeatures.getRects(Feature.WINDOW,Feature.SHOP)) {
      if (allGeom.contains(w))       g.insert(w,new Griddable(){
        @Override public void instance(        DRectangle rect){
          if (w.app.texture == null)           createInnie(rect,allUV.normalize(rect),to3d,mbs.getTexture("String_Node_Str" + mf.app.texture + "String_Node_Str"+ w.hashCode(),mf.app.texture,w.app.hasA),0.2f,0,MeshBuilder.ALL_BUT_FRONT);
 else           if (w.app.panes == null) {
            createInnie(rect,allUV.normalize(rect),to3d,mmb,0.2f,0,MeshBuilder.NO_FRONT_OR_BACK);
            mbs.getTexture("String_Node_Str" + w.app.texture + "String_Node_Str"+ w.hashCode(),w.app.texture,w.app.hasA).add(rect,ZERO_ONE_UVS,to3d,-0.2);
          }
 else           if (w.app.textureUVs == TextureUVs.ZERO_ONE) {
            createInnie(rect,rect,to3d,mmb,0.2f,0,MeshBuilder.NO_FRONT_OR_BACK);
            createWindowFromPanes(w.app.panes,rect,rect,to3d,mbs.getTexture("String_Node_Str" + w.app.texture + "String_Node_Str"+ w.hashCode(),w.app.texture,w.app.hasA),0.3,0.2);
          }
 else {
            DRectangle uvs=allUV.normalize(rect);
            createInnie(rect,uvs,to3d,mmb,0.2f,0,MeshBuilder.NO_FRONT_OR_BACK);
            createWindowFromPanes(w.app.panes,rect,allUV,to3d,mbs.getTexture("String_Node_Str" + mf.app.texture + "String_Node_Str"+ w.hashCode(),mf.app.texture,w.app.hasA),0.3,0.2);
          }
        }
      }
);
    }
    for (    FRect w : filteredFeatures.get(Feature.DOOR)) {
      if (allGeom.contains(w))       g.insert(w,new Griddable(){
        @Override public void instance(        DRectangle rect){
          if (w.app.texture == null)           createInnie(rect,allUV.normalize(rect),to3d,mmb,0.5f,0,MeshBuilder.ALL_BUT_FRONT);
 else           createInnie(rect,ZERO_ONE_UVS,to3d,mbs.getTexture("String_Node_Str" + w.app.texture,w.app.texture,w.app.hasA),0.3f,0,MeshBuilder.ALL_BUT_FRONT);
        }
      }
);
    }
    for (    FRect w : filteredFeatures.getRects(Feature.MOULDING,Feature.SILL)) {
      if (allGeom.contains(w))       g.insert(w,new Griddable(){
        @Override public void instance(        DRectangle rect){
          if (w.f == Feature.MOULDING)           System.out.println("String_Node_Str" + rect);
          createInnie(rect,allUV.normalize(rect),to3d,mmb,-0.1f,0,MeshBuilder.ALL_BUT_FRONT);
        }
      }
);
    }
    for (    FRect w : filteredFeatures.getRects(Feature.CORNICE)) {
      if (allGeom.contains(w))       g.insert(w,new Griddable(){
        @Override public void instance(        DRectangle rect){
          createInnie(rect,allUV.normalize(rect),to3d,mmb,-0.1f,0,MeshBuilder.ALL_BUT_FRONT);
        }
      }
);
    }
    for (    FRect b : filteredFeatures.get(Feature.BALCONY)) {
      if (allGeom.contains(b))       g.insert(b,new Griddable(){
        @Override public void instance(        DRectangle rect){
          createBalcony(rect,to3d,mbs.get("String_Node_Str" + b.app.color,b.app.color,mf),0.3);
        }
        @Override public boolean noneBehind(){
          return true;
        }
      }
);
    }
    g.instance(new Griddable(){
      @Override public void instance(      DRectangle rect){
        mmb.add(rect,allUV.normalize(rect),to3d);
      }
    }
);
  }
}