nus-yam/ex-repair huggingface dataset:
Program: 171429
Project: 171429
Buggy source:
@Override public void paintComponent(Graphics g){
  super.paintComponent(g);
  Graphics2D g2d=(Graphics2D)g;
  int w=canvasWidth / data.M();
  int h=canvasHeight / data.N();
  Board showBoard=data.getShowBoard();
  for (int i=0; i < showBoard.N(); i++)   for (int j=0; j < showBoard.M(); j++) {
    char c=showBoard.getData(i,j);
    if (c != Board.EMPTY) {
      if (!colorMap.containsKey(c)) {
        int sz=colorMap.size();
        colorMap.put(c,colorList.get(sz));
      }
      Color color=colorMap.get(c);
      AlgoVisHelper.setColor(g2d,color);
      AlgoVisHelper.fillRectangle(g2d,j * h + 2,i * w + 2,w - 4,h - 4);
      AlgoVisHelper.setColor(g2d,AlgoVisHelper.White);
      String text=String.format("String_Node_Str",i,j);
      AlgoVisHelper.drawText(g2d,text,j * h + h / 2,i * w + w / 2);
    }
  }
}

Fixed version (ground truth):
@Override public void paintComponent(Graphics g){
  super.paintComponent(g);
  Graphics2D g2d=(Graphics2D)g;
  int w=canvasWidth / data.M();
  int h=canvasHeight / data.N();
  Board showBoard=data.getShowBoard();
  for (int i=0; i < showBoard.N(); i++)   for (int j=0; j < showBoard.M(); j++) {
    char c=showBoard.getData(i,j);
    if (c != Board.EMPTY) {
      if (!colorMap.containsKey(c)) {
        int sz=colorMap.size();
        colorMap.put(c,colorList.get(sz));
      }
      Color color=colorMap.get(c);
      AlgoVisHelper.setColor(g2d,color);
      AlgoVisHelper.fillRectangle(g2d,j * w + 2,i * h + 2,w - 4,h - 4);
      AlgoVisHelper.setColor(g2d,AlgoVisHelper.White);
      String text=String.format("String_Node_Str",i,j);
      AlgoVisHelper.drawText(g2d,text,j * h + h / 2,i * w + w / 2);
    }
  }
}
Program: 171430
Project: 171430
Buggy source:
@Override public void paintComponent(Graphics g){
  super.paintComponent(g);
  Graphics2D g2d=(Graphics2D)g;
  int w=canvasWidth / data.M();
  int h=canvasHeight / data.N();
  Board showBoard=data.getShowBoard();
  for (int i=0; i < showBoard.N(); i++)   for (int j=0; j < showBoard.M(); j++) {
    char c=showBoard.getData(i,j);
    if (c != Board.EMPTY) {
      if (!colorMap.containsKey(c)) {
        int sz=colorMap.size();
        colorMap.put(c,colorList.get(sz));
      }
      Color color=colorMap.get(c);
      AlgoVisHelper.setColor(g2d,color);
      AlgoVisHelper.fillRectangle(g2d,j * h + 2,i * w + 2,w - 4,h - 4);
      AlgoVisHelper.setColor(g2d,AlgoVisHelper.White);
      String text=String.format("String_Node_Str",i,j);
      AlgoVisHelper.drawText(g2d,text,j * h + h / 2,i * w + w / 2);
    }
  }
}

Fixed version (ground truth):
@Override public void paintComponent(Graphics g){
  super.paintComponent(g);
  Graphics2D g2d=(Graphics2D)g;
  int w=canvasWidth / data.M();
  int h=canvasHeight / data.N();
  Board showBoard=data.getShowBoard();
  for (int i=0; i < showBoard.N(); i++)   for (int j=0; j < showBoard.M(); j++) {
    char c=showBoard.getData(i,j);
    if (c != Board.EMPTY) {
      if (!colorMap.containsKey(c)) {
        int sz=colorMap.size();
        colorMap.put(c,colorList.get(sz));
      }
      Color color=colorMap.get(c);
      AlgoVisHelper.setColor(g2d,color);
      AlgoVisHelper.fillRectangle(g2d,j * w + 2,i * h + 2,w - 4,h - 4);
      AlgoVisHelper.setColor(g2d,AlgoVisHelper.White);
      String text=String.format("String_Node_Str",i,j);
      AlgoVisHelper.drawText(g2d,text,j * h + h / 2,i * w + w / 2);
    }
  }
}
Program: 171431
Project: 171431
Buggy source:
@Override public void paintComponent(Graphics g){
  super.paintComponent(g);
  Graphics2D g2d=(Graphics2D)g;
  int w=canvasWidth / data.M();
  int h=canvasHeight / data.N();
  Board showBoard=data.getShowBoard();
  for (int i=0; i < showBoard.N(); i++)   for (int j=0; j < showBoard.M(); j++) {
    char c=showBoard.getData(i,j);
    if (c != Board.EMPTY) {
      if (!colorMap.containsKey(c)) {
        int sz=colorMap.size();
        colorMap.put(c,colorList.get(sz));
      }
      Color color=colorMap.get(c);
      AlgoVisHelper.setColor(g2d,color);
      AlgoVisHelper.fillRectangle(g2d,j * h + 2,i * w + 2,w - 4,h - 4);
      AlgoVisHelper.setColor(g2d,AlgoVisHelper.White);
      String text=String.format("String_Node_Str",i,j);
      AlgoVisHelper.drawText(g2d,text,j * h + h / 2,i * w + w / 2);
    }
    if (i == data.clickx && j == data.clicky) {
      AlgoVisHelper.setColor(g2d,AlgoVisHelper.LightBlue);
      AlgoVisHelper.setStrokeWidth(g2d,4);
      AlgoVisHelper.strokeRectangle(g2d,j * h + 2,i * w + 2,w - 4,h - 4);
    }
  }
}

Fixed version (ground truth):
@Override public void paintComponent(Graphics g){
  super.paintComponent(g);
  Graphics2D g2d=(Graphics2D)g;
  int w=canvasWidth / data.M();
  int h=canvasHeight / data.N();
  Board showBoard=data.getShowBoard();
  for (int i=0; i < showBoard.N(); i++)   for (int j=0; j < showBoard.M(); j++) {
    char c=showBoard.getData(i,j);
    if (c != Board.EMPTY) {
      if (!colorMap.containsKey(c)) {
        int sz=colorMap.size();
        colorMap.put(c,colorList.get(sz));
      }
      Color color=colorMap.get(c);
      AlgoVisHelper.setColor(g2d,color);
      AlgoVisHelper.fillRectangle(g2d,j * w + 2,i * h + 2,w - 4,h - 4);
      AlgoVisHelper.setColor(g2d,AlgoVisHelper.White);
      String text=String.format("String_Node_Str",i,j);
      AlgoVisHelper.drawText(g2d,text,j * h + h / 2,i * w + w / 2);
    }
    if (i == data.clickx && j == data.clicky) {
      AlgoVisHelper.setColor(g2d,AlgoVisHelper.LightBlue);
      AlgoVisHelper.setStrokeWidth(g2d,4);
      AlgoVisHelper.strokeRectangle(g2d,j * w + 2,i * h + 2,w - 4,h - 4);
    }
  }
}
Program: 171432
Project: 171432
Buggy source:
@Override public void paintComponent(Graphics g){
  super.paintComponent(g);
  Graphics2D g2d=(Graphics2D)g;
  int w=canvasWidth / data.M();
  int h=canvasHeight / data.N();
  Board showBoard=data.getShowBoard();
  for (int i=0; i < showBoard.N(); i++)   for (int j=0; j < showBoard.M(); j++) {
    char c=showBoard.getData(i,j);
    if (c != Board.EMPTY) {
      if (!colorMap.containsKey(c)) {
        int sz=colorMap.size();
        colorMap.put(c,colorList.get(sz));
      }
      Color color=colorMap.get(c);
      AlgoVisHelper.setColor(g2d,color);
      AlgoVisHelper.fillRectangle(g2d,j * h + 2,i * w + 2,w - 4,h - 4);
      AlgoVisHelper.setColor(g2d,AlgoVisHelper.White);
      String text=String.format("String_Node_Str",i,j);
      AlgoVisHelper.drawText(g2d,text,j * h + h / 2,i * w + w / 2);
    }
    if (i == data.clickx && j == data.clicky) {
      AlgoVisHelper.setColor(g2d,AlgoVisHelper.LightBlue);
      AlgoVisHelper.setStrokeWidth(g2d,4);
      AlgoVisHelper.strokeRectangle(g2d,j * h + 2,i * w + 2,w - 4,h - 4);
    }
  }
}

Fixed version (ground truth):
@Override public void paintComponent(Graphics g){
  super.paintComponent(g);
  Graphics2D g2d=(Graphics2D)g;
  int w=canvasWidth / data.M();
  int h=canvasHeight / data.N();
  Board showBoard=data.getShowBoard();
  for (int i=0; i < showBoard.N(); i++)   for (int j=0; j < showBoard.M(); j++) {
    char c=showBoard.getData(i,j);
    if (c != Board.EMPTY) {
      if (!colorMap.containsKey(c)) {
        int sz=colorMap.size();
        colorMap.put(c,colorList.get(sz));
      }
      Color color=colorMap.get(c);
      AlgoVisHelper.setColor(g2d,color);
      AlgoVisHelper.fillRectangle(g2d,j * w + 2,i * h + 2,w - 4,h - 4);
      AlgoVisHelper.setColor(g2d,AlgoVisHelper.White);
      String text=String.format("String_Node_Str",i,j);
      AlgoVisHelper.drawText(g2d,text,j * h + h / 2,i * w + w / 2);
    }
    if (i == data.clickx && j == data.clicky) {
      AlgoVisHelper.setColor(g2d,AlgoVisHelper.LightBlue);
      AlgoVisHelper.setStrokeWidth(g2d,4);
      AlgoVisHelper.strokeRectangle(g2d,j * w + 2,i * h + 2,w - 4,h - 4);
    }
  }
}
Program: 171433
Project: 171433
Buggy source:
public void run(){
  while (true) {
    int i=(int)(Math.random() * money.length);
    int j=(int)(Math.random() * money.length);
    if (money[i] > 0) {
      money[i]-=1;
      money[j]+=1;
    }
    frame.render(money);
    AlgoVisHelper.pause(DELAY);
  }
}

Fixed version (ground truth):
public void run(){
  while (true) {
    for (int i=0; i < money.length; i++) {
      if (money[i] > 0) {
        int j=(int)(Math.random() * money.length);
        money[i]-=1;
        money[j]+=1;
      }
    }
    frame.render(money);
    AlgoVisHelper.pause(DELAY);
  }
}
Program: 171434
Project: 171434
Buggy source:
public void run(){
  while (true) {
    for (int k=0; k < DELAY * 100; k++) {
      int i=(int)(Math.random() * money.length);
      int j=(int)(Math.random() * money.length);
      money[i]-=1;
      money[j]+=1;
    }
    Arrays.sort(money);
    frame.render(money);
    AlgoVisHelper.pause(DELAY);
  }
}

Fixed version (ground truth):
public void run(){
  while (true) {
    for (int k=0; k < 50; k++) {
      for (int i=0; i < money.length; i++) {
        int j=(int)(Math.random() * money.length);
        money[i]-=1;
        money[j]+=1;
      }
    }
    Arrays.sort(money);
    frame.render(money);
    AlgoVisHelper.pause(DELAY);
  }
}
Program: 171435
Project: 171435
Buggy source:
static public void setStrokeWidth(Graphics2D g,int w){
  int strokeWidth=w;
  g.setStroke(new BasicStroke(strokeWidth,BasicStroke.CAP_ROUND,BasicStroke.JOIN_ROUND));
}

Fixed version (ground truth):
public static void setStrokeWidth(Graphics2D g,int w){
  int strokeWidth=w;
  g.setStroke(new BasicStroke(strokeWidth,BasicStroke.CAP_ROUND,BasicStroke.JOIN_ROUND));
}
Program: 171436
Project: 171436
Buggy source:
static public void strokeRectangle(Graphics2D g,int x,int y,int w,int h){
  Rectangle2D rectangle=new Rectangle2D.Double(x,y,w,h);
  g.draw(rectangle);
}

Fixed version (ground truth):
public static void strokeRectangle(Graphics2D g,int x,int y,int w,int h){
  Rectangle2D rectangle=new Rectangle2D.Double(x,y,w,h);
  g.draw(rectangle);
}
Program: 171437
Project: 171437
Buggy source:
static public void setColor(Graphics2D g,Color color){
  g.setColor(color);
}

Fixed version (ground truth):
public static void setColor(Graphics2D g,Color color){
  g.setColor(color);
}
Program: 171438
Project: 171438
Buggy source:
static public void fillCircle(Graphics2D g,int x,int y,int r){
  Ellipse2D circle=new Ellipse2D.Double(x - r,y - r,2 * r,2 * r);
  g.fill(circle);
}

Fixed version (ground truth):
public static void fillCircle(Graphics2D g,int x,int y,int r){
  Ellipse2D circle=new Ellipse2D.Double(x - r,y - r,2 * r,2 * r);
  g.fill(circle);
}
Program: 171439
Project: 171439
Buggy source:
static public void strokeCircle(Graphics2D g,int x,int y,int r){
  Ellipse2D circle=new Ellipse2D.Double(x - r,y - r,2 * r,2 * r);
  g.draw(circle);
}

Fixed version (ground truth):
public static void strokeCircle(Graphics2D g,int x,int y,int r){
  Ellipse2D circle=new Ellipse2D.Double(x - r,y - r,2 * r,2 * r);
  g.draw(circle);
}
Program: 171440
Project: 171440
Buggy source:
static public void fillRectangle(Graphics2D g,int x,int y,int w,int h){
  Rectangle2D rectangle=new Rectangle2D.Double(x,y,w,h);
  g.fill(rectangle);
}

Fixed version (ground truth):
public static void fillRectangle(Graphics2D g,int x,int y,int w,int h){
  Rectangle2D rectangle=new Rectangle2D.Double(x,y,w,h);
  g.fill(rectangle);
}
Program: 171441
Project: 171441
Buggy source:
public AlgoVisualizer(AlgoFrame frame,MazeData data){
  this.frame=frame;
  this.data=data;
}

Fixed version (ground truth):
public AlgoVisualizer(AlgoFrame frame,MazeData data){
  this.frame=frame;
  this.data=data;
  this.setData();
}
Program: 171442
Project: 171442
Buggy source:
public AlgoVisualizer(AlgoFrame frame,MazeData data){
  this.frame=frame;
  this.data=data;
}

Fixed version (ground truth):
public AlgoVisualizer(AlgoFrame frame,MazeData data){
  this.frame=frame;
  this.data=data;
  this.setData(-1,-1);
}
Program: 171443
Project: 171443
Buggy source:
public AlgoVisualizer(AlgoFrame frame,MazeData data){
  this.frame=frame;
  this.data=data;
}

Fixed version (ground truth):
public AlgoVisualizer(AlgoFrame frame,MazeData data){
  this.frame=frame;
  this.data=data;
  this.setData(false,-1,-1);
}
Program: 171444
Project: 171444
Buggy source:
public AlgoVisualizer(AlgoFrame frame,MazeData data){
  this.frame=frame;
  this.data=data;
}

Fixed version (ground truth):
public AlgoVisualizer(AlgoFrame frame,MazeData data){
  this.frame=frame;
  this.data=data;
  this.setData(false,-1,-1);
}
Program: 171445
Project: 171445
Buggy source:
public AlgoVisualizer(AlgoFrame frame,MazeData data){
  this.frame=frame;
  this.data=data;
}

Fixed version (ground truth):
public AlgoVisualizer(AlgoFrame frame,MazeData data){
  this.frame=frame;
  this.data=data;
  this.setData(false,Position.invalidPosition(),false,Position.invalidPosition());
}
Program: 171446
Project: 171446
Buggy source:
public AlgoVisualizer(AlgoFrame frame,MazeData data){
  this.frame=frame;
  this.data=data;
}

Fixed version (ground truth):
public AlgoVisualizer(AlgoFrame frame,MazeData data){
  this.frame=frame;
  this.data=data;
  this.setData(false,Position.invalidPosition(),false,Position.invalidPosition());
}
Program: 171447
Project: 171447
Buggy source:
public AlgoVisualizer(AlgoFrame frame,MazeData data){
  this.frame=frame;
  this.data=data;
}

Fixed version (ground truth):
public AlgoVisualizer(AlgoFrame frame,MazeData data){
  this.frame=frame;
  this.data=data;
  this.setData(false,Position.invalidPosition(),false,Position.invalidPosition());
}
Program: 171448
Project: 171448
Buggy source:
public AlgoVisualizer(AlgoFrame frame,MazeData data){
  this.frame=frame;
  this.data=data;
}

Fixed version (ground truth):
public AlgoVisualizer(AlgoFrame frame,MazeData data){
  this.frame=frame;
  this.data=data;
  this.setData(false,-1,-1);
}
Program: 171449
Project: 171449
Buggy source:
public AlgoVisualizer(AlgoFrame frame,MazeData data){
  this.frame=frame;
  this.data=data;
}

Fixed version (ground truth):
public AlgoVisualizer(AlgoFrame frame,MazeData data){
  this.frame=frame;
  this.data=data;
  this.setData(false,Position.invalidPosition(),false,Position.invalidPosition());
}
Program: 171450
Project: 171450
Buggy source:
@Override public void mouseReleased(MouseEvent event){
  event.translatePoint(-(int)(frame.getBounds().width - frame.getCanvasWidth()),-(int)(frame.getBounds().height - frame.getCanvasHeight()));
  Point pos=event.getPoint();
  System.out.println(pos.x + "String_Node_Str" + pos.y);
  int w=frame.getCanvasWidth() / data.M();
  int h=frame.getCanvasHeight() / data.N();
  int x=pos.y / h;
  int y=pos.x / w;
  System.out.println(x + "String_Node_Str" + y);
  if (SwingUtilities.isLeftMouseButton(event)) {
    if (data.getShowBoard().getData(x,y) != Board.EMPTY) {
      setData(x,y);
      if (clickPos1 == null)       clickPos1=new Position(x,y);
 else {
        clickPos2=new Position(x,y);
        data.getShowBoard().swap(clickPos1.x,clickPos1.y,clickPos2.x,clickPos2.y);
        data.getShowBoard().run();
        clickPos1=null;
        clickPos2=null;
        setData(-1,-1);
      }
    }
 else {
      setData(-1,-1);
      clickPos1=null;
    }
  }
}

Fixed version (ground truth):
@Override public void mouseReleased(MouseEvent event){
  event.translatePoint(-(int)(frame.getBounds().width - frame.getCanvasWidth()),-(int)(frame.getBounds().height - frame.getCanvasHeight()));
  Point pos=event.getPoint();
  int w=frame.getCanvasWidth() / data.M();
  int h=frame.getCanvasHeight() / data.N();
  int x=pos.y / h;
  int y=pos.x / w;
  if (SwingUtilities.isLeftMouseButton(event)) {
    if (data.getShowBoard().getData(x,y) != Board.EMPTY) {
      setData(x,y);
      if (clickPos1 == null)       clickPos1=new Position(x,y);
 else {
        clickPos2=new Position(x,y);
        data.getShowBoard().swap(clickPos1.x,clickPos1.y,clickPos2.x,clickPos2.y);
        data.getShowBoard().run();
        clickPos1=null;
        clickPos2=null;
        setData(-1,-1);
      }
    }
 else {
      setData(-1,-1);
      clickPos1=null;
    }
  }
}
Program: 171451
Project: 171451
Buggy source:
public AlgoVisualizer(AlgoFrame frame,MazeData data){
  this.frame=frame;
  this.data=data;
}

Fixed version (ground truth):
public AlgoVisualizer(AlgoFrame frame,MazeData data){
  this.frame=frame;
  this.data=data;
  this.setData();
}
Program: 171452
Project: 171452
Buggy source:
public AlgoVisualizer(AlgoFrame frame,MazeData data){
  this.frame=frame;
  this.data=data;
}

Fixed version (ground truth):
public AlgoVisualizer(AlgoFrame frame,MazeData data){
  this.frame=frame;
  this.data=data;
  this.setData();
}
Program: 171453
Project: 171453
Buggy source:
public AlgoVisualizer(AlgoFrame frame,MazeData data){
  this.frame=frame;
  this.data=data;
}

Fixed version (ground truth):
public AlgoVisualizer(AlgoFrame frame,MazeData data){
  this.frame=frame;
  this.data=data;
  this.setData();
}
Program: 171454
Project: 171454
Buggy source:
public AlgoVisualizer(AlgoFrame frame,MazeData data){
  this.frame=frame;
  this.data=data;
}

Fixed version (ground truth):
public AlgoVisualizer(AlgoFrame frame,MazeData data){
  this.frame=frame;
  this.data=data;
  this.setData();
}
Program: 171455
Project: 171455
Buggy source:
public AlgoVisualizer(AlgoFrame frame,MazeData data){
  this.frame=frame;
  this.data=data;
}

Fixed version (ground truth):
public AlgoVisualizer(AlgoFrame frame,MazeData data){
  this.frame=frame;
  this.data=data;
  this.setData();
}
Program: 171456
Project: 171456
Buggy source:
public AlgoVisualizer(AlgoFrame frame,MazeData data){
  this.frame=frame;
  this.data=data;
}

Fixed version (ground truth):
public AlgoVisualizer(AlgoFrame frame,MazeData data){
  this.frame=frame;
  this.data=data;
  this.setData();
}
Program: 171457
Project: 171457
Buggy source:
public AlgoVisualizer(AlgoFrame frame,MazeData data){
  this.frame=frame;
  this.data=data;
}

Fixed version (ground truth):
public AlgoVisualizer(AlgoFrame frame,MazeData data){
  this.frame=frame;
  this.data=data;
  this.setData();
}
Program: 171458
Project: 171458
Buggy source:
public AlgoVisualizer(AlgoFrame frame,MazeData data){
  this.frame=frame;
  this.data=data;
}

Fixed version (ground truth):
public AlgoVisualizer(AlgoFrame frame,MazeData data){
  this.frame=frame;
  this.data=data;
  this.setData();
}
Program: 171459
Project: 171459
Buggy source:
public AlgoVisualizer(AlgoFrame frame,MazeData data){
  this.frame=frame;
  this.data=data;
}

Fixed version (ground truth):
public AlgoVisualizer(AlgoFrame frame,MazeData data){
  this.frame=frame;
  this.data=data;
  this.setData();
}
Program: 171460
Project: 171460
Buggy source:
public AlgoVisualizer(AlgoFrame frame,MazeData data){
  this.frame=frame;
  this.data=data;
}

Fixed version (ground truth):
public AlgoVisualizer(AlgoFrame frame,MazeData data){
  this.frame=frame;
  this.data=data;
  this.setData();
}
Program: 171461
Project: 171461
Buggy source:
public AlgoVisualizer(AlgoFrame frame,MazeData data){
  this.frame=frame;
  this.data=data;
}

Fixed version (ground truth):
public AlgoVisualizer(AlgoFrame frame,MazeData data){
  this.frame=frame;
  this.data=data;
  this.setData();
}
Program: 171462
Project: 171462
Buggy source:
public AlgoVisualizer(AlgoFrame frame,MazeData data){
  this.frame=frame;
  this.data=data;
}

Fixed version (ground truth):
public AlgoVisualizer(AlgoFrame frame,MazeData data){
  this.frame=frame;
  this.data=data;
  this.setData();
}
Program: 171463
Project: 171463
Buggy source:
public AlgoVisualizer(AlgoFrame frame,MineSweeperData data){
  this.frame=frame;
  this.data=data;
}

Fixed version (ground truth):
public AlgoVisualizer(AlgoFrame frame,MineSweeperData data){
  this.frame=frame;
  this.data=data;
  this.setData();
}
Program: 171464
Project: 171464
Buggy source:
public AlgoVisualizer(AlgoFrame frame,MineSweeperData data){
  this.frame=frame;
  this.data=data;
}

Fixed version (ground truth):
public AlgoVisualizer(AlgoFrame frame,MineSweeperData data){
  this.frame=frame;
  this.data=data;
  this.setData();
}
Program: 171465
Project: 171465
Buggy source:
public AlgoVisualizer(AlgoFrame frame,MineSweeperData data){
  this.frame=frame;
  this.data=data;
}

Fixed version (ground truth):
public AlgoVisualizer(AlgoFrame frame,MineSweeperData data){
  this.frame=frame;
  this.data=data;
  this.setData(false,-1,-1);
}
Program: 171466
Project: 171466
Buggy source:
public AlgoVisualizer(AlgoFrame frame,MineSweeperData data){
  this.frame=frame;
  this.data=data;
}

Fixed version (ground truth):
public AlgoVisualizer(AlgoFrame frame,MineSweeperData data){
  this.frame=frame;
  this.data=data;
  this.setData(false,-1,-1);
}
Program: 171467
Project: 171467
Buggy source:
public AlgoVisualizer(AlgoFrame frame,MineSweeperData data){
  this.frame=frame;
  this.data=data;
}

Fixed version (ground truth):
public AlgoVisualizer(AlgoFrame frame,MineSweeperData data){
  this.frame=frame;
  this.data=data;
  this.setData(false,-1,-1);
}
Program: 171468
Project: 171468
Buggy source:
public AlgoVisualizer(AlgoFrame frame,GameData data){
  this.frame=frame;
  this.data=data;
}

Fixed version (ground truth):
public AlgoVisualizer(AlgoFrame frame,GameData data){
  this.frame=frame;
  this.data=data;
  this.setData();
}
Program: 171469
Project: 171469
Buggy source:
public AlgoVisualizer(AlgoFrame frame,GameData data){
  this.frame=frame;
  this.data=data;
}

Fixed version (ground truth):
public AlgoVisualizer(AlgoFrame frame,GameData data){
  this.frame=frame;
  this.data=data;
  this.setData();
}
Program: 171470
Project: 171470
Buggy source:
public AlgoVisualizer(AlgoFrame frame,GameData data){
  this.frame=frame;
  this.data=data;
}

Fixed version (ground truth):
public AlgoVisualizer(AlgoFrame frame,GameData data){
  this.frame=frame;
  this.data=data;
  this.setData();
}
Program: 171471
Project: 171471
Buggy source:
public AlgoVisualizer(AlgoFrame frame,GameData data){
  this.frame=frame;
  this.data=data;
}

Fixed version (ground truth):
public AlgoVisualizer(AlgoFrame frame,GameData data){
  this.frame=frame;
  this.data=data;
  this.setData();
}
Program: 171472
Project: 171472
Buggy source:
public AlgoVisualizer(AlgoFrame frame,GameData data){
  this.frame=frame;
  this.data=data;
}

Fixed version (ground truth):
public AlgoVisualizer(AlgoFrame frame,GameData data){
  this.frame=frame;
  this.data=data;
  this.setData();
}
Program: 171473
Project: 171473
Buggy source:
public AlgoVisualizer(AlgoFrame frame,GameData data){
  this.frame=frame;
  this.data=data;
}

Fixed version (ground truth):
public AlgoVisualizer(AlgoFrame frame,GameData data){
  this.frame=frame;
  this.data=data;
  this.setData(-1,-1);
}
Program: 171474
Project: 171474
Buggy source:
public static void main(String[] args){
  int sceneWidth=808;
  int sceneHeight=808;
  int blockSide=8;
  EventQueue.invokeLater(() -> {
    AlgoFrame frame=new AlgoFrame("String_Node_Str",sceneWidth,sceneHeight);
    int N=sceneWidth / blockSide;
    int M=sceneWidth / blockSide;
    MazeData data=new MazeData(N,M);
    AlgoVisualizer vis=new AlgoVisualizer(frame,data);
    new Thread(() -> {
      vis.run();
    }
).start();
  }
);
}

Fixed version (ground truth):
public static void main(String[] args){
  int sceneWidth=808;
  int sceneHeight=808;
  int blockSide=8;
  EventQueue.invokeLater(() -> {
    AlgoFrame frame=new AlgoFrame("String_Node_Str",sceneWidth,sceneHeight);
    int N=sceneHeight / blockSide;
    int M=sceneWidth / blockSide;
    MazeData data=new MazeData(N,M);
    AlgoVisualizer vis=new AlgoVisualizer(frame,data);
    new Thread(() -> {
      vis.run();
    }
).start();
  }
);
}
Program: 171475
Project: 171475
Buggy source:
public static void main(String[] args){
  int sceneWidth=808;
  int sceneHeight=808;
  int blockSide=8;
  EventQueue.invokeLater(() -> {
    AlgoFrame frame=new AlgoFrame("String_Node_Str",sceneWidth,sceneHeight);
    int N=sceneWidth / blockSide;
    int M=sceneWidth / blockSide;
    MazeData data=new MazeData(N,M);
    AlgoVisualizer vis=new AlgoVisualizer(frame,data);
    new Thread(() -> {
      vis.run();
    }
).start();
  }
);
}

Fixed version (ground truth):
public static void main(String[] args){
  int sceneWidth=808;
  int sceneHeight=808;
  int blockSide=8;
  EventQueue.invokeLater(() -> {
    AlgoFrame frame=new AlgoFrame("String_Node_Str",sceneWidth,sceneHeight);
    int N=sceneHeight / blockSide;
    int M=sceneWidth / blockSide;
    MazeData data=new MazeData(N,M);
    AlgoVisualizer vis=new AlgoVisualizer(frame,data);
    new Thread(() -> {
      vis.run();
    }
).start();
  }
);
}
Program: 171476
Project: 171476
Buggy source:
public static void main(String[] args){
  int sceneWidth=808;
  int sceneHeight=808;
  int blockSide=8;
  EventQueue.invokeLater(() -> {
    AlgoFrame frame=new AlgoFrame("String_Node_Str",sceneWidth,sceneHeight);
    int N=sceneWidth / blockSide;
    int M=sceneWidth / blockSide;
    MazeData data=new MazeData(N,M);
    AlgoVisualizer vis=new AlgoVisualizer(frame,data);
    new Thread(() -> {
      vis.run();
    }
).start();
  }
);
}

Fixed version (ground truth):
public static void main(String[] args){
  int sceneWidth=808;
  int sceneHeight=808;
  int blockSide=8;
  EventQueue.invokeLater(() -> {
    AlgoFrame frame=new AlgoFrame("String_Node_Str",sceneWidth,sceneHeight);
    int N=sceneHeight / blockSide;
    int M=sceneWidth / blockSide;
    MazeData data=new MazeData(N,M);
    AlgoVisualizer vis=new AlgoVisualizer(frame,data);
    new Thread(() -> {
      vis.run();
    }
).start();
  }
);
}
Program: 171477
Project: 171477
Buggy source:
public static void main(String[] args){
  int sceneWidth=808;
  int sceneHeight=808;
  int blockSide=8;
  EventQueue.invokeLater(() -> {
    AlgoFrame frame=new AlgoFrame("String_Node_Str",sceneWidth,sceneHeight);
    int N=sceneWidth / blockSide;
    int M=sceneWidth / blockSide;
    MazeData data=new MazeData(N,M);
    AlgoVisualizer vis=new AlgoVisualizer(frame,data);
    new Thread(() -> {
      vis.run();
    }
).start();
  }
);
}

Fixed version (ground truth):
public static void main(String[] args){
  int sceneWidth=808;
  int sceneHeight=808;
  int blockSide=8;
  EventQueue.invokeLater(() -> {
    AlgoFrame frame=new AlgoFrame("String_Node_Str",sceneWidth,sceneHeight);
    int N=sceneHeight / blockSide;
    int M=sceneWidth / blockSide;
    MazeData data=new MazeData(N,M);
    AlgoVisualizer vis=new AlgoVisualizer(frame,data);
    new Thread(() -> {
      vis.run();
    }
).start();
  }
);
}
Program: 171478
Project: 171478
Buggy source:
public static void main(String[] args){
  int sceneWidth=808;
  int sceneHeight=808;
  int blockSide=8;
  EventQueue.invokeLater(() -> {
    AlgoFrame frame=new AlgoFrame("String_Node_Str",sceneWidth,sceneHeight);
    int N=sceneWidth / blockSide;
    int M=sceneWidth / blockSide;
    MazeData data=new MazeData(N,M);
    AlgoVisualizer vis=new AlgoVisualizer(frame,data);
    new Thread(() -> {
      vis.run();
    }
).start();
  }
);
}

Fixed version (ground truth):
public static void main(String[] args){
  int sceneWidth=808;
  int sceneHeight=808;
  int blockSide=8;
  EventQueue.invokeLater(() -> {
    AlgoFrame frame=new AlgoFrame("String_Node_Str",sceneWidth,sceneHeight);
    int N=sceneHeight / blockSide;
    int M=sceneWidth / blockSide;
    MazeData data=new MazeData(N,M);
    AlgoVisualizer vis=new AlgoVisualizer(frame,data);
    new Thread(() -> {
      vis.run();
    }
).start();
  }
);
}
Program: 171479
Project: 171479
Buggy source:
public static void main(String[] args){
  int sceneWidth=808;
  int sceneHeight=808;
  int blockSide=8;
  EventQueue.invokeLater(() -> {
    AlgoFrame frame=new AlgoFrame("String_Node_Str",sceneWidth,sceneHeight);
    int N=sceneWidth / blockSide;
    int M=sceneWidth / blockSide;
    MazeData data=new MazeData(N,M);
    AlgoVisualizer vis=new AlgoVisualizer(frame,data);
    new Thread(() -> {
      vis.run();
    }
).start();
  }
);
}

Fixed version (ground truth):
public static void main(String[] args){
  int sceneWidth=808;
  int sceneHeight=808;
  int blockSide=8;
  EventQueue.invokeLater(() -> {
    AlgoFrame frame=new AlgoFrame("String_Node_Str",sceneWidth,sceneHeight);
    int N=sceneHeight / blockSide;
    int M=sceneWidth / blockSide;
    MazeData data=new MazeData(N,M);
    AlgoVisualizer vis=new AlgoVisualizer(frame,data);
    new Thread(() -> {
      vis.run();
    }
).start();
  }
);
}
Program: 171480
Project: 171480
Buggy source:
public static void main(String[] args){
  int sceneWidth=808;
  int sceneHeight=808;
  int blockSide=8;
  EventQueue.invokeLater(() -> {
    AlgoFrame frame=new AlgoFrame("String_Node_Str",sceneWidth,sceneHeight);
    int N=sceneWidth / blockSide;
    int M=sceneWidth / blockSide;
    MazeData data=new MazeData(N,M);
    AlgoVisualizer vis=new AlgoVisualizer(frame,data);
    new Thread(() -> {
      vis.run();
    }
).start();
  }
);
}

Fixed version (ground truth):
public static void main(String[] args){
  int sceneWidth=808;
  int sceneHeight=808;
  int blockSide=8;
  EventQueue.invokeLater(() -> {
    AlgoFrame frame=new AlgoFrame("String_Node_Str",sceneWidth,sceneHeight);
    int N=sceneHeight / blockSide;
    int M=sceneWidth / blockSide;
    MazeData data=new MazeData(N,M);
    AlgoVisualizer vis=new AlgoVisualizer(frame,data);
    new Thread(() -> {
      vis.run();
    }
).start();
  }
);
}
Program: 171481
Project: 171481
Buggy source:
public static void main(String[] args){
  int sceneWidth=808;
  int sceneHeight=808;
  int blockSide=8;
  EventQueue.invokeLater(() -> {
    AlgoFrame frame=new AlgoFrame("String_Node_Str",sceneWidth,sceneHeight);
    int N=sceneWidth / blockSide;
    int M=sceneWidth / blockSide;
    MazeData data=new MazeData(N,M);
    AlgoVisualizer vis=new AlgoVisualizer(frame,data);
    new Thread(() -> {
      vis.run();
    }
).start();
  }
);
}

Fixed version (ground truth):
public static void main(String[] args){
  int sceneWidth=808;
  int sceneHeight=808;
  int blockSide=8;
  EventQueue.invokeLater(() -> {
    AlgoFrame frame=new AlgoFrame("String_Node_Str",sceneWidth,sceneHeight);
    int N=sceneHeight / blockSide;
    int M=sceneWidth / blockSide;
    MazeData data=new MazeData(N,M);
    AlgoVisualizer vis=new AlgoVisualizer(frame,data);
    new Thread(() -> {
      vis.run();
    }
).start();
  }
);
}
Program: 171482
Project: 171482
Buggy source:
public static void main(String[] args){
  int sceneWidth=808;
  int sceneHeight=808;
  int blockSide=8;
  EventQueue.invokeLater(() -> {
    AlgoFrame frame=new AlgoFrame("String_Node_Str",sceneWidth,sceneHeight);
    int N=sceneWidth / blockSide;
    int M=sceneWidth / blockSide;
    MazeData data=new MazeData(N,M);
    AlgoVisualizer vis=new AlgoVisualizer(frame,data);
    new Thread(() -> {
      vis.run();
    }
).start();
  }
);
}

Fixed version (ground truth):
public static void main(String[] args){
  int sceneWidth=808;
  int sceneHeight=808;
  int blockSide=8;
  EventQueue.invokeLater(() -> {
    AlgoFrame frame=new AlgoFrame("String_Node_Str",sceneWidth,sceneHeight);
    int N=sceneHeight / blockSide;
    int M=sceneWidth / blockSide;
    MazeData data=new MazeData(N,M);
    AlgoVisualizer vis=new AlgoVisualizer(frame,data);
    new Thread(() -> {
      vis.run();
    }
).start();
  }
);
}
Program: 171483
Project: 171483
Buggy source:
public static void main(String[] args){
  int sceneWidth=808;
  int sceneHeight=808;
  int blockSide=8;
  EventQueue.invokeLater(() -> {
    AlgoFrame frame=new AlgoFrame("String_Node_Str",sceneWidth,sceneHeight);
    int N=sceneWidth / blockSide;
    int M=sceneWidth / blockSide;
    MazeData data=new MazeData(N,M);
    AlgoVisualizer vis=new AlgoVisualizer(frame,data);
    new Thread(() -> {
      vis.run();
    }
).start();
  }
);
}

Fixed version (ground truth):
public static void main(String[] args){
  int sceneWidth=808;
  int sceneHeight=808;
  int blockSide=8;
  EventQueue.invokeLater(() -> {
    AlgoFrame frame=new AlgoFrame("String_Node_Str",sceneWidth,sceneHeight);
    int N=sceneHeight / blockSide;
    int M=sceneWidth / blockSide;
    MazeData data=new MazeData(N,M);
    AlgoVisualizer vis=new AlgoVisualizer(frame,data);
    new Thread(() -> {
      vis.run();
    }
).start();
  }
);
}
Program: 171484
Project: 171484
Buggy source:
public static void main(String[] args){
  int sceneWidth=808;
  int sceneHeight=808;
  int blockSide=8;
  EventQueue.invokeLater(() -> {
    AlgoFrame frame=new AlgoFrame("String_Node_Str",sceneWidth,sceneHeight);
    int N=sceneWidth / blockSide;
    int M=sceneWidth / blockSide;
    MazeData data=new MazeData(N,M);
    AlgoVisualizer vis=new AlgoVisualizer(frame,data);
    new Thread(() -> {
      vis.run();
    }
).start();
  }
);
}

Fixed version (ground truth):
public static void main(String[] args){
  int sceneWidth=808;
  int sceneHeight=808;
  int blockSide=8;
  EventQueue.invokeLater(() -> {
    AlgoFrame frame=new AlgoFrame("String_Node_Str",sceneWidth,sceneHeight);
    int N=sceneHeight / blockSide;
    int M=sceneWidth / blockSide;
    MazeData data=new MazeData(N,M);
    AlgoVisualizer vis=new AlgoVisualizer(frame,data);
    new Thread(() -> {
      vis.run();
    }
).start();
  }
);
}
Program: 171485
Project: 171485
Buggy source:
public static void main(String[] args){
  int sceneWidth=808;
  int sceneHeight=808;
  int blockSide=8;
  EventQueue.invokeLater(() -> {
    AlgoFrame frame=new AlgoFrame("String_Node_Str",sceneWidth,sceneHeight);
    int N=sceneWidth / blockSide;
    int M=sceneWidth / blockSide;
    MazeData data=new MazeData(N,M);
    AlgoVisualizer vis=new AlgoVisualizer(frame,data);
    new Thread(() -> {
      vis.run();
    }
).start();
  }
);
}

Fixed version (ground truth):
public static void main(String[] args){
  int sceneWidth=808;
  int sceneHeight=808;
  int blockSide=8;
  EventQueue.invokeLater(() -> {
    AlgoFrame frame=new AlgoFrame("String_Node_Str",sceneWidth,sceneHeight);
    int N=sceneHeight / blockSide;
    int M=sceneWidth / blockSide;
    MazeData data=new MazeData(N,M);
    AlgoVisualizer vis=new AlgoVisualizer(frame,data);
    new Thread(() -> {
      vis.run();
    }
).start();
  }
);
}
Program: 171486
Project: 171486
Buggy source:
public static void main(String[] args){
  int sceneWidth=800;
  int sceneHeight=800;
  int blockSide=8;
  EventQueue.invokeLater(() -> {
    AlgoFrame frame=new AlgoFrame("String_Node_Str",sceneWidth,sceneHeight);
    int N=sceneWidth / blockSide;
    int M=sceneWidth / blockSide;
    int mineNumber=(int)(0.01 * N * M);
    MineSweeperData data=new MineSweeperData(N,M,mineNumber);
    AlgoVisualizer vis=new AlgoVisualizer(frame,data);
    new Thread(() -> {
      vis.run();
    }
).start();
  }
);
}

Fixed version (ground truth):
public static void main(String[] args){
  int sceneWidth=800;
  int sceneHeight=800;
  int blockSide=8;
  EventQueue.invokeLater(() -> {
    AlgoFrame frame=new AlgoFrame("String_Node_Str",sceneWidth,sceneHeight);
    int N=sceneHeight / blockSide;
    int M=sceneWidth / blockSide;
    int mineNumber=20;
    MineSweeperData data=new MineSweeperData(N,M,mineNumber);
    AlgoVisualizer vis=new AlgoVisualizer(frame,data);
    new Thread(() -> {
      vis.run();
    }
).start();
  }
);
}
Program: 171487
Project: 171487
Buggy source:
@Override public void paintComponent(Graphics g){
  super.paintComponent(g);
  Graphics2D g2d=(Graphics2D)g;
  int w=canvasWidth / data.M();
  int h=canvasHeight / data.N();
  for (int i=0; i < data.N(); i++)   for (int j=0; j < data.M(); j++) {
    if (data.isMine(i,j))     AlgoVisHelper.putImage(g2d,i * h,j * w,MineSweeperData.mineImageURL);
 else     AlgoVisHelper.putImage(g2d,i * h,j * w,MineSweeperData.blockImageURL);
  }
}

Fixed version (ground truth):
@Override public void paintComponent(Graphics g){
  super.paintComponent(g);
  Graphics2D g2d=(Graphics2D)g;
  int w=canvasWidth / data.M();
  int h=canvasHeight / data.N();
  for (int i=0; i < data.N(); i++)   for (int j=0; j < data.M(); j++) {
    if (data.isMine(i,j))     AlgoVisHelper.putImage(g2d,j * w,i * h,MineSweeperData.mineImageURL);
 else     AlgoVisHelper.putImage(g2d,j * w,i * h,MineSweeperData.blockImageURL);
  }
}
Program: 171488
Project: 171488
Buggy source:
@Override public void paintComponent(Graphics g){
  super.paintComponent(g);
  Graphics2D g2d=(Graphics2D)g;
  int w=canvasWidth / data.M();
  int h=canvasHeight / data.N();
  for (int i=0; i < data.N(); i++)   for (int j=0; j < data.M(); j++) {
    if (data.isMine(i,j))     AlgoVisHelper.putImage(g2d,i * h,j * w,MineSweeperData.mineImageURL);
 else     AlgoVisHelper.putImage(g2d,i * h,j * w,MineSweeperData.blockImageURL);
  }
}

Fixed version (ground truth):
@Override public void paintComponent(Graphics g){
  super.paintComponent(g);
  Graphics2D g2d=(Graphics2D)g;
  int w=canvasWidth / data.M();
  int h=canvasHeight / data.N();
  for (int i=0; i < data.N(); i++)   for (int j=0; j < data.M(); j++) {
    if (data.isMine(i,j))     AlgoVisHelper.putImage(g2d,j * w,i * h,MineSweeperData.mineImageURL);
 else     AlgoVisHelper.putImage(g2d,j * w,i * h,MineSweeperData.blockImageURL);
  }
}
Program: 171489
Project: 171489
Buggy source:
@Override public void paintComponent(Graphics g){
  super.paintComponent(g);
  Graphics2D g2d=(Graphics2D)g;
  int w=canvasWidth / data.M();
  int h=canvasHeight / data.N();
  for (int i=0; i < data.N(); i++)   for (int j=0; j < data.M(); j++) {
    if (data.open[i][j]) {
      if (data.isMine(i,j))       AlgoVisHelper.putImage(g2d,i * h,j * w,MineSweeperData.mineImageURL);
 else       AlgoVisHelper.putImage(g2d,i * h,j * w,MineSweeperData.numberImageURL(data.getNumber(i,j)));
    }
 else {
      if (data.flags[i][j])       AlgoVisHelper.putImage(g2d,i * h,j * w,MineSweeperData.flagImageURL);
 else       AlgoVisHelper.putImage(g2d,i * h,j * w,MineSweeperData.blockImageURL);
    }
  }
}

Fixed version (ground truth):
@Override public void paintComponent(Graphics g){
  super.paintComponent(g);
  Graphics2D g2d=(Graphics2D)g;
  int w=canvasWidth / data.M();
  int h=canvasHeight / data.N();
  for (int i=0; i < data.N(); i++)   for (int j=0; j < data.M(); j++) {
    if (data.open[i][j]) {
      if (data.isMine(i,j))       AlgoVisHelper.putImage(g2d,j * w,i * h,MineSweeperData.mineImageURL);
 else       AlgoVisHelper.putImage(g2d,j * w,i * h,MineSweeperData.numberImageURL(data.getNumber(i,j)));
    }
 else {
      if (data.flags[i][j])       AlgoVisHelper.putImage(g2d,j * w,i * h,MineSweeperData.flagImageURL);
 else       AlgoVisHelper.putImage(g2d,j * w,i * h,MineSweeperData.blockImageURL);
    }
  }
}
Program: 171490
Project: 171490
Buggy source:
@Override public void mouseReleased(MouseEvent event){
  event.translatePoint(-(int)(frame.getBounds().width - frame.getCanvasWidth()),-(int)(frame.getBounds().height - frame.getCanvasHeight()));
  Point pos=event.getPoint();
  int w=frame.getCanvasWidth() / data.M();
  int h=frame.getCanvasHeight() / data.N();
  int x=pos.x / h;
  int y=pos.y / w;
  if (SwingUtilities.isLeftMouseButton(event))   setData(true,x,y);
 else   if (SwingUtilities.isRightMouseButton(event))   setData(false,x,y);
}

Fixed version (ground truth):
@Override public void mouseReleased(MouseEvent event){
  event.translatePoint(-(int)(frame.getBounds().width - frame.getCanvasWidth()),-(int)(frame.getBounds().height - frame.getCanvasHeight()));
  Point pos=event.getPoint();
  int w=frame.getCanvasWidth() / data.M();
  int h=frame.getCanvasHeight() / data.N();
  int x=pos.y / h;
  int y=pos.x / w;
  if (SwingUtilities.isLeftMouseButton(event))   setData(true,x,y);
 else   if (SwingUtilities.isRightMouseButton(event))   setData(false,x,y);
}
Program: 171491
Project: 171491
Buggy source:
@Override public void paintComponent(Graphics g){
  super.paintComponent(g);
  Graphics2D g2d=(Graphics2D)g;
  int w=canvasWidth / data.M();
  int h=canvasHeight / data.N();
  for (int i=0; i < data.N(); i++)   for (int j=0; j < data.M(); j++) {
    if (data.open[i][j]) {
      if (data.isMine(i,j))       AlgoVisHelper.putImage(g2d,i * h,j * w,MineSweeperData.mineImageURL);
 else       AlgoVisHelper.putImage(g2d,i * h,j * w,MineSweeperData.numberImageURL(data.getNumber(i,j)));
    }
 else {
      if (data.flags[i][j])       AlgoVisHelper.putImage(g2d,i * h,j * w,MineSweeperData.flagImageURL);
 else       AlgoVisHelper.putImage(g2d,i * h,j * w,MineSweeperData.blockImageURL);
    }
  }
}

Fixed version (ground truth):
@Override public void paintComponent(Graphics g){
  super.paintComponent(g);
  Graphics2D g2d=(Graphics2D)g;
  int w=canvasWidth / data.M();
  int h=canvasHeight / data.N();
  for (int i=0; i < data.N(); i++)   for (int j=0; j < data.M(); j++) {
    if (data.open[i][j]) {
      if (data.isMine(i,j))       AlgoVisHelper.putImage(g2d,j * w,i * h,MineSweeperData.mineImageURL);
 else       AlgoVisHelper.putImage(g2d,j * w,i * h,MineSweeperData.numberImageURL(data.getNumber(i,j)));
    }
 else {
      if (data.flags[i][j])       AlgoVisHelper.putImage(g2d,j * w,i * h,MineSweeperData.flagImageURL);
 else       AlgoVisHelper.putImage(g2d,j * w,i * h,MineSweeperData.blockImageURL);
    }
  }
}
Program: 171492
Project: 171492
Buggy source:
@Override public void mouseReleased(MouseEvent event){
  event.translatePoint(-(int)(frame.getBounds().width - frame.getCanvasWidth()),-(int)(frame.getBounds().height - frame.getCanvasHeight()));
  Point pos=event.getPoint();
  int w=frame.getCanvasWidth() / data.M();
  int h=frame.getCanvasHeight() / data.N();
  int x=pos.x / h;
  int y=pos.y / w;
  if (SwingUtilities.isLeftMouseButton(event))   setData(true,x,y);
 else   if (SwingUtilities.isRightMouseButton(event))   setData(false,x,y);
}

Fixed version (ground truth):
@Override public void mouseReleased(MouseEvent event){
  event.translatePoint(-(int)(frame.getBounds().width - frame.getCanvasWidth()),-(int)(frame.getBounds().height - frame.getCanvasHeight()));
  Point pos=event.getPoint();
  int w=frame.getCanvasWidth() / data.M();
  int h=frame.getCanvasHeight() / data.N();
  int x=pos.y / h;
  int y=pos.x / w;
  if (SwingUtilities.isLeftMouseButton(event))   setData(true,x,y);
 else   if (SwingUtilities.isRightMouseButton(event))   setData(false,x,y);
}
Program: 171493
Project: 171493
Buggy source:
@Override public void paintComponent(Graphics g){
  super.paintComponent(g);
  Graphics2D g2d=(Graphics2D)g;
  int w=canvasWidth / data.M();
  int h=canvasHeight / data.N();
  for (int i=0; i < data.N(); i++)   for (int j=0; j < data.M(); j++) {
    if (data.open[i][j]) {
      if (data.isMine(i,j))       AlgoVisHelper.putImage(g2d,i * h,j * w,MineSweeperData.mineImageURL);
 else       AlgoVisHelper.putImage(g2d,i * h,j * w,MineSweeperData.numberImageURL(data.getNumber(i,j)));
    }
 else {
      if (data.flags[i][j])       AlgoVisHelper.putImage(g2d,i * h,j * w,MineSweeperData.flagImageURL);
 else       AlgoVisHelper.putImage(g2d,i * h,j * w,MineSweeperData.blockImageURL);
    }
  }
}

Fixed version (ground truth):
@Override public void paintComponent(Graphics g){
  super.paintComponent(g);
  Graphics2D g2d=(Graphics2D)g;
  int w=canvasWidth / data.M();
  int h=canvasHeight / data.N();
  for (int i=0; i < data.N(); i++)   for (int j=0; j < data.M(); j++) {
    if (data.open[i][j]) {
      if (data.isMine(i,j))       AlgoVisHelper.putImage(g2d,j * w,i * h,MineSweeperData.mineImageURL);
 else       AlgoVisHelper.putImage(g2d,j * w,i * h,MineSweeperData.numberImageURL(data.getNumber(i,j)));
    }
 else {
      if (data.flags[i][j])       AlgoVisHelper.putImage(g2d,j * w,i * h,MineSweeperData.flagImageURL);
 else       AlgoVisHelper.putImage(g2d,j * w,i * h,MineSweeperData.blockImageURL);
    }
  }
}
Program: 171494
Project: 171494
Buggy source:
@Override public void mouseReleased(MouseEvent event){
  event.translatePoint(-(int)(frame.getBounds().width - frame.getCanvasWidth()),-(int)(frame.getBounds().height - frame.getCanvasHeight()));
  Point pos=event.getPoint();
  int w=frame.getCanvasWidth() / data.M();
  int h=frame.getCanvasHeight() / data.N();
  int x=pos.x / h;
  int y=pos.y / w;
  if (SwingUtilities.isLeftMouseButton(event))   setData(true,x,y);
 else   if (SwingUtilities.isRightMouseButton(event))   setData(false,x,y);
}

Fixed version (ground truth):
@Override public void mouseReleased(MouseEvent event){
  event.translatePoint(-(int)(frame.getBounds().width - frame.getCanvasWidth()),-(int)(frame.getBounds().height - frame.getCanvasHeight()));
  Point pos=event.getPoint();
  int w=frame.getCanvasWidth() / data.M();
  int h=frame.getCanvasHeight() / data.N();
  int x=pos.y / h;
  int y=pos.x / w;
  if (SwingUtilities.isLeftMouseButton(event))   setData(true,x,y);
 else   if (SwingUtilities.isRightMouseButton(event))   setData(false,x,y);
}
Program: 171495
Project: 171495
Buggy source:
public static void main(String[] args){
  String filename="String_Node_Str";
  MazeData data=new MazeData(filename);
  data.print();
  int blockSide=8;
  int sceneWidth=data.N() * blockSide;
  int sceneHeight=data.M() * blockSide;
  EventQueue.invokeLater(() -> {
    AlgoFrame frame=new AlgoFrame("String_Node_Str",sceneWidth,sceneHeight);
    AlgoVisualizer vis=new AlgoVisualizer(frame,data);
    new Thread(() -> {
      vis.run();
    }
).start();
  }
);
}

Fixed version (ground truth):
public static void main(String[] args){
  String filename="String_Node_Str";
  MazeData data=new MazeData(filename);
  data.print();
  int blockSide=8;
  int sceneHeight=data.N() * blockSide;
  int sceneWidth=data.M() * blockSide;
  EventQueue.invokeLater(() -> {
    AlgoFrame frame=new AlgoFrame("String_Node_Str",sceneWidth,sceneHeight);
    AlgoVisualizer vis=new AlgoVisualizer(frame,data);
    new Thread(() -> {
      vis.run();
    }
).start();
  }
);
}
Program: 171496
Project: 171496
Buggy source:
public static void main(String[] args){
  String filename="String_Node_Str";
  MazeData data=new MazeData(filename);
  int blockSide=8;
  int sceneWidth=data.N() * blockSide;
  int sceneHeight=data.M() * blockSide;
  EventQueue.invokeLater(() -> {
    AlgoFrame frame=new AlgoFrame("String_Node_Str",sceneWidth,sceneHeight);
    AlgoVisualizer vis=new AlgoVisualizer(frame,data);
    new Thread(() -> {
      vis.run();
    }
).start();
  }
);
}

Fixed version (ground truth):
public static void main(String[] args){
  String filename="String_Node_Str";
  MazeData data=new MazeData(filename);
  int blockSide=8;
  int sceneHeight=data.N() * blockSide;
  int sceneWidth=data.M() * blockSide;
  EventQueue.invokeLater(() -> {
    AlgoFrame frame=new AlgoFrame("String_Node_Str",sceneWidth,sceneHeight);
    AlgoVisualizer vis=new AlgoVisualizer(frame,data);
    new Thread(() -> {
      vis.run();
    }
).start();
  }
);
}
Program: 171497
Project: 171497
Buggy source:
public static void main(String[] args){
  String filename="String_Node_Str";
  MazeData data=new MazeData(filename);
  int blockSide=8;
  int sceneWidth=data.N() * blockSide;
  int sceneHeight=data.M() * blockSide;
  EventQueue.invokeLater(() -> {
    AlgoFrame frame=new AlgoFrame("String_Node_Str",sceneWidth,sceneHeight);
    AlgoVisualizer vis=new AlgoVisualizer(frame,data);
    new Thread(() -> {
      vis.run();
    }
).start();
  }
);
}

Fixed version (ground truth):
public static void main(String[] args){
  String filename="String_Node_Str";
  MazeData data=new MazeData(filename);
  int blockSide=8;
  int sceneHeight=data.N() * blockSide;
  int sceneWidth=data.M() * blockSide;
  EventQueue.invokeLater(() -> {
    AlgoFrame frame=new AlgoFrame("String_Node_Str",sceneWidth,sceneHeight);
    AlgoVisualizer vis=new AlgoVisualizer(frame,data);
    new Thread(() -> {
      vis.run();
    }
).start();
  }
);
}
Program: 171498
Project: 171498
Buggy source:
public static void main(String[] args){
  String filename="String_Node_Str";
  MazeData data=new MazeData(filename);
  int blockSide=8;
  int sceneWidth=data.N() * blockSide;
  int sceneHeight=data.M() * blockSide;
  EventQueue.invokeLater(() -> {
    AlgoFrame frame=new AlgoFrame("String_Node_Str",sceneWidth,sceneHeight);
    AlgoVisualizer vis=new AlgoVisualizer(frame,data);
    new Thread(() -> {
      vis.run();
    }
).start();
  }
);
}

Fixed version (ground truth):
public static void main(String[] args){
  String filename="String_Node_Str";
  MazeData data=new MazeData(filename);
  int blockSide=8;
  int sceneHeight=data.N() * blockSide;
  int sceneWidth=data.M() * blockSide;
  EventQueue.invokeLater(() -> {
    AlgoFrame frame=new AlgoFrame("String_Node_Str",sceneWidth,sceneHeight);
    AlgoVisualizer vis=new AlgoVisualizer(frame,data);
    new Thread(() -> {
      vis.run();
    }
).start();
  }
);
}