Program: 40141
Project: 40141
Buggy source:
public void findPath(){
  Vector<DijkstraNode> nodeVector=new Vector<DijkstraNode>();
  DijkstraNode startNode=new DijkstraNode(rover.getStartPosition());
  DijkstraNode goalNode=new DijkstraNode(rover.getEndPosition());
  int startX=startNode.getPosition().getX();
  int startY=startNode.getPosition().getY();
  int goalX=goalNode.getPosition().getX();
  int goalY=goalNode.getPosition().getY();
  int yRange=Math.abs(goalY - startY);
  int xRange=Math.abs(goalX - startX);
  int halfYRange=yRange / 2;
  int halfXRange=xRange / 2;
  int bufferStartY;
  int bufferStartX;
  int bufferGoalY;
  int bufferGoalX;
  if (startX < goalX) {
    bufferStartX=startX - halfXRange;
    bufferGoalX=goalX + halfXRange;
    if (startY < goalY) {
      bufferStartY=startY - halfYRange;
      bufferGoalY=goalY + halfYRange;
      for (int y=bufferStartY; y <= bufferGoalY; y++) {
        for (int x=bufferStartX; x <= bufferGoalX; x++) {
          Coordinate tmpCoordinate=new Coordinate(x,y);
          DijkstraNode tmpNode=new DijkstraNode(tmpCoordinate);
          tmpNode.setDistanceFromStart(Double.POSITIVE_INFINITY);
          tmpNode.setParent(null);
          nodeVector.add(tmpNode);
        }
      }
    }
 else {
      bufferStartY=startY + halfYRange;
      bufferGoalY=goalY - halfYRange;
      for (int y=bufferGoalY; y <= bufferStartY; y++) {
        for (int x=bufferStartX; x <= bufferGoalX; x++) {
          Coordinate tmpCoordinate=new Coordinate(x,y);
          DijkstraNode tmpNode=new DijkstraNode(tmpCoordinate);
          tmpNode.setDistanceFromStart(Double.POSITIVE_INFINITY);
          tmpNode.setParent(null);
          nodeVector.add(tmpNode);
        }
      }
    }
  }
 else {
    System.out.println("String_Node_Str");
    bufferStartX=startX + halfXRange;
    bufferGoalX=goalX - halfXRange;
    if (startY < goalY) {
      System.out.println("String_Node_Str");
      bufferStartY=startY - halfYRange;
      bufferGoalY=goalY + halfYRange;
      for (int y=bufferStartY; y <= bufferGoalY; y++) {
        for (int x=bufferGoalX; x <= bufferStartX; x++) {
          Coordinate tmpCoordinate=new Coordinate(x,y);
          DijkstraNode tmpNode=new DijkstraNode(tmpCoordinate);
          tmpNode.setDistanceFromStart(Double.POSITIVE_INFINITY);
          tmpNode.setParent(null);
          nodeVector.add(tmpNode);
        }
      }
    }
 else {
      bufferStartY=startY + halfYRange;
      bufferGoalY=goalY - halfYRange;
      for (int y=bufferGoalY; y <= bufferStartY; y++) {
        for (int x=bufferGoalX; x <= bufferStartX; x++) {
          Coordinate tmpCoordinate=new Coordinate(x,y);
          DijkstraNode tmpNode=new DijkstraNode(tmpCoordinate);
          tmpNode.setDistanceFromStart(Double.POSITIVE_INFINITY);
          tmpNode.setParent(null);
          nodeVector.add(tmpNode);
          System.out.println("String_Node_Str");
        }
      }
    }
  }
  for (int i=0; i < nodeVector.size(); i++) {
    if (nodeVector.get(i).getPosition().getX() == startX && nodeVector.get(i).getPosition().getY() == startY) {
      nodeVector.get(i).setDistanceFromStart(0);
    }
  }
  while (!nodeVector.isEmpty()) {
    boolean goalFound=false;
    DijkstraNode minNode=getClosestNode(nodeVector);
    if (minNode.getPosition().getX() == Integer.MAX_VALUE) {
      break;
    }
    removeNodeFromVector(nodeVector,minNode);
    List<DijkstraNode> neighborList=minNode.getNeighbors();
    for (int i=0; i < neighborList.size(); i++) {
      DijkstraNode currentNode=neighborList.get(i);
      int currentX=currentNode.getPosition().getX();
      int currentY=currentNode.getPosition().getY();
      boolean inVector=false;
      for (      DijkstraNode nVec : nodeVector) {
        if (neighborList.get(i).getPosition().getX() == nVec.getPosition().getX() && neighborList.get(i).getPosition().getY() == nVec.getPosition().getY()) {
          inVector=true;
        }
      }
      if (inVector) {
        System.out.println("String_Node_Str");
        double totalDist=minNode.getDistanceFromStart() + minNode.distBetween(neighborList.get(i));
        if (totalDist < neighborList.get(i).getDistanceFromStart()) {
          for (int q=0; q < nodeVector.size(); q++) {
            if (nodeVector.get(q).getPosition().getX() == currentX && nodeVector.get(q).getPosition().getY() == currentY) {
              if (rover.canTraverse(minNode.getPosition(),currentNode.getPosition())) {
                nodeVector.get(q).setDistanceFromStart(totalDist);
                nodeVector.get(q).setParent(minNode);
              }
            }
          }
        }
      }
      if (neighborList.get(i).currentIsGoal(goalNode)) {
        for (int q=0; q < nodeVector.size(); q++) {
          if (nodeVector.get(q).getPosition().getX() == neighborList.get(i).getPosition().getX() && nodeVector.get(q).getPosition().getY() == neighborList.get(i).getPosition().getY()) {
            List<Coordinate> tmpList=nodeVector.get(q).constructPath();
            fullPath=new ArrayList<Coordinate>(tmpList);
            goalFound=true;
          }
        }
      }
    }
    if (goalFound) {
      break;
    }
  }
  Collections.reverse(fullPath);
  output=new TerminalOutput(fullPath);
}

Fixed version (ground truth):
public void findPath(){
  Vector<DijkstraNode> nodeVector=new Vector<DijkstraNode>();
  DijkstraNode startNode=new DijkstraNode(rover.getStartPosition());
  DijkstraNode goalNode=new DijkstraNode(rover.getEndPosition());
  int startX=startNode.getPosition().getX();
  int startY=startNode.getPosition().getY();
  int goalX=goalNode.getPosition().getX();
  int goalY=goalNode.getPosition().getY();
  int yRange=Math.abs(goalY - startY);
  int xRange=Math.abs(goalX - startX);
  int halfYRange=yRange / 2;
  int halfXRange=xRange / 2;
  int bufferStartY;
  int bufferStartX;
  int bufferGoalY;
  int bufferGoalX;
  if (startX < goalX) {
    bufferStartX=startX - halfXRange;
    bufferGoalX=goalX + halfXRange;
    if (startY < goalY) {
      bufferStartY=startY - halfYRange;
      bufferGoalY=goalY + halfYRange;
      for (int y=bufferStartY; y <= bufferGoalY; y++) {
        for (int x=bufferStartX; x <= bufferGoalX; x++) {
          Coordinate tmpCoordinate=new Coordinate(x,y);
          DijkstraNode tmpNode=new DijkstraNode(tmpCoordinate);
          tmpNode.setDistanceFromStart(Double.POSITIVE_INFINITY);
          tmpNode.setParent(null);
          nodeVector.add(tmpNode);
        }
      }
    }
 else {
      bufferStartY=startY + halfYRange;
      bufferGoalY=goalY - halfYRange;
      for (int y=bufferGoalY; y <= bufferStartY; y++) {
        for (int x=bufferStartX; x <= bufferGoalX; x++) {
          Coordinate tmpCoordinate=new Coordinate(x,y);
          DijkstraNode tmpNode=new DijkstraNode(tmpCoordinate);
          tmpNode.setDistanceFromStart(Double.POSITIVE_INFINITY);
          tmpNode.setParent(null);
          nodeVector.add(tmpNode);
        }
      }
    }
  }
 else {
    System.out.println("String_Node_Str");
    bufferStartX=startX + halfXRange;
    bufferGoalX=goalX - halfXRange;
    if (startY < goalY) {
      System.out.println("String_Node_Str");
      bufferStartY=startY - halfYRange;
      bufferGoalY=goalY + halfYRange;
      for (int y=bufferStartY; y <= bufferGoalY; y++) {
        for (int x=bufferGoalX; x <= bufferStartX; x++) {
          Coordinate tmpCoordinate=new Coordinate(x,y);
          DijkstraNode tmpNode=new DijkstraNode(tmpCoordinate);
          tmpNode.setDistanceFromStart(Double.POSITIVE_INFINITY);
          tmpNode.setParent(null);
          nodeVector.add(tmpNode);
        }
      }
    }
 else {
      bufferStartY=startY + halfYRange;
      bufferGoalY=goalY - halfYRange;
      for (int y=bufferGoalY; y <= bufferStartY; y++) {
        for (int x=bufferGoalX; x <= bufferStartX; x++) {
          Coordinate tmpCoordinate=new Coordinate(x,y);
          DijkstraNode tmpNode=new DijkstraNode(tmpCoordinate);
          tmpNode.setDistanceFromStart(Double.POSITIVE_INFINITY);
          tmpNode.setParent(null);
          nodeVector.add(tmpNode);
          System.out.println("String_Node_Str");
        }
      }
    }
  }
  for (int i=0; i < nodeVector.size(); i++) {
    if (nodeVector.get(i).getPosition().getX() == startX && nodeVector.get(i).getPosition().getY() == startY) {
      nodeVector.get(i).setDistanceFromStart(0);
    }
  }
  while (!nodeVector.isEmpty()) {
    boolean goalFound=false;
    DijkstraNode minNode=getClosestNode(nodeVector);
    if (minNode.getPosition().getX() == Integer.MAX_VALUE) {
      break;
    }
    removeNodeFromVector(nodeVector,minNode);
    List<DijkstraNode> neighborList=minNode.getNeighbors();
    for (int i=0; i < neighborList.size(); i++) {
      DijkstraNode currentNode=neighborList.get(i);
      int currentX=currentNode.getPosition().getX();
      int currentY=currentNode.getPosition().getY();
      boolean inVector=false;
      for (      DijkstraNode nVec : nodeVector) {
        if (neighborList.get(i).getPosition().getX() == nVec.getPosition().getX() && neighborList.get(i).getPosition().getY() == nVec.getPosition().getY()) {
          inVector=true;
        }
      }
      if (inVector) {
        System.out.println("String_Node_Str");
        double totalDist=minNode.getDistanceFromStart() + minNode.distBetween(neighborList.get(i));
        if (totalDist < neighborList.get(i).getDistanceFromStart()) {
          for (int q=0; q < nodeVector.size(); q++) {
            if (nodeVector.get(q).getPosition().getX() == currentX && nodeVector.get(q).getPosition().getY() == currentY) {
              if (rover.canTraverse(minNode.getPosition(),currentNode.getPosition())) {
                nodeVector.get(q).setDistanceFromStart(totalDist);
                nodeVector.get(q).setParent(minNode);
              }
            }
          }
        }
      }
      if (neighborList.get(i).currentIsGoal(goalNode)) {
        for (int q=0; q < nodeVector.size(); q++) {
          if (nodeVector.get(q).getPosition().getX() == neighborList.get(i).getPosition().getX() && nodeVector.get(q).getPosition().getY() == neighborList.get(i).getPosition().getY()) {
            List<Coordinate> tmpList=nodeVector.get(q).constructPath();
            fullPath=new ArrayList<Coordinate>(tmpList);
            goalFound=true;
          }
        }
      }
    }
    if (goalFound) {
      break;
    }
  }
  Collections.reverse(fullPath);
  output=new TerminalOutput(fullPath);
  output=new MapImageOutput(fullPath,map.getMapPath());
}