Program: 56608
Project: 56608
Buggy source:
public final List<ISPosition2D> occupyArea(MapShapeFilter toBeOccupied,ISPosition2D occupiersPosition,byte newPlayer){
  changePlayerAt(occupiersPosition.getX(),occupiersPosition.getY(),newPlayer);
  short newPartition=getPartition(occupiersPosition);
  List<ISPosition2D> occupiedPositions=new ArrayList<ISPosition2D>();
  for (  ISPosition2D curr : toBeOccupied) {
    short x=curr.getX();
    short y=curr.getY();
    short partitionAt=getPartitionAt(x,y);
    if (partitionAt != newPartition && towers[x][y] <= 0) {
      if (partitionAt < 0) {
        setPartition(x,y,newPartition);
        occupiedPositions.add(curr);
      }
 else       if (partitionObjects[partitionAt].getPlayer() == newPlayer) {
        newPartition=this.mergePartitions(x,y,occupiersPosition.getX(),occupiersPosition.getY());
      }
 else {
        occupiedPositions.add(curr);
        this.partitionsAlgorithm.calculateNewPartition(x,y,newPlayer);
      }
    }
    if (getPlayerAt(x,y) == newPlayer) {
      towers[x][y]++;
    }
  }
  return occupiedPositions;
}

Fixed version (ground truth):
public final List<ISPosition2D> occupyArea(MapCircle toBeOccupied,ISPosition2D occupiersPosition,byte newPlayer){
  MilliStopWatch watch=new MilliStopWatch();
  watch.start();
  changePlayerAt(occupiersPosition.getX(),occupiersPosition.getY(),newPlayer);
  short newPartition=getPartition(occupiersPosition);
  List<ISPosition2D> occupiedPositions=new ArrayList<ISPosition2D>();
  List<ISPosition2D> checkForMerge=new ArrayList<ISPosition2D>();
  ISPosition2D unblockedOccupied=null;
  for (  ISPosition2D curr : toBeOccupied) {
    short x=curr.getX();
    short y=curr.getY();
    if (!isInBounds(x,y)) {
      continue;
    }
    short currPartition=getPartitionAt(x,y);
    if (currPartition != newPartition) {
      if (towers[x][y] <= 0) {
        if (currPartition < 0) {
          setPartition(x,y,newPartition);
          occupiedPositions.add(curr);
          if (unblockedOccupied == null && !grid.isBlocked(x,y)) {
            unblockedOccupied=curr;
          }
        }
 else         if (partitionObjects[currPartition].getPlayer() == newPlayer) {
          checkForMerge.add(curr);
        }
      }
 else {
        if (partitionObjects[currPartition].getPlayer() == newPlayer) {
          checkForMerge.add(curr);
        }
      }
    }
    if (getPlayerAt(x,y) == newPlayer) {
      towers[x][y]++;
      for (      ISPosition2D neighbor : new MapNeighboursArea(curr)) {
        if (isInBounds(neighbor) && !toBeOccupied.contains(neighbor)) {
          checkForMerge.add(neighbor);
        }
      }
    }
  }
  ISPosition2D[] foundPartions=new ISPosition2D[partitionObjects.length];
  for (  ISPosition2D curr : checkForMerge) {
    foundPartions[getPartition(curr) + 1]=curr;
  }
  for (short i=0; i < foundPartions.length; i++) {
    ISPosition2D pos=foundPartions[i];
    if (pos != null && (i - 1) != newPartition) {
      if (getPartitionObject((short)(i - 1)).getPlayer() == newPlayer) {
        this.mergePartitions(pos.getX(),pos.getY(),unblockedOccupied.getX(),unblockedOccupied.getY());
      }
    }
  }
  watch.stop("String_Node_Str");
  return occupiedPositions;
}