Program: 56401
Project: 56401
Buggy source:
@Override public final void freeOccupiedArea(MapCircle occupied,ShortPoint2D pos){
  List<ShortPoint2D> totallyFreed=partitionsGrid.freeOccupiedArea(occupied,pos);
  if (!totallyFreed.isEmpty()) {
    StopWatch watch=new MilliStopWatch();
    watch.start();
    int maxSqDistance=6 * CommonConstants.TOWERRADIUS * CommonConstants.TOWERRADIUS;
    List<OccupyingDistanceCombi> occupyingInRange=new LinkedList<OccupyingDistanceCombi>();
    for (    OccupyingBuilding curr : OccupyingBuilding.getAllOccupyingBuildings()) {
      ShortPoint2D 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<ShortPoint2D> iter=freedArea.iterator();
        for (ShortPoint2D currPos=iter.next(); iter.hasNext(); currPos=iter.next()) {
          if (currOccArea.contains(currPos)) {
            iter.remove();
            partitionsGrid.occupyAt(currPos.getX(),currPos.getY(),currOcc.building.getPlayer());
            bordersThread.checkPosition(currPos);
            landmarksCorrection.reTest(currPos.getX(),currPos.getY());
          }
        }
        if (freedArea.isEmpty()) {
          break;
        }
      }
    }
    watch.stop("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public final void freeOccupiedArea(MapCircle occupied,ShortPoint2D pos){
  List<ShortPoint2D> totallyFreed=partitionsGrid.freeOccupiedArea(occupied,pos);
  if (!totallyFreed.isEmpty()) {
    StopWatch watch=new MilliStopWatch();
    watch.start();
    final int maxSqDistance=6 * CommonConstants.TOWERRADIUS * CommonConstants.TOWERRADIUS;
    List<OccupyingDistanceCombi> occupyingInRange=new LinkedList<OccupyingDistanceCombi>();
    for (    OccupyingBuilding curr : OccupyingBuilding.getAllOccupyingBuildings()) {
      ShortPoint2D 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);
      for (      OccupyingDistanceCombi currOcc : occupyingInRange) {
        MapCircle currOccArea=currOcc.building.getOccupyablePositions();
        Iterator<ShortPoint2D> iter=totallyFreed.iterator();
        for (ShortPoint2D currPos=iter.next(); iter.hasNext(); currPos=iter.next()) {
          if (currOccArea.contains(currPos)) {
            iter.remove();
            short x=currPos.getX();
            short y=currPos.getY();
            partitionsGrid.occupyAt(x,y,currOcc.building.getPlayer());
            bordersThread.checkPosition(currPos);
            landmarksCorrection.reTest(x,y);
            destroyBuildingOn(x,y,currOcc.building.getPlayer());
          }
        }
        if (totallyFreed.isEmpty()) {
          break;
        }
      }
    }
    watch.stop("String_Node_Str");
  }
}