Program: 44172
Project: 44172
Buggy source:
private void drawPolygons(){
  for (  Node node : tree.getNodes()) {
    if (!tree.isRoot(node)) {
      if (!tree.isExternal(node)) {
        Integer modality=Utils.getIntegerNodeAttribute(node,coordinatesName + "String_Node_Str" + HPD+ "String_Node_Str");
        for (int i=1; i <= modality; i++) {
          Object[] longitudeHPD=Utils.getArrayNodeAttribute(node,longitudeName + "String_Node_Str" + HPD+ "String_Node_Str"+ i);
          Object[] latitudeHPD=Utils.getArrayNodeAttribute(node,latitudeName + "String_Node_Str" + HPD+ "String_Node_Str"+ i);
          double nodeHeight=tree.getHeight(node);
          int red=(int)Utils.map(nodeHeight,0,treeHeightMax,minPolygonRedMapping,maxPolygonRedMapping);
          int green=(int)Utils.map(nodeHeight,0,treeHeightMax,minPolygonGreenMapping,maxPolygonGreenMapping);
          int blue=(int)Utils.map(nodeHeight,0,treeHeightMax,minPolygonBlueMapping,maxPolygonBlueMapping);
          int alpha=(int)Utils.map(nodeHeight,0,treeHeightMax,maxPolygonOpacityMapping,minPolygonOpacityMapping);
          stroke(red,green,blue,alpha);
          fill(red,green,blue,alpha);
          List<Coordinates> coordinates=Utils.ParsePolygons(longitudeHPD,latitudeHPD);
          beginShape();
          for (int row=0; row < coordinates.size() - 1; row++) {
            float X=map((float)coordinates.get(row).getLongitude(),minX,maxX,0,width);
            float Y=map((float)coordinates.get(row).getLatitude(),maxY,minY,0,height);
            float XEND=map((float)coordinates.get(row + 1).getLongitude(),minX,maxX,0,width);
            float YEND=map((float)(coordinates.get(row + 1).getLatitude()),maxY,minY,0,height);
            vertex(X,Y);
            vertex(XEND,YEND);
          }
          endShape(CLOSE);
        }
      }
    }
  }
}

Fixed version (ground truth):
private void drawPolygons(){
  for (  Node node : tree.getNodes()) {
    if (!tree.isRoot(node)) {
      if (!tree.isExternal(node)) {
        Integer modality=Utils.getIntegerNodeAttribute(node,coordinatesName + "String_Node_Str" + HPD+ "String_Node_Str");
        for (int i=1; i <= modality; i++) {
          Object[] longitudeHPD=Utils.getArrayNodeAttribute(node,longitudeName + "String_Node_Str" + HPD+ "String_Node_Str"+ i);
          Object[] latitudeHPD=Utils.getArrayNodeAttribute(node,latitudeName + "String_Node_Str" + HPD+ "String_Node_Str"+ i);
          double nodeHeight=tree.getHeight(node);
          int red=(int)Utils.map(nodeHeight,0,treeHeightMax,minPolygonRedMapping,maxPolygonRedMapping);
          int green=(int)Utils.map(nodeHeight,0,treeHeightMax,minPolygonGreenMapping,maxPolygonGreenMapping);
          int blue=(int)Utils.map(nodeHeight,0,treeHeightMax,minPolygonBlueMapping,maxPolygonBlueMapping);
          int alpha=(int)Utils.map(nodeHeight,0,treeHeightMax,maxPolygonOpacityMapping,minPolygonOpacityMapping);
          stroke(red,green,blue,alpha);
          fill(red,green,blue,alpha);
          List<Coordinates> coordinates=Utils.ParsePolygons(longitudeHPD,latitudeHPD);
          beginShape();
          for (int row=0; row < coordinates.size() - 1; row++) {
            double X=Utils.map(coordinates.get(row).getLongitude(),minX,maxX,0,width);
            double Y=Utils.map(coordinates.get(row).getLatitude(),maxY,minY,0,height);
            double XEND=Utils.map(coordinates.get(row + 1).getLongitude(),minX,maxX,0,width);
            double YEND=Utils.map((coordinates.get(row + 1).getLatitude()),maxY,minY,0,height);
            vertex((float)X,(float)Y);
            vertex((float)XEND,(float)YEND);
          }
          endShape(CLOSE);
        }
      }
    }
  }
}