Program: 68954
Project: 68954
Buggy source:
/** 
 * Draw move numbers and/or mark the last played move
 */
private void drawMoveNumbers(Graphics2D g){
  g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
  int[] lastMove=Lizzie.board.getLastMove();
  int lastMoveNumber=Lizzie.board.getData().getMoveNumber();
  if (!Lizzie.board.isInTryPlayState() && (!Lizzie.optionSetting.isShowMoveNumber() || branch != null) || Lizzie.board.isInTryPlayState() && lastMoveNumber <= Lizzie.board.getTryPlayStateBeginMoveNumber()) {
    if (lastMove != null) {
      int lastMoveMarkerRadius=stoneRadius / 2;
      int stoneX=x + scaledMargin + squareLength * lastMove[0];
      int stoneY=y + scaledMargin + squareLength * lastMove[1];
      g.setColor(Lizzie.board.getStones()[Board.getIndex(lastMove[0],lastMove[1])].isWhite() ? Color.BLACK : Color.WHITE);
      drawCircle(g,stoneX,stoneY,lastMoveMarkerRadius);
    }
 else     if (lastMoveNumber != 0) {
      g.setColor(Lizzie.board.getData().isBlackToPlay() ? new Color(255,255,255,150) : new Color(0,0,0,150));
      g.fillOval(x + boardLength / 2 - 4 * stoneRadius,y + boardLength / 2 - 4 * stoneRadius,stoneRadius * 8,stoneRadius * 8);
      g.setColor(Lizzie.board.getData().isBlackToPlay() ? new Color(0,0,0,255) : new Color(255,255,255,255));
      drawString(g,x + boardLength / 2,y + boardLength / 2,"String_Node_Str","String_Node_Str",stoneRadius * 4,stoneRadius * 6);
    }
  }
  if (!Lizzie.board.isInTryPlayState() && Lizzie.optionSetting.isShowMoveNumber() && branch == null || Lizzie.board.isInTryPlayState()) {
    int[] moveNumberList=Lizzie.board.getMoveNumberList();
    int moveNumberBaseFix=0;
    if (Lizzie.board.isInTryPlayState()) {
      moveNumberBaseFix=Lizzie.board.getTryPlayStateBeginMoveNumber();
    }
    for (int i=0; i < Board.BOARD_SIZE; i++) {
      for (int j=0; j < Board.BOARD_SIZE; j++) {
        int stoneX=x + scaledMargin + squareLength * i;
        int stoneY=y + scaledMargin + squareLength * j;
        int index=Board.getIndex(i,j);
        if (lastMoveNumber - moveNumberList[index] > Lizzie.optionSetting.getNumberOfLastMovesShown()) {
          continue;
        }
        Stone stoneAtThisPoint=Lizzie.board.getStones()[index];
        if (moveNumberList[index] - moveNumberBaseFix > 0) {
          if (lastMove != null && i == lastMove[0] && j == lastMove[1])           g.setColor(Color.RED.brighter());
 else           g.setColor(stoneAtThisPoint.isBlack() ? Color.WHITE : Color.BLACK);
          String moveNumberString=String.valueOf(moveNumberList[index] - moveNumberBaseFix);
          drawString(g,stoneX,stoneY,"String_Node_Str",moveNumberString,(float)(stoneRadius * 1.4),(int)(stoneRadius * 1.4));
        }
      }
    }
    if (lastMove == null && lastMoveNumber != 0 && lastMoveNumber - moveNumberBaseFix >= 0) {
      g.setColor(Lizzie.board.getData().isBlackToPlay() ? new Color(255,255,255,150) : new Color(0,0,0,150));
      g.fillOval(x + boardLength / 2 - 4 * stoneRadius,y + boardLength / 2 - 4 * stoneRadius,stoneRadius * 8,stoneRadius * 8);
      g.setColor(Color.RED);
      drawString(g,x + boardLength / 2,y + boardLength / 2,"String_Node_Str",Font.PLAIN,String.valueOf(lastMoveNumber - moveNumberBaseFix),stoneRadius * 4,stoneRadius * 6,1);
      g.setColor(Lizzie.board.getData().isBlackToPlay() ? new Color(0,0,0,255) : new Color(255,255,255,255));
      drawString(g,x + boardLength / 2,y + boardLength / 2 + stoneRadius,"String_Node_Str","String_Node_Str",stoneRadius * 4,stoneRadius * 6);
    }
  }
  if (branch != null) {
    int variationBase=0;
    if (Lizzie.board.isInTryPlayState()) {
      variationBase=lastMoveNumber - Lizzie.board.getTryPlayStateBeginMoveNumber();
      if (variationBase < 0) {
        variationBase=0;
      }
    }
    int nextVariationNumber=0;
    if (Lizzie.board.isInTryPlayState()) {
      nextVariationNumber=variationBase;
    }
    Stone nextStone=Lizzie.board.getData().getLastMoveColor();
    if (nextStone == Stone.EMPTY) {
      nextStone=Stone.WHITE;
    }
    for (    String move : branch.getVariation()) {
      ++nextVariationNumber;
      nextStone=nextStone.opposite();
      if (nextVariationNumber == variationBase + 1) {
        continue;
      }
      if (nextVariationNumber - variationBase > Lizzie.optionSetting.getVariationLimit()) {
        break;
      }
      int[] coords=Board.convertNameToCoordinates(move);
      int i=coords[0], j=coords[1];
      if (Board.isValid(i,j)) {
        int stoneX=x + scaledMargin + squareLength * i;
        int stoneY=y + scaledMargin + squareLength * j;
        g.setColor(nextStone.equals(Stone.BLACK) ? Color.WHITE : Color.BLACK);
        String moveNumberString=String.valueOf(nextVariationNumber);
        drawString(g,stoneX,stoneY,"String_Node_Str",moveNumberString,(float)(stoneRadius * 1.4),(int)(stoneRadius * 1.4));
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Draw move numbers and/or mark the last played move
 */
private void drawMoveNumbers(Graphics2D g){
  g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
  int[] lastMove=Lizzie.board.getLastMove();
  int lastMoveNumber=Lizzie.board.getData().getMoveNumber();
  if (!Lizzie.board.isInTryPlayState() && (!Lizzie.optionSetting.isShowMoveNumber() || branch != null) || Lizzie.board.isInTryPlayState() && lastMoveNumber <= Lizzie.board.getTryPlayStateBeginMoveNumber()) {
    if (lastMove != null) {
      int lastMoveMarkerRadius=stoneRadius / 2;
      int stoneX=x + scaledMargin + squareLength * lastMove[0];
      int stoneY=y + scaledMargin + squareLength * lastMove[1];
      g.setColor(Lizzie.board.getStones()[Board.getIndex(lastMove[0],lastMove[1])].isWhite() ? Color.BLACK : Color.WHITE);
      drawCircle(g,stoneX,stoneY,lastMoveMarkerRadius);
    }
 else     if (lastMoveNumber != 0) {
      g.setColor(Lizzie.board.getData().isBlackToPlay() ? new Color(255,255,255,150) : new Color(0,0,0,150));
      g.fillOval(x + boardLength / 2 - 4 * stoneRadius,y + boardLength / 2 - 4 * stoneRadius,stoneRadius * 8,stoneRadius * 8);
      g.setColor(Lizzie.board.getData().isBlackToPlay() ? new Color(0,0,0,255) : new Color(255,255,255,255));
      drawString(g,x + boardLength / 2,y + boardLength / 2,"String_Node_Str","String_Node_Str",stoneRadius * 4,stoneRadius * 6);
    }
  }
  if (!Lizzie.board.isInTryPlayState() && Lizzie.optionSetting.isShowMoveNumber() && branch == null || Lizzie.board.isInTryPlayState()) {
    int[] moveNumberList=Lizzie.board.getMoveNumberList();
    int moveNumberBaseFix=0;
    if (Lizzie.board.isInTryPlayState()) {
      moveNumberBaseFix=Lizzie.board.getTryPlayStateBeginMoveNumber();
    }
    for (int i=0; i < Board.BOARD_SIZE; i++) {
      for (int j=0; j < Board.BOARD_SIZE; j++) {
        int stoneX=x + scaledMargin + squareLength * i;
        int stoneY=y + scaledMargin + squareLength * j;
        int index=Board.getIndex(i,j);
        if (lastMoveNumber - moveNumberList[index] >= Lizzie.optionSetting.getNumberOfLastMovesShown()) {
          continue;
        }
        Stone stoneAtThisPoint=Lizzie.board.getStones()[index];
        if (moveNumberList[index] - moveNumberBaseFix > 0) {
          if (lastMove != null && i == lastMove[0] && j == lastMove[1])           g.setColor(Color.RED.brighter());
 else           g.setColor(stoneAtThisPoint.isBlack() ? Color.WHITE : Color.BLACK);
          String moveNumberString=String.valueOf(moveNumberList[index] - moveNumberBaseFix);
          drawString(g,stoneX,stoneY,"String_Node_Str",moveNumberString,(float)(stoneRadius * 1.4),(int)(stoneRadius * 1.4));
        }
      }
    }
    if (lastMove == null && lastMoveNumber != 0 && lastMoveNumber - moveNumberBaseFix >= 0) {
      g.setColor(Lizzie.board.getData().isBlackToPlay() ? new Color(255,255,255,150) : new Color(0,0,0,150));
      g.fillOval(x + boardLength / 2 - 4 * stoneRadius,y + boardLength / 2 - 4 * stoneRadius,stoneRadius * 8,stoneRadius * 8);
      g.setColor(Color.RED);
      drawString(g,x + boardLength / 2,y + boardLength / 2,"String_Node_Str",Font.PLAIN,String.valueOf(lastMoveNumber - moveNumberBaseFix),stoneRadius * 4,stoneRadius * 6,1);
      g.setColor(Lizzie.board.getData().isBlackToPlay() ? new Color(0,0,0,255) : new Color(255,255,255,255));
      drawString(g,x + boardLength / 2,y + boardLength / 2 + stoneRadius,"String_Node_Str","String_Node_Str",stoneRadius * 4,stoneRadius * 6);
    }
  }
  if (branch != null) {
    int variationBase=0;
    if (Lizzie.board.isInTryPlayState()) {
      variationBase=lastMoveNumber - Lizzie.board.getTryPlayStateBeginMoveNumber();
      if (variationBase < 0) {
        variationBase=0;
      }
    }
    int nextVariationNumber=0;
    if (Lizzie.board.isInTryPlayState()) {
      nextVariationNumber=variationBase;
    }
    Stone nextStone=Lizzie.board.getData().getLastMoveColor();
    if (nextStone == Stone.EMPTY) {
      nextStone=Stone.WHITE;
    }
    for (    String move : branch.getVariation()) {
      ++nextVariationNumber;
      nextStone=nextStone.opposite();
      if (nextVariationNumber == variationBase + 1) {
        continue;
      }
      if (nextVariationNumber - variationBase > Lizzie.optionSetting.getVariationLimit()) {
        break;
      }
      int[] coords=Board.convertNameToCoordinates(move);
      int i=coords[0], j=coords[1];
      if (Board.isValid(i,j)) {
        int stoneX=x + scaledMargin + squareLength * i;
        int stoneY=y + scaledMargin + squareLength * j;
        g.setColor(nextStone.equals(Stone.BLACK) ? Color.WHITE : Color.BLACK);
        String moveNumberString=String.valueOf(nextVariationNumber);
        drawString(g,stoneX,stoneY,"String_Node_Str",moveNumberString,(float)(stoneRadius * 1.4),(int)(stoneRadius * 1.4));
      }
    }
  }
}