Program: 56603
Project: 56603
Buggy source:
@Override public final void freeOccupiedArea(MapShapeFilter occupied,ISPosition2D pos){
  List<ISPosition2D> totallyFreed=partitionsGrid.freeOccupiedArea(occupied,pos);
  if (!totallyFreed.isEmpty()) {
    StopWatch watch=new MilliStopWatch();
    watch.start();
    List<OccupyingBuilding> allOccupying=OccupyingBuilding.getAllOccupyingBuildings();
    int maxSqDistance=6 * CommonConstants.TOWERRADIUS * CommonConstants.TOWERRADIUS;
    List<OccupyingDistanceCombi> occupyingInRange=new LinkedList<OccupyingDistanceCombi>();
    for (    OccupyingBuilding curr : allOccupying) {
      ISPosition2D currPos=curr.getPos();
      int dx=currPos.getX() - pos.getX();
      int dy=currPos.getY() - pos.getY();
      int sqDistance=dx * dx + dy * dy;
      if (sqDistance <= maxSqDistance && sqDistance > 0) {
        occupyingInRange.add(new OccupyingDistanceCombi(sqDistance,curr));
      }
    }
    if (!occupyingInRange.isEmpty()) {
      Collections.sort(occupyingInRange);
      FreeMapArea freedArea=new FreeMapArea(totallyFreed);
      for (      OccupyingDistanceCombi currOcc : occupyingInRange) {
        MapShapeFilter currOccArea=currOcc.building.getOccupyablePositions();
        Iterator<ISPosition2D> iter=freedArea.iterator();
        for (ISPosition2D currPos=iter.next(); iter.hasNext(); currPos=iter.next()) {
          if (currOccArea.contains(currPos)) {
            iter.remove();
            partitionsGrid.occupyAt(currPos.getX(),currPos.getY(),currOcc.building.getPlayer());
          }
        }
        if (freedArea.isEmpty()) {
          break;
        }
      }
    }
    watch.stop("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public final void freeOccupiedArea(MapCircle occupied,ISPosition2D pos){
  List<ISPosition2D> totallyFreed=partitionsGrid.freeOccupiedArea(occupied,pos);
  if (!totallyFreed.isEmpty()) {
    StopWatch watch=new MilliStopWatch();
    watch.start();
    List<OccupyingBuilding> allOccupying=OccupyingBuilding.getAllOccupyingBuildings();
    int maxSqDistance=6 * CommonConstants.TOWERRADIUS * CommonConstants.TOWERRADIUS;
    List<OccupyingDistanceCombi> occupyingInRange=new LinkedList<OccupyingDistanceCombi>();
    for (    OccupyingBuilding curr : allOccupying) {
      ISPosition2D currPos=curr.getPos();
      int dx=currPos.getX() - pos.getX();
      int dy=currPos.getY() - pos.getY();
      int sqDistance=dx * dx + dy * dy;
      if (sqDistance <= maxSqDistance && sqDistance > 0) {
        occupyingInRange.add(new OccupyingDistanceCombi(sqDistance,curr));
      }
    }
    if (!occupyingInRange.isEmpty()) {
      Collections.sort(occupyingInRange);
      FreeMapArea freedArea=new FreeMapArea(totallyFreed);
      for (      OccupyingDistanceCombi currOcc : occupyingInRange) {
        MapCircle currOccArea=currOcc.building.getOccupyablePositions();
        Iterator<ISPosition2D> iter=freedArea.iterator();
        for (ISPosition2D currPos=iter.next(); iter.hasNext(); currPos=iter.next()) {
          if (currOccArea.contains(currPos)) {
            iter.remove();
            partitionsGrid.occupyAt(currPos.getX(),currPos.getY(),currOcc.building.getPlayer());
          }
        }
        if (freedArea.isEmpty()) {
          break;
        }
      }
    }
    watch.stop("String_Node_Str");
  }
}