Program: 55758
Project: 55758
Buggy source:
public static boolean traverseBorder(final IContainingProvider containingProvider,final ShortPoint2D startPos,final ITraversingVisitor visitor,boolean visitOutside){
  return traverseBorder(containingProvider,startPos,visitor,visitOutside,new MutableInt());
}

Fixed version (ground truth):
/** 
 * Traverses the border of an area defined by the given   {@link IContainingProvider} starting at the two neighbors insideStartPosition andoutsideStartPosition. The given visitor is called for every position on the outside of the area.<br>
 * @param containingProvider {@link IContainingProvider} defining the position that are in and the ones that are outside the area.
 * @param insideStartPosition The inside start position for the traversing. This position must be in the area but at the border!
 * @param outsideStartPosition The outside start position for the traversing. This position must be outside the area but at the border and a direct neighbor of insideStartPosition
 * @param visitor The visitor that will be called for every border position (a border position is a position outside the border!).
 * @param visitOutside If true the positions on the outside will be visited.<br> If false the inside positions will be visited.
 * @param traversedPositions This object will contain the number of traversed positions after the call.
 * @return true if the whole border has been traversed.<br>false if the traversing has been canceled by the  {@link IBorderVisitor}'s visit() method.
 */
public static boolean traverseBorder(IContainingProvider containingProvider,ShortPoint2D insideStartPosition,ShortPoint2D outsideStartPosition,final IBorderVisitor visitor,boolean visitOutside,MutableInt traversedPositions){
  final int startInsideX=insideStartPosition.x;
  final int startInsideY=insideStartPosition.y;
  final int startOutsideX=outsideStartPosition.x;
  final int startOutsideY=outsideStartPosition.y;
  if (!visitor.visit(startInsideX,startInsideY,startOutsideX,startOutsideY)) {
    traversedPositions.value=1;
    return false;
  }
  int insideX=startInsideX;
  int insideY=startInsideY;
  int outsideX=startOutsideX;
  int outsideY=startOutsideY;
  int traversedPositionsCounter=1;
  do {
    traversedPositionsCounter++;
    EDirection outInDir=EDirection.getDirection(insideX - outsideX,insideY - outsideY);
    EDirection neighborDir=outInDir.getNeighbor(-1);
    int neighborX=neighborDir.gridDeltaX + outsideX;
    int neighborY=neighborDir.gridDeltaY + outsideY;
    if (containingProvider.contains(neighborX,neighborY)) {
      insideX=neighborX;
      insideY=neighborY;
      if (!visitOutside && !visitor.visit(insideX,insideY,outsideX,outsideY)) {
        traversedPositions.value=traversedPositionsCounter;
        return false;
      }
    }
 else {
      outsideX=neighborX;
      outsideY=neighborY;
      if (visitOutside && !visitor.visit(insideX,insideY,outsideX,outsideY)) {
        traversedPositions.value=traversedPositionsCounter;
        return false;
      }
    }
  }
 while (insideX != startInsideX || insideY != startInsideY || outsideX != startOutsideX || outsideY != startOutsideY);
  traversedPositions.value=traversedPositionsCounter;
  return true;
}