Program: 56135
Project: 56135
Buggy source:
public void calculateConstructMarks(final MapRectangle mapArea,final BuildingAreaBitSet buildingArea,final ELandscapeType[] landscapeTypes,RelativePoint[] flattenPositions){
  if (lastArea != null) {
    removeConstructionMarks(lastArea,mapArea);
  }
  final short[] xJumps=buildingArea.xJumps;
  final short[] yJumps=buildingArea.yJumps;
  final int lineLength=mapArea.getLineLength() + mapArea.getHeight() / 2;
  final BitSet doneSet=new BitSet(lineLength * mapArea.getHeight());
  final int xOffsetForBuilding=buildingArea.minX;
  final int yOffsetForBuilding=buildingArea.minY;
  final int buildingAreaWidth=buildingArea.width;
  final int buildingAreaHeight=buildingArea.height;
  for (int line=0; line < mapArea.getHeight(); line++) {
    final int y=mapArea.getLineY(line);
    final int xLineOffset=mapArea.getMinX();
    DX_LOOP:     for (int dx=0; dx < lineLength; dx++) {
      final int x=xLineOffset + dx;
      if (!mapArea.contains(x,y) || doneSet.get(dx + line * lineLength)) {
        continue;
      }
      for (int buildingDx=buildingAreaWidth - 1; buildingDx >= 0; buildingDx--) {
        for (int buildingDy=buildingAreaHeight - 1; buildingDy >= 0; buildingDy--) {
          int index=buildingDx + buildingDy * buildingAreaWidth;
          if (xJumps[index] != 0 && !map.canUsePositionForConstruction(x + buildingDx + xOffsetForBuilding,y + buildingDy + yOffsetForBuilding,landscapeTypes,player)) {
            map.setConstructMarking(x,y,false,null);
            for (int pruneX=0; pruneX < xJumps[index]; pruneX++) {
              int currYJumps=yJumps[(buildingDx - pruneX) + buildingDy * buildingAreaWidth];
              for (int pruneY=0; pruneY < currYJumps; pruneY++) {
                if (pruneY == 0 && pruneX == 0) {
                  continue;
                }
                doneSet.set((dx + pruneX) + (line + pruneY) * lineLength);
                map.setConstructMarking(x + pruneX,y + pruneY,false,null);
              }
            }
            continue DX_LOOP;
          }
        }
      }
      map.setConstructMarking(x,y,true,flattenPositions);
    }
  }
  lastArea=mapArea;
}

Fixed version (ground truth):
public void calculateConstructMarks(final MapRectangle mapArea,final BuildingAreaBitSet buildingArea,final ELandscapeType[] landscapeTypes,RelativePoint[] flattenPositions){
  if (lastArea != null) {
    removeConstructionMarks(lastArea,mapArea);
  }
  final short[] xJumps=buildingArea.xJumps;
  final short[] yJumps=buildingArea.yJumps;
  final int lineLength=mapArea.getLineLength() + mapArea.getHeight() / 2;
  final BitSet doneSet=new BitSet(lineLength * mapArea.getHeight());
  final int xOffsetForBuilding=buildingArea.minX;
  final int yOffsetForBuilding=buildingArea.minY;
  final int buildingAreaWidth=buildingArea.width;
  final int buildingAreaHeight=buildingArea.height;
  for (int line=0; line < mapArea.getHeight(); line++) {
    final int y=mapArea.getLineY(line);
    final int xLineOffset=mapArea.getMinX();
    DX_LOOP:     for (int dx=0; dx < lineLength; dx++) {
      final int x=xLineOffset + dx;
      final short partitionId;
{
        int firstPosX=buildingArea.aPosition.calculateX(x);
        int firstPosY=buildingArea.aPosition.calculateY(y);
        partitionId=map.getPartitionIdAt(firstPosX,firstPosY);
        if (!map.canPlayerConstructOnPartition(playerId,partitionId)) {
          continue DX_LOOP;
        }
      }
      if (!mapArea.contains(x,y) || doneSet.get(dx + line * lineLength)) {
        continue;
      }
      for (int buildingDx=buildingAreaWidth - 1; buildingDx >= 0; buildingDx--) {
        for (int buildingDy=buildingAreaHeight - 1; buildingDy >= 0; buildingDy--) {
          int index=buildingDx + buildingDy * buildingAreaWidth;
          if (xJumps[index] != 0 && !map.canUsePositionForConstruction(x + buildingDx + xOffsetForBuilding,y + buildingDy + yOffsetForBuilding,landscapeTypes,partitionId)) {
            map.setConstructMarking(x,y,false,null);
            for (int pruneX=0; pruneX < xJumps[index]; pruneX++) {
              int currYJumps=yJumps[(buildingDx - pruneX) + buildingDy * buildingAreaWidth];
              for (int pruneY=0; pruneY < currYJumps; pruneY++) {
                if (pruneY == 0 && pruneX == 0) {
                  continue;
                }
                doneSet.set((dx + pruneX) + (line + pruneY) * lineLength);
                map.setConstructMarking(x + pruneX,y + pruneY,false,null);
              }
            }
            continue DX_LOOP;
          }
        }
      }
      map.setConstructMarking(x,y,true,flattenPositions);
    }
  }
  lastArea=mapArea;
}