nus-yam/ex-repair huggingface dataset:
Program: 24872
Project: 24872
Buggy source:
public void drawPauseMenu(int keyFlag){
  pauseBufferGraphics.drawImage(playBuffer,0,0,null);
switch (keyFlag) {
case 1:
    pauseBufferGraphics.drawImage(b,80,300,null);
  pauseBufferGraphics.drawImage(c,80,350,null);
pauseBufferGraphics.drawImage(e,80,400,null);
break;
case 2:
pauseBufferGraphics.drawImage(a,80,300,null);
pauseBufferGraphics.drawImage(d,80,350,null);
pauseBufferGraphics.drawImage(e,80,400,null);
break;
case 3:
pauseBufferGraphics.drawImage(a,80,300,null);
pauseBufferGraphics.drawImage(c,80,350,null);
pauseBufferGraphics.drawImage(f,80,400,null);
break;
default :
break;
}
playGraphics.drawImage(pauseBuffer,0,0,null);
}

Fixed version (ground truth):
public void drawPauseMenu(int keyFlag){
  pauseBufferGraphics.drawImage(playBuffer,0,0,null);
  pauseBufferGraphics.drawImage(pauseBg,0,0,null);
switch (keyFlag) {
case 1:
    pauseBufferGraphics.drawImage(b,80,300,null);
  pauseBufferGraphics.drawImage(c,80,350,null);
pauseBufferGraphics.drawImage(e,80,400,null);
break;
case 2:
pauseBufferGraphics.drawImage(a,80,300,null);
pauseBufferGraphics.drawImage(d,80,350,null);
pauseBufferGraphics.drawImage(e,80,400,null);
break;
case 3:
pauseBufferGraphics.drawImage(a,80,300,null);
pauseBufferGraphics.drawImage(c,80,350,null);
pauseBufferGraphics.drawImage(f,80,400,null);
break;
default :
break;
}
playGraphics.drawImage(pauseBuffer,0,0,null);
}
Program: 24873
Project: 24873
Buggy source:
public static void main(String[] args){
  if (args.length > 0 && args[1].equals("String_Node_Str"))   debug=true;
  GWindow window=new GWindow();
  EventConnect.addEventListener(window);
}

Fixed version (ground truth):
public static void main(String[] args){
  if (args.length > 0 && args[0].equals("String_Node_Str")) {
    debug=true;
  }
  GWindow window=new GWindow();
  EventConnect.addEventListener(window);
}
Program: 24874
Project: 24874
Buggy source:
public Hero(ActionSource source,Point position,int radius,int life){
  this.position=position;
  this.HEIGHT=600;
  this.WIDTH=450;
  this.power=1;
  this.source=source;
  this.life=life;
  this.radius=radius;
  this.imageId=11;
  this.BULLETRADIUS=8;
  this.BULLETIMAGEID=17;
  this.BULLETSPEED=25;
}

Fixed version (ground truth):
public Hero(ActionSource source,Point position,int radius,int life){
  this.position=position;
  this.HEIGHT=600;
  this.WIDTH=450;
  this.power=1;
  this.source=source;
  this.life=life;
  this.radius=radius;
  this.imageId=11;
  this.BULLETRADIUS=8;
  this.BULLETIMAGEID=23;
  this.BULLETSPEED=25;
}
Program: 24875
Project: 24875
Buggy source:
public Bullet shoot(){
  if (source.check("String_Node_Str")) {
    Point bulletPoint=new Point(position);
    CircleBullet bullet=new CircleBullet(bulletPoint,BULLETRADIUS,BULLETIMAGEID,0,0);
    int x=(int)position.getX();
    int y=(int)position.getY() - 10;
    Point destination=new Point(x,y);
    Route bulletRoute=RouteFactory.getRoute("String_Node_Str",position,destination,BULLETSPEED,0);
    bullet.setRoute(bulletRoute);
    return bullet;
  }
  return null;
}

Fixed version (ground truth):
public Bullet shoot(){
  if (source.check("String_Node_Str")) {
    Point bulletPoint=new Point(position);
    CircleBullet bullet=new CircleBullet(bulletPoint,0,BULLETRADIUS,BULLETIMAGEID,shooting++);
    int x=(int)position.getX();
    int y=(int)position.getY() - 10;
    Point destination=new Point(x,y);
    Route bulletRoute=RouteFactory.getRoute("String_Node_Str",position,destination,BULLETSPEED,0);
    bullet.setRoute(bulletRoute);
    return bullet;
  }
  return null;
}
Program: 24876
Project: 24876
Buggy source:
private void collision(){
  for (  Bullet bullet : bulletList) {
    if (bullet == null)     continue;
    if (bullet.collision(player)) {
      int life=player.crash();
      EventConnect.dispatch("String_Node_Str");
      if (life < 0 && Nightmare.debug == false) {
        EventConnect.dispatch("String_Node_Str");
      }
    }
  }
  for (  Bullet bullet : playerBulletList) {
    if (bullet == null)     continue;
    Object[] enemies=enemyList.toArray();
    for (int i=0; i < enemies.length; i++) {
      Enemy enemy=(Enemy)enemies[i];
      if (enemy == null)       continue;
      if (bullet.collision(enemy)) {
        if (enemy.attacted(player.getPower())) {
          enemy.crash();
          enemyList.remove(enemy);
        }
      }
    }
  }
}

Fixed version (ground truth):
private void collision(){
  for (  Bullet bullet : bulletList) {
    if (bullet == null)     continue;
    if (bullet.collision(player)) {
      int life=player.crash();
      EventConnect.dispatch("String_Node_Str");
      if (life < 0 && Nightmare.debug == false) {
        EventConnect.dispatch("String_Node_Str");
      }
    }
  }
  for (  Bullet bullet : playerBulletList) {
    if (bullet == null)     continue;
    Object[] enemies=enemyList.toArray();
    for (int i=0; i < enemies.length; i++) {
      Enemy enemy=(Enemy)enemies[i];
      if (enemy == null)       continue;
      if (bullet.collision(enemy)) {
        if (enemy.attacted(player.getPower())) {
          enemy.crash();
          enemyList.set(enemy.getId(),null);
        }
      }
    }
  }
}
Program: 24877
Project: 24877
Buggy source:
private void recycle(){
  int x;
  int y;
  Object[] bullets=bulletList.toArray();
  for (int i=0; i < bullets.length; i++) {
    Bullet bullet=(Bullet)bullets[i];
    if (bullet == null)     continue;
    x=(int)bullet.getPosition().getX();
    y=(int)bullet.getPosition().getY();
    if (calcRecycle(x,y))     bulletList.remove(bullet);
  }
  Object[] playerBullets=playerBulletList.toArray();
  for (int i=0; i < playerBullets.length; i++) {
    Bullet bullet=(Bullet)playerBullets[i];
    if (bullet == null)     continue;
    x=(int)bullet.getPosition().getX();
    y=(int)bullet.getPosition().getY();
    if (calcRecycle(x,y))     playerBulletList.remove(bullet);
  }
  Object[] enemies=enemyList.toArray();
  for (int i=0; i < enemies.length; i++) {
    Enemy enemy=(Enemy)enemies[i];
    if (enemy == null)     continue;
    x=(int)enemy.getPosition().getX();
    y=(int)enemy.getPosition().getY();
    if (calcRecycle(x,y))     enemyList.remove(enemy);
  }
}

Fixed version (ground truth):
private void recycle(){
  int x;
  int y;
  Object[] bullets=bulletList.toArray();
  for (int i=0; i < bullets.length; i++) {
    Bullet bullet=(Bullet)bullets[i];
    if (bullet == null)     continue;
    x=(int)bullet.getPosition().getX();
    y=(int)bullet.getPosition().getY();
    if (calcRecycle(x,y))     bulletList.set(bullet.getId(),null);
  }
  Object[] playerBullets=playerBulletList.toArray();
  for (int i=0; i < playerBullets.length; i++) {
    Bullet bullet=(Bullet)playerBullets[i];
    if (bullet == null)     continue;
    x=(int)bullet.getPosition().getX();
    y=(int)bullet.getPosition().getY();
    if (calcRecycle(x,y))     playerBulletList.set(bullet.getId(),null);
  }
  Object[] enemies=enemyList.toArray();
  for (int i=0; i < enemies.length; i++) {
    Enemy enemy=(Enemy)enemies[i];
    if (enemy == null)     continue;
    x=(int)enemy.getPosition().getX();
    y=(int)enemy.getPosition().getY();
    if (calcRecycle(x,y))     enemyList.set(enemy.getId(),null);
  }
}
Program: 24878
Project: 24878
Buggy source:
public Instruction[][] getInstructionTable(){
  Instruction[][] out;
  Object[] array=instructionTable.toArray();
  int length=array.length;
  out=new Instruction[length][];
  for (int i=0; i < length; i++) {
    ArrayList<Instruction> arr=(ArrayList<Instruction>)array[i];
    if (array[i] != null)     out[i]=arr.toArray(new Instruction[arr.size()]);
  }
  return out;
}

Fixed version (ground truth):
public Instruction[][] getInstructionTable(){
  Instruction[][] out;
  Object[] array=instructionTable.toArray();
  int length=array.length;
  out=new Instruction[length][];
  for (int i=0; i < length; i++) {
    ArrayList<Instruction> arr=(ArrayList<Instruction>)array[i];
    if (array[i] != null)     out[i]=arr.toArray(new Instruction[arr.size()]);
  }
  if (Nightmare.debug) {
    for (int i=0; i < length; i++) {
      Instruction[] arr=out[i];
      if (arr != null) {
        for (        Instruction inst : arr) {
          System.out.println(i + "String_Node_Str" + inst.toString());
        }
      }
    }
  }
  return out;
}
Program: 24880
Project: 24880
Buggy source:
public Container getContent(){
  return menu;
}

Fixed version (ground truth):
public Container getContent(){
  return container;
}
Program: 24881
Project: 24881
Buggy source:
public synchronized void display(){
  graphics=menu.getGraphics();
  menu.requestFocus();
  drawMenu();
}

Fixed version (ground truth):
public synchronized void display(){
  displayMainMenu();
}
Program: 24882
Project: 24882
Buggy source:
public GMenu(){
  String mapName="String_Node_Str";
  this.stage=new Stage("String_Node_Str");
  keyFlag=1;
  try {
    playItem=ImageIO.read(new File(imagePath + "String_Node_Str"));
    exitItem=ImageIO.read(new File(imagePath + "String_Node_Str"));
    playItemActive=ImageIO.read(new File(imagePath + "String_Node_Str"));
    exitItemActive=ImageIO.read(new File(imagePath + "String_Node_Str"));
    sword=ImageIO.read(new File(imagePath + "String_Node_Str"));
    mainMenuBg=ImageIO.read(new File(imagePath + "String_Node_Str"));
    roleMenuBg=ImageIO.read(new File(imagePath + "String_Node_Str"));
  }
 catch (  IOException e) {
    System.out.println("String_Node_Str");
  }
  menu.setBounds(0,0,800,600);
  menu.setVisible(true);
  menu.addKeyListener(mainMenuKeyListener);
}

Fixed version (ground truth):
public GMenu(){
  String mapName="String_Node_Str";
  this.stage=new Stage("String_Node_Str");
  keyFlag=1;
  try {
    playItem=ImageIO.read(new File(imagePath + "String_Node_Str"));
    exitItem=ImageIO.read(new File(imagePath + "String_Node_Str"));
    playItemActive=ImageIO.read(new File(imagePath + "String_Node_Str"));
    exitItemActive=ImageIO.read(new File(imagePath + "String_Node_Str"));
    sword=ImageIO.read(new File(imagePath + "String_Node_Str"));
    mainMenuBg=ImageIO.read(new File(imagePath + "String_Node_Str"));
    roleMenuBg=ImageIO.read(new File(imagePath + "String_Node_Str"));
  }
 catch (  IOException e) {
    System.out.println("String_Node_Str");
  }
  container.setBounds(0,0,800,600);
  container.setVisible(true);
  mainList=new ItemList();
  mainList.add(playItem,playItemActive,new Runnable(){
    public void run(){
      displayRoleMenu();
    }
  }
);
  mainList.add(exitItem,exitItemActive,new Runnable(){
    public void run(){
      System.exit(0);
    }
  }
);
  roleList=new ItemList();
  roleList.add(sword,sword,new Runnable(){
    public void run(){
      startGame();
    }
  }
);
}
Program: 24883
Project: 24883
Buggy source:
private void paused(){
  pauseMenu.display();
}

Fixed version (ground truth):
private void paused(){
  pauseMenu.getGraphics().drawImage(pauseBg,0,0,null);
  menu=new ListMenu(list,80,300,370,40,new Runnable(){
    public void run(){
      gameContinue();
    }
  }
);
  pauseMenu.add(menu);
  menu.display();
}
Program: 24884
Project: 24884
Buggy source:
private void gameContinue(){
  state=PLAY;
  pauseMenu.setVisible(false);
  game.requestFocus();
}

Fixed version (ground truth):
private void gameContinue(){
  EventConnect.dispatch("String_Node_Str");
  state=PLAY;
  pauseMenu.remove(menu);
  game.requestFocus();
}
Program: 24885
Project: 24885
Buggy source:
public void run(){
  playGraphics=play.getGraphics();
  scoreGraphics=scoreBar.getGraphics();
  game.requestFocus();
  while (state != END) {
    if (state == PAUSE) {
      paused();
    }
    drawScore();
    Printable[] list=null;
    try {
      list=queue.take();
    }
 catch (    InterruptedException e) {
      System.err.println("String_Node_Str");
    }
    playBufferGraphics.drawImage(playBg,0,0,null);
    int length=list.length;
    for (int i=0; i < length; i++) {
      Printable fly=list[i];
      int id=fly.getImageId();
      image=stage.getImage(id);
      if (image != null) {
        Point targetCoord=fly.getPosition();
        int imageHeight=image.getHeight(null);
        int imageWidth=image.getWidth(null);
        int dx=praseInt(targetCoord.getX()) - imageWidth / 2;
        int dy=praseInt(targetCoord.getY()) - imageHeight / 2;
        playBufferGraphics.drawImage(image,dx,dy,null);
      }
    }
    playGraphics.drawImage(playBuffer,0,0,null);
  }
}

Fixed version (ground truth):
public void run(){
  gameContinue();
}
Program: 24886
Project: 24886
Buggy source:
public void trigger(GameEvent event){
  String signal=event.getSignal();
  if (signal.equals("String_Node_Str")) {
    state=PAUSE;
  }
  if (signal.equals("String_Node_Str")) {
    state=END;
  }
  if (signal.equals("String_Node_Str")) {
    life=player.getLife();
  }
}

Fixed version (ground truth):
public void trigger(GameEvent event){
  String signal=event.getSignal();
  if (signal.equals("String_Node_Str")) {
    state=PAUSE;
  }
  if (signal.equals("String_Node_Str")) {
    state=END;
  }
  if (signal.equals("String_Node_Str")) {
    state=END;
  }
  if (signal.equals("String_Node_Str")) {
    life=player.getLife();
  }
}
Program: 24888
Project: 24888
Buggy source:
public void trigger(GameEvent event){
  String signal=event.getSignal();
  if (signal.equals("String_Node_Str")) {
    menu();
  }
 else   if (signal.equals("String_Node_Str")) {
    Object[] data=event.getData();
    Stage stage=(Stage)data[0];
    String hero=(String)data[1];
    gameStart(stage,hero);
  }
 else   if (signal.equals("String_Node_Str")) {
    Object[] data=event.getData();
    Stage stage=(Stage)data[0];
    stage.restart();
    String hero=(String)data[1];
    gameStart(stage,hero);
  }
 else   if (signal.equals("String_Node_Str")) {
    gameEnd();
  }
 else   if (signal.equals("String_Node_Str")) {
    close();
  }
}

Fixed version (ground truth):
public void trigger(GameEvent event){
  String signal=event.getSignal();
  if (signal.equals("String_Node_Str")) {
    menu();
  }
 else   if (signal.equals("String_Node_Str")) {
    Object[] data=event.getData();
    Stage stage=(Stage)data[0];
    String hero=(String)data[1];
    gameStart(stage,hero);
  }
 else   if (signal.equals("String_Node_Str")) {
    Object[] data=event.getData();
    Stage stage=(Stage)data[0];
    stage.restart();
    String hero=(String)data[1];
    gameStart(stage,hero);
  }
 else   if (signal.equals("String_Node_Str")) {
    close();
  }
}
Program: 24889
Project: 24889
Buggy source:
private void menu(){
  GMenu menu=new GMenu();
  add(menu.getContent());
  menu.display();
  menu.drawMenu();
}

Fixed version (ground truth):
private void menu(){
  GMenu menu=new GMenu();
  add(menu.getContent());
  menu.display();
}
Program: 24890
Project: 24890
Buggy source:
public GWindow(){
  window=new Frame();
  window.setTitle("String_Node_Str");
  window.setLayout(null);
  window.setSize(width,height);
  window.setLocationRelativeTo(null);
  window.setResizable(false);
  window.setVisible(true);
  window.addWindowListener(new GameWindowListener());
  menu();
}

Fixed version (ground truth):
public GWindow(){
  window=new JFrame();
  window.setTitle("String_Node_Str");
  window.setLayout(null);
  window.setSize(width,height);
  window.setLocationRelativeTo(null);
  window.setResizable(false);
  window.setVisible(true);
  window.addWindowListener(new GameWindowListener());
  menu();
}
Program: 24891
Project: 24891
Buggy source:
private boolean calcRecycle(int x,int y){
  boolean xOver;
  boolean yOver;
  xOver=((x < 0 || x > WIDTH));
  yOver=((y < 0 || y > HEIGHT));
  if (xOver || yOver)   return true;
 else   return false;
}

Fixed version (ground truth):
private boolean calcRecycle(int x,int y){
  boolean xOver;
  boolean yOver;
  xOver=((x < 0 - WIDTH || x > WIDTH * 2));
  yOver=((y < 0 - HEIGHT || y > HEIGHT * 2));
  if (xOver || yOver)   return true;
 else   return false;
}
Program: 24892
Project: 24892
Buggy source:
private String attr(String s,int i){
  return s.split("String_Node_Str")[i];
}

Fixed version (ground truth):
private String attr(String s,int i){
  return s.trim().split("String_Node_Str")[i];
}
Program: 24893
Project: 24893
Buggy source:
public static Bullet getBullet(BulletInstruction instruction,Printable enemy){
  int bulletId=instruction.getBulletId();
  Point position=enemy.getPosition();
  int angle=enemy.getAngle();
  String bulletType=instruction.getBulletType();
  if (bulletType.equals("String_Node_Str")) {
    return new CircleBullet(position,angle,32,15,bulletId);
  }
 else   if (bulletType.equals("String_Node_Str")) {
    return new CircleBullet(position,angle,12,21,bulletId);
  }
 else   if (bulletType.equals("String_Node_Str")) {
    return new CircleBullet(position,angle,8,17,bulletId);
  }
 else   if (bulletType.equals("String_Node_Str")) {
    int radius=instruction.getRadius();
    int imageId=instruction.getImageId();
    return new CircleBullet(position,angle,radius,imageId,bulletId);
  }
  return null;
}

Fixed version (ground truth):
public static Bullet getBullet(BulletInstruction instruction,Printable enemy){
  int bulletId=instruction.getBulletId();
  Point position=enemy.getPosition();
  int angle=enemy.getAngle();
  String bulletType=instruction.getBulletType();
  if (bulletType.equals("String_Node_Str")) {
    return new CircleBullet(position,angle,32,15,bulletId);
  }
 else   if (bulletType.equals("String_Node_Str")) {
    return new CircleBullet(position,angle,12,22,bulletId);
  }
 else   if (bulletType.equals("String_Node_Str")) {
    return new CircleBullet(position,angle,8,17,bulletId);
  }
 else   if (bulletType.equals("String_Node_Str")) {
    int radius=instruction.getRadius();
    int imageId=instruction.getImageId();
    return new CircleBullet(position,angle,radius,imageId,bulletId);
  }
  return null;
}
Program: 24894
Project: 24894
Buggy source:
public long next(long previousTime) throws DelayException {
  if (previousTime < currentTime) {
    throw new DelayException();
  }
  try {
    while (previousTime == currentTime) {
      Thread.sleep(1);
    }
  }
 catch (  InterruptedException e) {
    System.out.println("String_Node_Str");
  }
  return currentTime;
}

Fixed version (ground truth):
public long next(long previousTime) throws DelayException {
  if (previousTime < currentTime) {
    throw new DelayException();
  }
  try {
    while (previousTime >= currentTime) {
      Thread.sleep(1);
    }
  }
 catch (  InterruptedException e) {
    System.out.println("String_Node_Str");
  }
  return currentTime;
}
Program: 24895
Project: 24895
Buggy source:
public void drawMenu(){
  try {
    play1=ImageIO.read(new File(imagePath + "String_Node_Str"));
    play2=ImageIO.read(new File(imagePath + "String_Node_Str"));
    exit1=ImageIO.read(new File(imagePath + "String_Node_Str"));
    exit2=ImageIO.read(new File(imagePath + "String_Node_Str"));
    bg=ImageIO.read(new File(imagePath + "String_Node_Str"));
  }
 catch (  IOException e) {
  }
  graphics.drawImage(bg,0,0,null);
  graphics.drawImage(play2,400,200,null);
  graphics.drawImage(exit1,400,250,null);
}

Fixed version (ground truth):
public void drawMenu(){
  graphics.drawImage(mainMenuBg,0,0,null);
  graphics.drawImage(playItemActive,400,200,null);
  graphics.drawImage(exitItem,400,250,null);
}
Program: 24896
Project: 24896
Buggy source:
public void keyPressed(KeyEvent e){
switch (e.getKeyCode()) {
case KeyEvent.VK_UP:
    break;
case KeyEvent.VK_DOWN:
  break;
case KeyEvent.VK_ENTER:
menu.removeKeyListener(this);
menu.remove(menu);
EventConnect.dispatch(new GameEvent("String_Node_Str",new Object[]{stage,"String_Node_Str"}));
break;
case KeyEvent.VK_ESCAPE:
menu.removeKeyListener(this);
drawMenu();
break;
}
}

Fixed version (ground truth):
public void keyPressed(KeyEvent e){
switch (e.getKeyCode()) {
case KeyEvent.VK_UP:
    break;
case KeyEvent.VK_DOWN:
  break;
case KeyEvent.VK_ENTER:
EventConnect.dispatch(new GameEvent("String_Node_Str",new Object[]{stage,"String_Node_Str"}));
break;
case KeyEvent.VK_ESCAPE:
menu.removeKeyListener(roleMenuKeyListener);
menu.addKeyListener(mainMenuKeyListener);
drawMenu();
break;
}
}
Program: 24897
Project: 24897
Buggy source:
public void display(){
  graphics=menu.getGraphics();
  drawMenu();
  menu.requestFocus();
}

Fixed version (ground truth):
public synchronized void display(){
  graphics=menu.getGraphics();
  menu.requestFocus();
  drawMenu();
}
Program: 24898
Project: 24898
Buggy source:
public GMenu(){
  String mapName="String_Node_Str";
  this.stage=new Stage("String_Node_Str");
  keyFlag=1;
  menu.setBounds(0,0,800,600);
  menu.setVisible(true);
  menu.addKeyListener(this);
}

Fixed version (ground truth):
public GMenu(){
  String mapName="String_Node_Str";
  this.stage=new Stage("String_Node_Str");
  keyFlag=1;
  try {
    playItem=ImageIO.read(new File(imagePath + "String_Node_Str"));
    exitItem=ImageIO.read(new File(imagePath + "String_Node_Str"));
    playItemActive=ImageIO.read(new File(imagePath + "String_Node_Str"));
    exitItemActive=ImageIO.read(new File(imagePath + "String_Node_Str"));
    sword=ImageIO.read(new File(imagePath + "String_Node_Str"));
    mainMenuBg=ImageIO.read(new File(imagePath + "String_Node_Str"));
    roleMenuBg=ImageIO.read(new File(imagePath + "String_Node_Str"));
  }
 catch (  IOException e) {
    System.out.println("String_Node_Str");
  }
  menu.setBounds(0,0,800,600);
  menu.setVisible(true);
  menu.addKeyListener(mainMenuKeyListener);
}
Program: 24899
Project: 24899
Buggy source:
public void drawRoleMenu(){
  try {
    sword=ImageIO.read(new File(imagePath + "String_Node_Str"));
    bg=ImageIO.read(new File(imagePath + "String_Node_Str"));
  }
 catch (  IOException e) {
  }
  graphics.drawImage(bg,0,0,null);
  graphics.drawImage(sword,400,300,null);
}

Fixed version (ground truth):
public void drawRoleMenu(){
  graphics.drawImage(roleMenuBg,0,0,null);
  graphics.drawImage(sword,400,300,null);
}
Program: 24900
Project: 24900
Buggy source:
public Point getPoint(){
  String[] pair=arguments[3].split(',');
  x=Integer.valueOf(pair[0]);
  y=Integer.valueOf(pair[1]);
  return new Point(x,y);
}

Fixed version (ground truth):
public Point getPoint(){
  String[] pair=arguments[3].split("String_Node_Str");
  int x=Integer.valueOf(pair[0]);
  int y=Integer.valueOf(pair[1]);
  return new Point(x,y);
}
Program: 24901
Project: 24901
Buggy source:
public Instruction(String[] arguments){
  this.arguments=arguments.copy();
}

Fixed version (ground truth):
public Instruction(String[] arguments){
  this.arguments=arguments.clone();
}
Program: 24902
Project: 24902
Buggy source:
float getCurveRadius();

Fixed version (ground truth):
public float getCurveRadius(){
  return Floot.valueOf(arguments[7]);
}
Program: 24903
Project: 24903
Buggy source:
public Point getPointOffset(){
  String[] pair=arguments[7].split(',');
  x=Integer.valueOf(pair[0]);
  y=Integer.valueOf(pair[1]);
  return new Point(x,y);
}

Fixed version (ground truth):
public Point getPointOffset(){
  String[] pair=arguments[7].split("String_Node_Str");
  int x=Integer.valueOf(pair[0]);
  int y=Integer.valueOf(pair[1]);
  return new Point(x,y);
}
Program: 24904
Project: 24904
Buggy source:
public String getPointRefer(){
  return argument[6];
}

Fixed version (ground truth):
public String getPointRefer(){
  return arguments[6];
}
Program: 24905
Project: 24905
Buggy source:
public static void newGame(Window window,Stage stage,String hero){
}

Fixed version (ground truth):
public static void newGame(GWindow window,Stage stage,String hero){
  Clock clock=new Clock(100);
  ArrayBlockingQueue<Printable[]> channel=new ArrayBlockingQueue<Printable[]>(1);
  Processor processor=new Processor(clock,channel);
  processor.setStage(stage);
  KeyBoardListener keyboard=new KeyBoardListener(clock);
  GameOutput output=new GameOutput(window,keyboard,channel,stage);
  output.setStage(stage);
  Player player=new Player(hero,keyboard);
  processor.addPlayer(player);
  Thread processorThread=new Thread(processor);
  Thread outputThread=new Thread(output);
  processorThread.start();
  outputThread.start();
  clock.start();
}
Program: 24906
Project: 24906
Buggy source:
public static void main(String[] args){
  Menu menu=new Menu();
}

Fixed version (ground truth):
public static void main(String[] args){
  GMenu menu=new GMenu();
}
Program: 24910
Project: 24910
Buggy source:
private Long shiftDownRight(Long position){
  Long drShift=position >> 9;
  return new Long(drShift & ~LEFT_MASK);
}

Fixed version (ground truth):
private Long shiftDownRight(Long position){
  Long drShift=position >>> 9;
  return new Long(drShift & ~LEFT_MASK);
}
Program: 24911
Project: 24911
Buggy source:
private Long shiftDownLeft(Long position){
  Long dlShift=position >> 7;
  return new Long(dlShift & ~RIGHT_MASK);
}

Fixed version (ground truth):
private Long shiftDownLeft(Long position){
  Long dlShift=position >>> 7;
  return new Long(dlShift & ~RIGHT_MASK);
}
Program: 24912
Project: 24912
Buggy source:
private Long shiftRight(Long position){
  Long rShift=position >> 1;
  return new Long(rShift & ~LEFT_MASK);
}

Fixed version (ground truth):
private Long shiftRight(Long position){
  Long rShift=position >>> 1;
  return new Long(rShift & ~LEFT_MASK);
}
Program: 24913
Project: 24913
Buggy source:
private Long shiftDown(Long position){
  return new Long(position >> 8);
}

Fixed version (ground truth):
private Long shiftDown(Long position){
  return new Long(position >>> 8);
}
Program: 24914
Project: 24914
Buggy source:
private Long shiftUpRight(Long position){
  Long urShift=position << 7;
  return new Long(urShift & ~LEFT_MASK);
}

Fixed version (ground truth):
private Long shiftUpRight(Long position){
  Long urShift=position << 7L;
  return new Long(urShift & ~LEFT_MASK);
}
Program: 24916
Project: 24916
Buggy source:
private BitmapDrawable getMarker(int userId,byte[] image){
  Canvas canvas=new Canvas(blankImage);
  canvas.drawBitmap(bitMapBG,0,0,mPaint);
  Bitmap userImage=BitmapFactory.decodeByteArray(image,0,image.length);
  if (userImage.getWidth() > MAX_WIDTH || userImage.getHeight() > MAX_HEIGHT) {
    final float scaleWidth=MAX_WIDTH / (float)userImage.getWidth();
    final float scaleHeight=MAX_HEIGHT / (float)userImage.getHeight();
    final float scale=Math.min(scaleWidth,scaleHeight);
    Matrix matrix=new Matrix();
    matrix.postScale(scale,scale);
    Bitmap resizedBitmap=Bitmap.createBitmap(userImage,0,0,userImage.getWidth(),userImage.getHeight(),matrix,true);
    canvas.drawBitmap(resizedBitmap,BORDER,BORDER,mPaint);
  }
 else   canvas.drawBitmap(userImage,BORDER,BORDER,mPaint);
  BitmapDrawable bmd=new BitmapDrawable(blankImage);
  return bmd;
}

Fixed version (ground truth):
private BitmapDrawable getMarker(int userId,byte[] image){
  Canvas canvas=new Canvas(blankImage);
  canvas.drawBitmap(bitMapBG,0,0,mPaint);
  Bitmap userImage=BitmapFactory.decodeByteArray(image,0,image.length);
  if (userImage.getWidth() > MAX_WIDTH || userImage.getHeight() > MAX_HEIGHT) {
    final float scaleWidth=MAX_WIDTH / (float)userImage.getWidth();
    final float scaleHeight=MAX_HEIGHT / (float)userImage.getHeight();
    final float scale=Math.min(scaleWidth,scaleHeight);
    Matrix matrix=new Matrix();
    matrix.postScale(scale,scale);
    Bitmap resizedBitmap=Bitmap.createBitmap(userImage,0,0,userImage.getWidth(),userImage.getHeight(),matrix,true);
    canvas.drawBitmap(resizedBitmap,BORDER,BORDER,mPaint);
  }
 else   canvas.drawBitmap(userImage,BORDER,BORDER,mPaint);
  userImage.recycle();
  BitmapDrawable bmd=new BitmapDrawable(blankImage);
  return bmd;
}
Program: 24920
Project: 24920
Buggy source:
private void addApp(){
  final String title=eventTextBox.getText().trim();
  if (!title.matches("String_Node_Str")) {
    Window.alert("String_Node_Str" + title + "String_Node_Str");
    eventTextBox.selectAll();
    return;
  }
  final Date startDate=startDateBox.getValue();
  if (startDate == null) {
    Window.alert("String_Node_Str");
    return;
  }
  final Date expirationDate=expirationDateBox.getValue();
  if (expirationDate == null) {
    Window.alert("String_Node_Str");
    return;
  }
 else   if (expirationDate.before(new Date(System.currentTimeMillis()))) {
    Window.alert("String_Node_Str" + expirationDate + "String_Node_Str");
    return;
  }
 else   if (expirationDate.before(startDate)) {
    Window.alert("String_Node_Str");
    return;
  }
  final Application app=new Application();
  app.setTitle(title);
  app.setStartDate(startDate);
  app.setExpirationDate(expirationDate);
  final int row=appsFlexTable.getRowCount() + 1;
  applicationsService.create(app,new AsyncCallback<Key>(){
    public void onFailure(    Throwable caught){
      Window.alert(caught.getMessage());
    }
    public void onSuccess(    Key result){
      eventTextBox.setText(null);
      startDateBox.setValue(null);
      expirationDateBox.setValue(null);
      app.setKey(result);
      updateTableRow(app,row);
    }
  }
);
}

Fixed version (ground truth):
private void addApp(){
  final String title=eventTextBox.getText().trim();
  if (!title.matches("String_Node_Str")) {
    Window.alert("String_Node_Str" + title + "String_Node_Str");
    eventTextBox.selectAll();
    return;
  }
  final Date startDate=startDateBox.getValue();
  if (startDate == null) {
    Window.alert("String_Node_Str");
    return;
  }
  final Date expirationDate=expirationDateBox.getValue();
  if (expirationDate == null) {
    Window.alert("String_Node_Str");
    return;
  }
 else   if (expirationDate.before(new Date(System.currentTimeMillis()))) {
    Window.alert("String_Node_Str" + expirationDate + "String_Node_Str");
    return;
  }
 else   if (expirationDate.before(startDate)) {
    Window.alert("String_Node_Str");
    return;
  }
  final Application app=new Application();
  app.setTitle(title);
  app.setStartDate(startDate);
  app.setExpirationDate(expirationDate);
  final int row=appsFlexTable.getRowCount() + 1;
  applicationsService.create(app,new AsyncCallback<Key>(){
    public void onFailure(    Throwable caught){
      Window.alert(caught.getMessage());
    }
    public void onSuccess(    Key result){
      eventTextBox.setText(null);
      startDateBox.setValue(null);
      expirationDateBox.setValue(null);
      if (result != null) {
        app.setKey(result);
        updateTableRow(app,row);
      }
    }
  }
);
}
Program: 24921
Project: 24921
Buggy source:
public void onSuccess(Key result){
  eventTextBox.setText(null);
  startDateBox.setValue(null);
  expirationDateBox.setValue(null);
  app.setKey(result);
  updateTableRow(app,row);
}

Fixed version (ground truth):
public void onSuccess(Key result){
  eventTextBox.setText(null);
  startDateBox.setValue(null);
  expirationDateBox.setValue(null);
  if (result != null) {
    app.setKey(result);
    updateTableRow(app,row);
  }
}
Program: 24922
Project: 24922
Buggy source:
private void updateResource(RestRequest request) throws Exception {
  RestController controller=request.getController();
  String id=request.getResourceId();
  if (controller.get(id) != null) {
    RestResource original=controller.get(id);
    String body=readBody(request);
    RestResource resource=request.getFormat().deserialiseResource(body,request);
    Collection<String> fields=PropertyUtils.getAllProperties(resource.getClass());
    for (    String field : fields) {
      Object value=PropertyUtils.getProperty(resource,field);
      if (value != null) {
        logger.debug("String_Node_Str",field,id);
        PropertyUtils.setProperty(original,field,value);
      }
    }
    logger.debug("String_Node_Str",id);
    controller.update(id,resource);
  }
 else {
    logger.debug("String_Node_Str");
    createResource(request);
  }
}

Fixed version (ground truth):
private void updateResource(RestRequest request) throws Exception {
  RestController controller=request.getController();
  String id=request.getResourceId();
  if (controller.get(id) != null) {
    RestResource original=controller.get(id);
    String body=readBody(request);
    RestResource resource=request.getFormat().deserialiseResource(body,request);
    Collection<String> fields=PropertyUtils.getAllProperties(resource.getClass());
    for (    String field : fields) {
      Object value=PropertyUtils.getProperty(resource,field);
      if (value != null) {
        logger.debug("String_Node_Str",field,id);
        PropertyUtils.setProperty(original,field,value);
      }
    }
    logger.debug("String_Node_Str",id);
    controller.update(id,original);
  }
 else {
    logger.debug("String_Node_Str");
    createResource(request);
  }
}
Program: 24923
Project: 24923
Buggy source:
/** 
 * Default constructor. Initializes Players, BattleGrids, and WaitingController to kick off Battleship game.
 */
public BattleshipFrame(){
  Player playerA=new PlayerImpl("String_Node_Str");
  Player playerB=new PlayerImpl("String_Node_Str");
  BattleGrid gridA=new BattleGridImpl(playerA);
  BattleGrid gridB=new BattleGridImpl(playerB);
  waiting=new WaitingControllerImpl(this,playerB,gridB,playerA,gridA);
  this.setTitle("String_Node_Str");
  this.setSize(WIDTH,HEIGHT);
  this.pack();
  this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  LOGGER.finer("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Default constructor. Initializes Players, BattleGrids, and WaitingController to kick off Battleship game.
 */
public BattleshipFrame(){
  Player playerA=new PlayerImpl("String_Node_Str");
  Player playerB=new PlayerImpl("String_Node_Str");
  BattleGrid gridA=new BattleGridImpl(playerA);
  BattleGrid gridB=new BattleGridImpl(playerB);
  waiting=new WaitingControllerImpl(this,playerB,gridB,playerA,gridA);
  this.setTitle("String_Node_Str");
  Dimension dim=new Dimension(WIDTH,HEIGHT);
  this.setPreferredSize(dim);
  this.pack();
  this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  LOGGER.finer("String_Node_Str");
}
Program: 24924
Project: 24924
Buggy source:
@Override public boolean setShipPos(int x,int y){
  if (null == this.currentShipType || !this.grid.boundsCheck(x,y) || (this.curOrientation && !this.grid.boundsCheck(x + this.currentShipType.length(),y)) || (!this.curOrientation && !this.grid.boundsCheck(x,y + this.currentShipType.length()))) {
    LOGGER.finest("String_Node_Str");
    return false;
  }
  boolean validPlacement=true;
  if (this.curOrientation) {
    for (int i=0; i < this.currentShipType.length(); i++) {
      validPlacement=validPlacement && !this.grid.isShip(x + i,y);
    }
  }
 else {
    for (int i=0; i < this.currentShipType.length(); i++) {
      validPlacement=validPlacement && !this.grid.isShip(x,y + i);
    }
  }
  if (validPlacement) {
    this.grid.setShipPos(new ShipImpl(this.currentShipType),x,y,this.curOrientation);
  }
 else {
    LOGGER.fine("String_Node_Str");
  }
  return validPlacement;
}

Fixed version (ground truth):
@Override public boolean setShipPos(int x,int y){
  if (null == this.currentShipType || !this.grid.boundsCheck(x,y) || (this.curOrientation && !this.grid.boundsCheck(x + this.currentShipType.length() - 1,y)) || (!this.curOrientation && !this.grid.boundsCheck(x,y + this.currentShipType.length()))) {
    LOGGER.finest("String_Node_Str");
    return false;
  }
  boolean validPlacement=true;
  if (this.curOrientation) {
    for (int i=0; i < this.currentShipType.length(); i++) {
      validPlacement=validPlacement && !this.grid.isShip(x + i,y);
    }
  }
 else {
    for (int i=0; i < this.currentShipType.length(); i++) {
      validPlacement=validPlacement && !this.grid.isShip(x,y + i);
    }
  }
  if (validPlacement) {
    this.grid.setShipPos(new ShipImpl(this.currentShipType),x,y,this.curOrientation);
  }
 else {
    LOGGER.fine("String_Node_Str");
  }
  return validPlacement;
}
Program: 24925
Project: 24925
Buggy source:
public void setRiderThreshold(final String identifier,final int thresholdPower){
synchronized (_riders) {
    Rider rider=getRider(identifier);
    rider.setThresholdPower(thresholdPower);
    reapplyRiderLoad(identifier);
    _workoutPublisher.publishEvent(new IEvent<IWorkoutListener>(){
      public void trigger(      IWorkoutListener target){
        target.handleRiderThresholdAdjust(identifier,thresholdPower);
      }
    }
);
  }
}

Fixed version (ground truth):
public void setRiderThreshold(final String identifier,final int thresholdPower){
synchronized (_controllers) {
synchronized (_riders) {
      Rider rider=getRider(identifier);
      rider.setThresholdPower(thresholdPower);
      reapplyRiderLoad(identifier);
      _workoutPublisher.publishEvent(new IEvent<IWorkoutListener>(){
        public void trigger(        IWorkoutListener target){
          target.handleRiderThresholdAdjust(identifier,thresholdPower);
        }
      }
);
    }
  }
}
Program: 24926
Project: 24926
Buggy source:
public void handleControlData(String identifier,ControlData data){
  try {
synchronized (_riders) {
      if (_deviceMap.containsKey(identifier)) {
        RiderSession rs=_deviceMap.get(identifier);
switch (data.getType()) {
case PLUS:
          setRiderThreshold(rs.getRider().getIdentifier(),rs.getRider().getThresholdPower() + 5);
        break;
case MINUS:
      setRiderThreshold(rs.getRider().getIdentifier(),rs.getRider().getThresholdPower() - 5);
    break;
case START:
  startRide();
break;
case STOP:
pauseRide();
break;
}
}
}
}
 catch (Throwable e) {
LOG.error("String_Node_Str",e);
}
}

Fixed version (ground truth):
public void handleControlData(String identifier,ControlData data){
  try {
synchronized (_controllers) {
synchronized (_riders) {
        if (_deviceMap.containsKey(identifier)) {
          RiderSession rs=_deviceMap.get(identifier);
switch (data.getType()) {
case PLUS:
            setRiderThreshold(rs.getRider().getIdentifier(),rs.getRider().getThresholdPower() + 5);
          break;
case MINUS:
        setRiderThreshold(rs.getRider().getIdentifier(),rs.getRider().getThresholdPower() - 5);
      break;
case START:
    startRide();
  break;
case STOP:
pauseRide();
break;
}
}
}
}
}
 catch (Throwable e) {
LOG.error("String_Node_Str",e);
}
}
Program: 24927
Project: 24927
Buggy source:
public void setRiderHandicap(String identifier,final int handicap){
synchronized (_riders) {
    RiderSession rider=_riderMap.get(identifier);
    rider.setHandicap(handicap);
    reapplyRiderLoad(identifier);
  }
}

Fixed version (ground truth):
public void setRiderHandicap(String identifier,final int handicap){
synchronized (_controllers) {
synchronized (_riders) {
      RiderSession rider=_riderMap.get(identifier);
      rider.setHandicap(handicap);
      reapplyRiderLoad(identifier);
    }
  }
}
Program: 24928
Project: 24928
Buggy source:
@Override protected void paintComponent(java.awt.Graphics g){
  super.paintComponent(g);
  Graphics2D graphics=(Graphics2D)g.create();
  int w=this.getWidth();
  int h=this.getHeight();
  if ((_mp != null) && (_vrc != null)) {
    VideoDataBuffer buffer=new VideoDataBuffer(null,0,0,0,VideoDataBuffer.Format.BGR);
    _vrc.getData(buffer);
    IntBuffer intBuffer=(IntBuffer)buffer.getBuffer();
    BufferedImage image=(BufferedImage)createImage(buffer.getWidth(),buffer.getHeight());
    image.setRGB(0,0,buffer.getWidth(),buffer.getHeight(),intBuffer.array(),0,buffer.getWidth());
    AffineTransform transform=new AffineTransform();
    transform.scale(1,-1);
    transform.translate(0,-buffer.getHeight());
    graphics.drawImage(image,transform,this);
    _vrc.releaseData(buffer);
    graphics.setComposite(AlphaComposite.SrcOver);
    graphics.setColor(Color.red.darker());
    graphics.setFont(new Font("String_Node_Str",Font.BOLD,12));
    graphics.drawString("String_Node_Str" + format(_mp.getMediaTime()),10,20);
    graphics.drawString("String_Node_Str" + format(_mp.getDuration()),10,40);
    graphics.drawString("String_Node_Str" + _mp.getRate(),10,60);
  }
}

Fixed version (ground truth):
@Override protected void paintComponent(java.awt.Graphics g){
  super.paintComponent(g);
  Graphics2D graphics=(Graphics2D)g.create();
  int w=this.getWidth();
  int h=this.getHeight();
  if ((_mp != null) && (_vrc != null)) {
    VideoDataBuffer buffer=new VideoDataBuffer(null,0,0,0,VideoDataBuffer.Format.BGR);
    _vrc.getData(buffer);
    IntBuffer intBuffer=(IntBuffer)buffer.getBuffer();
    if (intBuffer != null) {
      BufferedImage image=(BufferedImage)createImage(buffer.getWidth(),buffer.getHeight());
      image.setRGB(0,0,buffer.getWidth(),buffer.getHeight(),intBuffer.array(),0,buffer.getWidth());
      AffineTransform transform=new AffineTransform();
      transform.scale(1,-1);
      transform.translate(0,-buffer.getHeight());
      graphics.drawImage(image,transform,this);
    }
    _vrc.releaseData(buffer);
    graphics.setComposite(AlphaComposite.SrcOver);
    graphics.setColor(Color.red.darker());
    graphics.setFont(new Font("String_Node_Str",Font.BOLD,12));
    graphics.drawString("String_Node_Str" + format(_mp.getMediaTime()),10,20);
    graphics.drawString("String_Node_Str" + format(_mp.getDuration()),10,40);
    graphics.drawString("String_Node_Str" + _mp.getRate(),10,60);
  }
}
Program: 24929
Project: 24929
Buggy source:
/** 
 * Retrieves a <code>Problem</code> from the database by its unique id.
 * @param problemid Unique id of the <code>Problem</code>to retrieve.
 * @return <code>Problem</code> instance from the database or<code>null</code> if id cannot be found.
 */
public Problem getProblem(Long problemid);

Fixed version (ground truth):
/** 
 * Retrieves a <code>Problem</code> from the database by its unique id.
 * @param problemid Unique id of the <code>Problem</code>to retrieve.
 * @return <code>Problem</code> instance from the database or<code>null</code> if id cannot be found.
 */
public Problem getProblem(int problemid);
Program: 24930
Project: 24930
Buggy source:
public Problem getProblem(Long problemid){
  logger.debug("String_Node_Str" + (long)problemid);
  List result=getHibernateTemplate().findByNamedQuery("String_Node_Str",problemid);
  if (result.size() <= 0) {
    logger.debug("String_Node_Str");
    return null;
  }
 else {
    logger.debug("String_Node_Str");
    return (Problem)result.get(0);
  }
}

Fixed version (ground truth):
public Problem getProblem(int problemid){
  logger.debug("String_Node_Str" + (long)problemid);
  List result=getHibernateTemplate().findByNamedQuery("String_Node_Str",problemid);
  if (result.size() <= 0) {
    logger.debug("String_Node_Str");
    return null;
  }
 else {
    logger.debug("String_Node_Str");
    return (Problem)result.get(0);
  }
}
Program: 24931
Project: 24931
Buggy source:
/** 
 * Test of getProblem method, of class ProblemHibernateDAO.
 */
@Test @Ignore public void testGetProblem(){
  ProblemDAO dao=(ProblemDAO)PersistenceContext.getInstance().getBean("String_Node_Str");
  Problem expProblem=new Problem();
  expProblem.setId(3);
  expProblem.setTitle("String_Node_Str");
  expProblem.setContact("String_Node_Str");
  expProblem.setDoc("String_Node_Str");
  List<String> procedures=new ArrayList<String>(3);
  procedures.add("String_Node_Str");
  procedures.add("String_Node_Str");
  procedures.add("String_Node_Str");
  expProblem.setProcedures(procedures);
  Problem actualProblem=dao.getProblem(3L);
  assertEquals(expProblem,actualProblem);
}

Fixed version (ground truth):
/** 
 * Test of getProblem method, of class ProblemHibernateDAO.
 */
@Test public void testGetProblem(){
  Problem expProblem=new Problem();
  expProblem.setId(2);
  expProblem.setTitle("String_Node_Str");
  expProblem.setContact("String_Node_Str");
  expProblem.setDoc("String_Node_Str");
  expProblem.setPriority((byte)4);
  List<String> expProcedures=new ArrayList<String>(2);
  expProcedures.add("String_Node_Str");
  expProcedures.add("String_Node_Str");
  expProblem.setProcedures(expProcedures);
  ProblemDAO dao=(ProblemDAO)TestPersistenceContext.getInstance().getBean("String_Node_Str");
  Problem problem=dao.getProblem(2);
  assertEquals(expProblem,problem);
}
Program: 24932
Project: 24932
Buggy source:
/** 
 * Test of delete method, of class ProblemHibernateDAO.
 */
@Test @Ignore public void testDelete() throws Exception {
  Problem problem=new Problem();
  problem.setId(2);
  problem.setTitle("String_Node_Str");
  problem.setContact("String_Node_Str");
  problem.setDoc("String_Node_Str");
  List<String> procedures=new ArrayList<String>(2);
  procedures.add("String_Node_Str");
  procedures.add("String_Node_Str");
  problem.setProcedures(procedures);
  ProblemDAO instance=(ProblemDAO)PersistenceContext.getInstance().getBean("String_Node_Str");
  instance.delete(problem);
  PreparedStatement statement=null;
  PreparedStatement statement2=null;
  ResultSet results=null;
  ResultSet results2=null;
  try {
    statement=connection.prepareStatement("String_Node_Str");
    statement.setLong(1,2L);
    results=statement.executeQuery();
    assertFalse("String_Node_Str",results.next());
    statement2=connection.prepareStatement("String_Node_Str");
    statement2.setLong(1,2L);
    results2=statement.executeQuery();
    assertFalse("String_Node_Str",results2.next());
  }
  finally {
    if (statement != null)     statement.close();
    if (statement2 != null)     statement2.close();
    if (results != null)     results.close();
    if (results2 != null)     results2.close();
  }
}

Fixed version (ground truth):
/** 
 * Test of delete method, of class ProblemHibernateDAO.
 */
@Test public void testDelete() throws Exception {
  Problem problem=new Problem();
  problem.setId(1);
  problem.setTitle("String_Node_Str");
  problem.setContact("String_Node_Str");
  problem.setPriority((byte)1);
  List<String> procedures=new ArrayList<String>(2);
  procedures.add("String_Node_Str");
  procedures.add("String_Node_Str");
  problem.setProcedures(procedures);
  ProblemDAO dao=(ProblemDAO)TestPersistenceContext.getInstance().getBean("String_Node_Str");
  dao.delete(problem);
  PreparedStatement stmt=connection.prepareStatement("String_Node_Str");
  stmt.setInt(1,1);
  ResultSet results=stmt.executeQuery();
  assertFalse(results.next());
  PreparedStatement stmt2=connection.prepareStatement("String_Node_Str");
  stmt2.setInt(1,1);
  ResultSet results2=stmt2.executeQuery();
  assertFalse(results.next());
}