nus-yam/ex-repair huggingface dataset:
Program: 153669
Project: 153669
Buggy source:
public User getUser(String name){
  Connection conn=null;
  PreparedStatement ps=null;
  ResultSet rs=null;
  try {
    conn=getConnection();
    String state="String_Node_Str" + name + "String_Node_Str";
    if (j2.debug)     j2.log.info("String_Node_Str" + state);
    ps=conn.prepareStatement(state);
    rs=ps.executeQuery();
    if (rs.next()) {
      String Flags=rs.getString("String_Node_Str");
      ArrayList<Flag> flags=new ArrayList<Flag>();
      for (int x=0; x < Flags.length(); x++) {
        flags.add(Flag.byChar(Flags.charAt(x)));
      }
      if (j2.debug)       j2.log.info("String_Node_Str" + name + "String_Node_Str"+ rs.getString("String_Node_Str")+ "String_Node_Str"+ Flags);
      return new User(name,toColor(rs.getInt("String_Node_Str")),rs.getString("String_Node_Str"),flags);
    }
 else {
      String state2="String_Node_Str" + name + "String_Node_Str";
      if (j2.debug)       j2.log.info("String_Node_Str" + state2);
      ps=conn.prepareStatement(state2);
      ps.executeUpdate();
      ArrayList<Flag> f=new ArrayList<Flag>();
      f.add(Flag.NEW);
      return new User(name,ChatColor.WHITE,"String_Node_Str",f);
    }
  }
 catch (  SQLException ex) {
    j2.log.log(Level.SEVERE,"String_Node_Str",ex);
    j2.maintenance=true;
  }
 finally {
    try {
      if (ps != null) {
        ps.close();
      }
      if (rs != null) {
        rs.close();
      }
      if (conn != null) {
        conn.close();
      }
    }
 catch (    SQLException ex) {
    }
  }
  return null;
}

Fixed version (ground truth):
public User getUser(String name){
  Connection conn=null;
  PreparedStatement ps=null;
  ResultSet rs=null;
  try {
    conn=getConnection();
    String state="String_Node_Str" + name + "String_Node_Str";
    if (j2.debug)     j2.log.info("String_Node_Str" + state);
    ps=conn.prepareStatement(state);
    rs=ps.executeQuery();
    if (rs.next()) {
      String Flags=rs.getString("String_Node_Str");
      ArrayList<Flag> flags=new ArrayList<Flag>();
      for (int x=0; x < Flags.length(); x++) {
        flags.add(Flag.byChar(Flags.charAt(x)));
      }
      if (j2.debug)       j2.log.info("String_Node_Str" + name + "String_Node_Str"+ rs.getString("String_Node_Str")+ "String_Node_Str"+ Flags);
      return new User(name,toColor(rs.getInt("String_Node_Str")),rs.getString("String_Node_Str"),flags);
    }
 else {
      String state2="String_Node_Str" + name + "String_Node_Str";
      if (j2.debug)       j2.log.info("String_Node_Str" + state2);
      ps=conn.prepareStatement(state2);
      ps.executeUpdate();
      ArrayList<Flag> f=new ArrayList<Flag>();
      f.add(Flag.NEW);
      return new User(name,ChatColor.GREEN,"String_Node_Str",f);
    }
  }
 catch (  SQLException ex) {
    j2.log.log(Level.SEVERE,"String_Node_Str",ex);
    j2.maintenance=true;
  }
 finally {
    try {
      if (ps != null) {
        ps.close();
      }
      if (rs != null) {
        rs.close();
      }
      if (conn != null) {
        conn.close();
      }
    }
 catch (    SQLException ex) {
    }
  }
  return null;
}
Program: 153670
Project: 153670
Buggy source:
BlockRow(String name,int replaced,int type,int x,int y,int z,long timestamp){
  this.name=name;
  this.replaced=replaced;
  this.type=type;
  this.x=x;
  this.y=y;
  this.z=z;
  this.extra=null;
  this.timestamp=timestamp;
}

Fixed version (ground truth):
BlockRow(String name,int replaced,int type,int x,int y,int z,long timestamp,String extra){
  this.name=name;
  this.replaced=replaced;
  this.type=type;
  this.x=x;
  this.y=y;
  this.z=z;
  this.extra=extra;
  this.timestamp=timestamp;
}
Program: 153672
Project: 153672
Buggy source:
@Override public void onBlockBreak(BlockBreakEvent event){
  Player player=event.getPlayer();
  if (!j2.hasFlag(player,Flag.MODWORLD)) {
    player.sendMessage("String_Node_Str");
    event.setCancelled(true);
    return;
  }
  BlockRow changed;
  Block smacked=event.getBlock();
  changed=new BlockRow(player.getDisplayName(),smacked.getTypeId(),0,smacked.getX(),smacked.getY(),smacked.getZ(),(System.currentTimeMillis() / 1000L));
  managerBlockLog.bqueue.offer(changed);
}

Fixed version (ground truth):
@Override public void onBlockBreak(BlockBreakEvent event){
  Player player=event.getPlayer();
  if (!j2.hasFlag(player,Flag.MODWORLD)) {
    player.sendMessage("String_Node_Str");
    event.setCancelled(true);
    return;
  }
  BlockRow changed;
  Block smacked=event.getBlock();
  changed=new BlockRow(player.getDisplayName(),smacked.getTypeId(),0,smacked.getX(),smacked.getY(),smacked.getZ(),(System.currentTimeMillis() / 1000L),null);
  managerBlockLog.bqueue.offer(changed);
}
Program: 153673
Project: 153673
Buggy source:
public void onBlockRightClick(BlockRightClickEvent event){
  Player player=event.getPlayer();
  if (event.getItemInHand().getTypeId() == 284 && j2.hasFlag(player,Flag.ADMIN)) {
    if (j2.debug)     j2.log.info(player.getName() + "String_Node_Str");
    this.j2.blogger.showBlockHistory(event.getPlayer(),event.getBlock());
  }
  if (event.getItemInHand().getTypeId() == 280 && j2.hasFlag(player,Flag.ADMIN)) {
    if (j2.debug)     j2.log.info(player.getName() + "String_Node_Str");
    managerBlockLog.bqueue.offer(new BlockRow(player.getDisplayName(),event.getBlock().getTypeId(),0,event.getBlock().getX(),event.getBlock().getY(),event.getBlock().getZ(),(System.currentTimeMillis() / 1000L)));
    event.getBlock().setTypeId(0);
  }
}

Fixed version (ground truth):
public void onBlockRightClick(BlockRightClickEvent event){
  Player player=event.getPlayer();
  if (event.getItemInHand().getTypeId() == 284 && j2.hasFlag(player,Flag.ADMIN)) {
    if (j2.debug)     j2.log.info(player.getName() + "String_Node_Str");
    this.j2.blogger.showBlockHistory(event.getPlayer(),event.getBlock());
  }
  if (event.getItemInHand().getTypeId() == 280 && j2.hasFlag(player,Flag.ADMIN)) {
    if (j2.debug)     j2.log.info(player.getName() + "String_Node_Str");
    managerBlockLog.bqueue.offer(new BlockRow(player.getDisplayName(),event.getBlock().getTypeId(),0,event.getBlock().getX(),event.getBlock().getY(),event.getBlock().getZ(),(System.currentTimeMillis() / 1000L),null));
    event.getBlock().setTypeId(0);
  }
}
Program: 153674
Project: 153674
Buggy source:
@Override public void onBlockPlace(BlockPlaceEvent event){
  Player player=event.getPlayer();
  Block blockPlaced=event.getBlockPlaced();
  int type=blockPlaced.getTypeId();
  if (!j2.hasFlag(player,Flag.MODWORLD)) {
    player.sendMessage("String_Node_Str");
    event.setCancelled(true);
    return;
  }
  BlockRow test;
  test=new BlockRow(player.getDisplayName(),0,type,blockPlaced.getX(),blockPlaced.getY(),blockPlaced.getZ(),(System.currentTimeMillis() / 1000L));
  managerBlockLog.bqueue.offer(test);
  if (j2.hasFlag(player,Flag.TRUSTED) && !j2.hasFlag(player,Flag.ADMIN) && j2.isOnSuperBlacklist(type)) {
    player.sendMessage(ChatColor.RED + "String_Node_Str");
    event.setCancelled(true);
    return;
  }
  if (!j2.hasFlag(player,Flag.TRUSTED) && (j2.isOnRegularBlacklist(type) || j2.isOnSuperBlacklist(type))) {
    player.sendMessage(ChatColor.RED + "String_Node_Str");
    event.setCancelled(true);
    return;
  }
  double x=player.getLocation().getX() - (blockPlaced.getX() + 0.5D);
  double y=player.getLocation().getY() - (blockPlaced.getY() + 0.5D);
  double z=player.getLocation().getZ() - (blockPlaced.getZ() + 0.5D);
  double dist=x * x + y * y + z * z;
  if (dist > 400.0D) {
    j2.chat.msgByFlag(Flag.ADMIN,player.getName() + "String_Node_Str");
    j2.log.info(player.getName() + "String_Node_Str");
    player.kickPlayer("String_Node_Str");
    event.setCancelled(true);
  }
}

Fixed version (ground truth):
@Override public void onBlockPlace(BlockPlaceEvent event){
  Player player=event.getPlayer();
  Block blockPlaced=event.getBlockPlaced();
  int type=blockPlaced.getTypeId();
  if (!j2.hasFlag(player,Flag.MODWORLD)) {
    player.sendMessage("String_Node_Str");
    event.setCancelled(true);
    return;
  }
  BlockRow test;
  test=new BlockRow(player.getDisplayName(),0,type,blockPlaced.getX(),blockPlaced.getY(),blockPlaced.getZ(),(System.currentTimeMillis() / 1000L),null);
  managerBlockLog.bqueue.offer(test);
  if (j2.hasFlag(player,Flag.TRUSTED) && !j2.hasFlag(player,Flag.ADMIN) && j2.isOnSuperBlacklist(type)) {
    player.sendMessage(ChatColor.RED + "String_Node_Str");
    event.setCancelled(true);
    return;
  }
  if (!j2.hasFlag(player,Flag.TRUSTED) && (j2.isOnRegularBlacklist(type) || j2.isOnSuperBlacklist(type))) {
    player.sendMessage(ChatColor.RED + "String_Node_Str");
    event.setCancelled(true);
    return;
  }
  double x=player.getLocation().getX() - (blockPlaced.getX() + 0.5D);
  double y=player.getLocation().getY() - (blockPlaced.getY() + 0.5D);
  double z=player.getLocation().getZ() - (blockPlaced.getZ() + 0.5D);
  double dist=x * x + y * y + z * z;
  if (dist > 400.0D) {
    j2.chat.msgByFlag(Flag.ADMIN,player.getName() + "String_Node_Str");
    j2.log.info(player.getName() + "String_Node_Str");
    player.kickPlayer("String_Node_Str");
    event.setCancelled(true);
  }
}
Program: 153675
Project: 153675
Buggy source:
@Override public void onPlayerChat(PlayerChatEvent event){
  String name=event.getPlayer().getName();
  String message=event.getMessage();
  j2.chat.addChat(name,message);
  j2.irc.ircMsg("String_Node_Str" + name + "String_Node_Str"+ message);
  if (!j2.randomcolor) {
    return;
  }
  String[] colorlist=j2.chat.getColorlist();
  int rand=j2.random.nextInt(13);
  if (rand < 12) {
    j2.chat.msgAll(ChatColor.WHITE + "String_Node_Str" + colorlist[rand]+ name+ ChatColor.WHITE+ "String_Node_Str"+ message);
  }
 else {
    for (int x=0; x < name.length(); x++) {
      name+=colorlist[j2.random.nextInt(12)] + name.charAt(x);
    }
    j2.chat.msgAll(ChatColor.WHITE + "String_Node_Str" + name+ ChatColor.WHITE+ "String_Node_Str"+ message);
  }
  event.setCancelled(true);
}

Fixed version (ground truth):
@Override public void onPlayerChat(PlayerChatEvent event){
  String name=event.getPlayer().getName();
  String message=event.getMessage();
  j2.chat.addChat(name,message);
  j2.irc.ircMsg("String_Node_Str" + name + "String_Node_Str"+ message);
  j2.chat.msgAll(ChatColor.WHITE + "String_Node_Str" + j2.users.getUser(event.getPlayer()).getColorName()+ ChatColor.WHITE+ "String_Node_Str"+ message);
  event.setCancelled(true);
}
Program: 153676
Project: 153676
Buggy source:
@Override public void onPlayerItem(PlayerItemEvent event){
  Player player=event.getPlayer();
  int type=event.getMaterial().getId();
  if (!j2.hasFlag(player,Flag.MODWORLD)) {
    player.sendMessage("String_Node_Str");
    event.setCancelled(true);
    return;
  }
  if (j2.hasFlag(player,Flag.TRUSTED) && !j2.hasFlag(player,Flag.ADMIN) && j2.isOnSuperBlacklist(type)) {
    player.sendMessage(ChatColor.RED + "String_Node_Str");
    event.setCancelled(true);
    return;
  }
  if (!j2.hasFlag(player,Flag.TRUSTED) && (j2.isOnRegularBlacklist(type) || j2.isOnSuperBlacklist(type))) {
    player.sendMessage(ChatColor.RED + "String_Node_Str");
    event.setCancelled(true);
    return;
  }
  BlockRow changed;
  Block clicked=event.getBlockClicked();
  BlockFace face=event.getBlockFace();
  int x=clicked.getX() + face.getModX();
  int y=clicked.getY() + face.getModY();
  int z=clicked.getZ() + face.getModZ();
  changed=new BlockRow(player.getDisplayName(),event.getItem().getTypeId(),0,x,y,z,(System.currentTimeMillis() / 1000L));
  managerBlockLog.bqueue.offer(changed);
}

Fixed version (ground truth):
@Override public void onPlayerItem(PlayerItemEvent event){
  Player player=event.getPlayer();
  int type=event.getMaterial().getId();
  if (!j2.hasFlag(player,Flag.MODWORLD)) {
    player.sendMessage("String_Node_Str");
    event.setCancelled(true);
    return;
  }
  if (j2.hasFlag(player,Flag.TRUSTED) && !j2.hasFlag(player,Flag.ADMIN) && j2.isOnSuperBlacklist(type)) {
    player.sendMessage(ChatColor.RED + "String_Node_Str");
    event.setCancelled(true);
    return;
  }
  if (!j2.hasFlag(player,Flag.TRUSTED) && (j2.isOnRegularBlacklist(type) || j2.isOnSuperBlacklist(type))) {
    player.sendMessage(ChatColor.RED + "String_Node_Str");
    event.setCancelled(true);
    return;
  }
  BlockRow changed;
  Block clicked=event.getBlockClicked();
  BlockFace face=event.getBlockFace();
  int x=clicked.getX() + face.getModX();
  int y=clicked.getY() + face.getModY();
  int z=clicked.getZ() + face.getModZ();
  if (type != 323) {
    changed=new BlockRow(player.getDisplayName(),0,type,x,y,z,(System.currentTimeMillis() / 1000L),null);
    managerBlockLog.bqueue.offer(changed);
  }
}
Program: 153677
Project: 153677
Buggy source:
public void run(){
  System.out.println("String_Node_Str");
  PreparedStatement ps=null;
  BlockRow b;
  int delay=10;
  while (!stop) {
    long start=System.currentTimeMillis() / 1000L;
    int count=0;
    try {
      ps=conn.prepareStatement("String_Node_Str");
      while (count < 100 && start + delay > (System.currentTimeMillis() / 1000L)) {
        b=bqueue.poll(1L,TimeUnit.SECONDS);
        if (b == null)         continue;
        ps.setInt(1,servnum);
        ps.setTimestamp(2,new Timestamp(b.timestamp));
        ps.setString(3,b.name);
        ps.setInt(4,b.replaced);
        ps.setInt(5,b.type);
        ps.setInt(6,b.x);
        ps.setInt(7,b.y);
        ps.setInt(8,b.z);
        ps.addBatch();
        count++;
      }
      ps.executeBatch();
    }
 catch (    SQLException ex) {
      System.out.println("String_Node_Str" + ex.getMessage());
      System.out.println("String_Node_Str" + ex.getSQLState());
      System.out.println("String_Node_Str" + ex.getErrorCode());
    }
catch (    InterruptedException ev) {
      System.out.println("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
public void run(){
  System.out.println("String_Node_Str");
  PreparedStatement ps=null;
  BlockRow b;
  int delay=10;
  while (!stop) {
    long start=System.currentTimeMillis() / 1000L;
    int count=0;
    try {
      ps=conn.prepareStatement("String_Node_Str");
      while (count < 100 && start + delay > (System.currentTimeMillis() / 1000L)) {
        b=bqueue.poll(1L,TimeUnit.SECONDS);
        if (b == null)         continue;
        ps.setInt(1,servnum);
        ps.setTimestamp(2,new Timestamp(b.timestamp));
        ps.setString(3,b.name);
        ps.setInt(4,b.replaced);
        ps.setInt(5,b.type);
        ps.setInt(6,b.x);
        ps.setInt(7,b.y);
        ps.setInt(8,b.z);
        ps.setString(9,b.extra);
        ps.addBatch();
        count++;
      }
      ps.executeBatch();
    }
 catch (    SQLException ex) {
      System.out.println("String_Node_Str" + ex.getMessage());
      System.out.println("String_Node_Str" + ex.getSQLState());
      System.out.println("String_Node_Str" + ex.getErrorCode());
    }
catch (    InterruptedException ev) {
      System.out.println("String_Node_Str");
    }
  }
}
Program: 153678
Project: 153678
Buggy source:
public User getUser(String name){
  Connection conn=null;
  PreparedStatement ps=null;
  ResultSet rs=null;
  try {
    conn=getConnection();
    String state="String_Node_Str" + name + "String_Node_Str";
    if (j2.debug)     j2.log.info("String_Node_Str" + state);
    ps=conn.prepareStatement(state);
    rs=ps.executeQuery();
    if (rs.next()) {
      String Flags=rs.getString("String_Node_Str");
      ArrayList<Flag> flags=new ArrayList<Flag>();
      for (int x=0; x < Flags.length(); x++) {
        flags.add(Flag.byChar(Flags.charAt(x)));
      }
      if (j2.debug)       j2.log.info("String_Node_Str" + name + "String_Node_Str"+ rs.getString("String_Node_Str")+ "String_Node_Str"+ Flags);
      return new User(name,ChatColor.getByCode(rs.getInt("String_Node_Str")),rs.getString("String_Node_Str"),flags);
    }
 else {
      String state2="String_Node_Str" + name + "String_Node_Str";
      if (j2.debug)       j2.log.info("String_Node_Str" + state2);
      ps=conn.prepareStatement(state2);
      ps.executeUpdate();
      ArrayList<Flag> f=new ArrayList<Flag>();
      f.add(Flag.NEW);
      return new User(name,ChatColor.WHITE,"String_Node_Str",f);
    }
  }
 catch (  SQLException ex) {
    j2.log.log(Level.SEVERE,"String_Node_Str",ex);
    j2.maintenance=true;
  }
 finally {
    try {
      if (ps != null) {
        ps.close();
      }
      if (rs != null) {
        rs.close();
      }
      if (conn != null) {
        conn.close();
      }
    }
 catch (    SQLException ex) {
    }
  }
  return null;
}

Fixed version (ground truth):
public User getUser(String name){
  Connection conn=null;
  PreparedStatement ps=null;
  ResultSet rs=null;
  try {
    conn=getConnection();
    String state="String_Node_Str" + name + "String_Node_Str";
    if (j2.debug)     j2.log.info("String_Node_Str" + state);
    ps=conn.prepareStatement(state);
    rs=ps.executeQuery();
    if (rs.next()) {
      String Flags=rs.getString("String_Node_Str");
      ArrayList<Flag> flags=new ArrayList<Flag>();
      for (int x=0; x < Flags.length(); x++) {
        flags.add(Flag.byChar(Flags.charAt(x)));
      }
      if (j2.debug)       j2.log.info("String_Node_Str" + name + "String_Node_Str"+ rs.getString("String_Node_Str")+ "String_Node_Str"+ Flags);
      return new User(name,toColor(rs.getInt("String_Node_Str")),rs.getString("String_Node_Str"),flags);
    }
 else {
      String state2="String_Node_Str" + name + "String_Node_Str";
      if (j2.debug)       j2.log.info("String_Node_Str" + state2);
      ps=conn.prepareStatement(state2);
      ps.executeUpdate();
      ArrayList<Flag> f=new ArrayList<Flag>();
      f.add(Flag.NEW);
      return new User(name,ChatColor.WHITE,"String_Node_Str",f);
    }
  }
 catch (  SQLException ex) {
    j2.log.log(Level.SEVERE,"String_Node_Str",ex);
    j2.maintenance=true;
  }
 finally {
    try {
      if (ps != null) {
        ps.close();
      }
      if (rs != null) {
        rs.close();
      }
      if (conn != null) {
        conn.close();
      }
    }
 catch (    SQLException ex) {
    }
  }
  return null;
}
Program: 153680
Project: 153680
Buggy source:
public boolean groupHasFlag(String group,Flag flag){
  return this.groups.get(group).contains(flag);
}

Fixed version (ground truth):
public boolean groupHasFlag(String group,Flag flag){
  return (this.groups.get(group) != null ? this.groups.get(group).contains(flag) : false);
}
Program: 153681
Project: 153681
Buggy source:
@Override public void onPlayerLogin(PlayerLoginEvent event){
  if (j2.debug)   j2.log.info("String_Node_Str" + event.getPlayer().getName());
  String reason=j2.mysql.checkBans(event.getPlayer().getName());
  Player player=event.getPlayer();
  boolean isAdmin=j2.hasFlag(player,Flag.ADMIN);
  if (reason != null) {
    event.setKickMessage(reason);
    event.disallow(PlayerLoginEvent.Result.KICK_BANNED,reason);
    return;
  }
  if (j2.maintenance && !isAdmin) {
    reason=j2.maintmessage;
    event.setKickMessage(reason);
    event.disallow(PlayerLoginEvent.Result.KICK_OTHER,reason);
    return;
  }
  if (j2.users.getUser(player) != null) {
    j2.kickbans.callKick(player.getName(),"String_Node_Str","String_Node_Str");
    return;
  }
  if (!isAdmin && !j2.hasFlag(player,Flag.DONOR) && j2.getServer().getOnlinePlayers().length >= j2.playerLimit) {
    event.setKickMessage("String_Node_Str");
    event.disallow(PlayerLoginEvent.Result.KICK_FULL,"String_Node_Str");
    return;
  }
  j2.users.addUser(event.getPlayer().getName());
  event.allow();
  if (j2.debug)   j2.log.info("String_Node_Str" + event.getPlayer().getName() + "String_Node_Str");
}

Fixed version (ground truth):
@Override public void onPlayerLogin(PlayerLoginEvent event){
  if (j2.debug)   j2.log.info("String_Node_Str" + event.getPlayer().getName());
  String reason=j2.mysql.checkBans(event.getPlayer().getName());
  Player player=event.getPlayer();
  boolean isAdmin=j2.hasFlag(player,Flag.ADMIN);
  if (reason != null) {
    reason="String_Node_Str";
    event.setKickMessage(reason);
    event.disallow(PlayerLoginEvent.Result.KICK_BANNED,reason);
    return;
  }
  if (j2.maintenance && !isAdmin) {
    reason=j2.maintmessage;
    event.setKickMessage(reason);
    event.disallow(PlayerLoginEvent.Result.KICK_OTHER,reason);
    return;
  }
  if (j2.users.getUser(player) != null) {
    j2.kickbans.callKick(player.getName(),"String_Node_Str","String_Node_Str");
    return;
  }
  if (!isAdmin && !j2.hasFlag(player,Flag.DONOR) && j2.getServer().getOnlinePlayers().length >= j2.playerLimit) {
    event.setKickMessage("String_Node_Str");
    event.disallow(PlayerLoginEvent.Result.KICK_FULL,"String_Node_Str");
    return;
  }
  j2.users.addUser(event.getPlayer().getName());
  event.allow();
  if (j2.debug)   j2.log.info("String_Node_Str" + event.getPlayer().getName() + "String_Node_Str");
}
Program: 153683
Project: 153683
Buggy source:
public String stringClean(String toClean){
  return toClean.replace('\"','_').replace('\'','_').replace(';','_');
}

Fixed version (ground truth):
public String stringClean(String toClean){
  return toClean.replace('\"','_').replace('\'','_').replace(';','_').replace(',','_');
}
Program: 153684
Project: 153684
Buggy source:
public void addReport(Report report){
  Connection conn=null;
  PreparedStatement ps=null;
  try {
    conn=getConnection();
    String state="String_Node_Str";
    if (j2.debug)     j2.log.info("String_Node_Str" + state);
    ps=conn.prepareStatement(state);
    ps.setString(1,stringClean(report.getUser()));
    ps.setString(2,stringClean(report.getMessage()));
    Location loc=report.getLocation();
    ps.setDouble(3,loc.getX());
    ps.setDouble(4,loc.getY());
    ps.setDouble(5,loc.getZ());
    ps.setFloat(6,loc.getPitch());
    ps.setFloat(7,loc.getYaw());
    ps.setInt(8,serverNumber);
    ps.setString(9,loc.getWorld().getName());
    long time=report.getTime();
    ps.setLong(10,time);
    ps.executeUpdate();
    ps=conn.prepareStatement("String_Node_Str");
    ps.setLong(1,time);
    ps.setString(2,report.getMessage());
    ResultSet rs=ps.executeQuery();
    int id=rs.getInt("String_Node_Str");
    j2.reports.reportID(time,id);
  }
 catch (  SQLException ex) {
  }
 finally {
    try {
      if (ps != null) {
        ps.close();
      }
      if (conn != null) {
        conn.close();
      }
    }
 catch (    SQLException ex) {
    }
  }
}

Fixed version (ground truth):
public void addReport(Report report){
  Connection conn=null;
  PreparedStatement ps=null;
  try {
    conn=getConnection();
    Location loc=report.getLocation();
    long time=report.getTime();
    String state="String_Node_Str" + stringClean(report.getUser()) + "String_Node_Str"+ stringClean(report.getMessage())+ "String_Node_Str"+ loc.getX()+ "String_Node_Str"+ loc.getY()+ "String_Node_Str"+ loc.getZ()+ "String_Node_Str"+ loc.getPitch()+ "String_Node_Str"+ loc.getYaw()+ "String_Node_Str"+ serverNumber+ "String_Node_Str"+ loc.getWorld().getName()+ "String_Node_Str"+ time+ "String_Node_Str";
    if (j2.debug)     j2.log.info("String_Node_Str" + stringClean(report.getUser()) + "String_Node_Str"+ stringClean(report.getMessage())+ "String_Node_Str"+ loc.getX()+ "String_Node_Str"+ loc.getY()+ "String_Node_Str"+ loc.getZ()+ "String_Node_Str"+ loc.getPitch()+ "String_Node_Str"+ loc.getYaw()+ "String_Node_Str"+ serverNumber+ "String_Node_Str"+ loc.getWorld().getName()+ "String_Node_Str"+ time+ "String_Node_Str");
    ps=conn.prepareStatement(state);
    ps.executeUpdate();
    ps=conn.prepareStatement("String_Node_Str");
    ps.setLong(1,time);
    ps.setString(2,report.getMessage());
    ResultSet rs=ps.executeQuery();
    int id=rs.getInt("String_Node_Str");
    j2.reports.reportID(time,id);
  }
 catch (  SQLException ex) {
  }
 finally {
    try {
      if (ps != null) {
        ps.close();
      }
      if (conn != null) {
        conn.close();
      }
    }
 catch (    SQLException ex) {
    }
  }
}
Program: 153685
Project: 153685
Buggy source:
/** 
 * Serializes individual segment
 * @param obj
 * @param del
 * @param out
 * @throws IOException
 */
private void serializeSegment(EObject obj,Delimiters del,Writer out,String segCode) throws IOException {
  out.write(segCode);
  out.write(del.getField());
  EClass clazz=obj.eClass();
  EList<EStructuralFeature> features=clazz.getEStructuralFeatures();
  boolean compOut=false;
  for (  EStructuralFeature feature : features) {
    if (!metadata.isField(feature)) {
      throw new IllegalArgumentException("String_Node_Str" + clazz.getName() + "String_Node_Str");
    }
    if (obj.eIsSet(feature)) {
      if (compOut) {
        out.write(del.getField());
      }
      serializeField(obj.eGet(feature),del,out);
      compOut=true;
    }
  }
  out.write(del.getSegment());
  out.write("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Serializes individual segment
 * @param obj
 * @param del
 * @param out
 * @throws IOException
 */
private void serializeSegment(EObject obj,Delimiters del,Writer out,String segCode) throws IOException {
  out.write(segCode);
  out.write(del.getField());
  EClass clazz=obj.eClass();
  EList<EStructuralFeature> features=clazz.getEStructuralFeatures();
  boolean compOut=false;
  for (  EStructuralFeature feature : features) {
    if (!metadata.isField(feature)) {
      throw new IllegalArgumentException("String_Node_Str" + clazz.getName() + "String_Node_Str");
    }
    if (compOut) {
      out.write(del.getField());
    }
    compOut=true;
    if (obj.eIsSet(feature)) {
      serializeField(obj.eGet(feature),del,out);
    }
  }
  out.write(del.getSegment());
  out.write("String_Node_Str");
}
Program: 153686
Project: 153686
Buggy source:
private Map<String,EdifactModel> loadModel(String uri) throws EDIConfigurationException, IOException, SAXException, URISyntaxException {
  Map<String,EdifactModel> result=new LinkedHashMap<String,EdifactModel>();
  URI platformURI=URI.createURI(uri);
  if (platformURI.isPlatform()) {
    String fragment=platformURI.segment(1);
    URI modelListURI=URI.createURI("String_Node_Str" + fragment + "String_Node_Str"+ EDIUtils.EDI_MAPPING_MODEL_ZIP_LIST_FILE);
    URL url=new URL(CommonPlugin.resolve(modelListURI).toString());
    List<String> mappingModelList=EDIUtils.getMappingModelList(url.openStream());
    EDIUtils.loadMappingModels(result,new java.net.URI("String_Node_Str"),mappingModelList);
    EdiDirectory dir=createEDIDirectory(result);
    Set<EPackage> packages=ECoreGenerator.INSTANCE.generatePackages(dir);
    for (    EPackage pkg : packages) {
      EPackage.Registry.INSTANCE.put(pkg.getNsURI(),pkg);
    }
  }
  return result;
}

Fixed version (ground truth):
private Map<String,EdifactModel> loadModel(String uri) throws EDIConfigurationException, IOException, SAXException, URISyntaxException {
  Map<String,EdifactModel> result=new LinkedHashMap<String,EdifactModel>();
  URI platformURI=URI.createURI(uri);
  if (platformURI.isPlatform()) {
    String fragment=platformURI.segment(1);
    URI modelListURI=URI.createURI("String_Node_Str" + fragment + "String_Node_Str"+ EDIUtils.EDI_MAPPING_MODEL_ZIP_LIST_FILE);
    URL url=new URL(CommonPlugin.resolve(modelListURI).toString());
    List<String> mappingModelList=EDIUtils.getMappingModelList(url.openStream());
    EDIUtils.loadMappingModels(result,new java.net.URI("String_Node_Str"),mappingModelList);
    EdiDirectory dir=createEDIDirectory(result);
    Set<EPackage> packages=ECoreGenerator.INSTANCE.generatePackages(dir);
    for (    EPackage pkg : packages) {
      packageRegistry.put(pkg.getNsURI(),pkg);
    }
  }
  return result;
}
Program: 153689
Project: 153689
Buggy source:
public boolean testIssue(RequestContext ctx,MessageContext msgCtx){
  final Map<String,String> newsletterVersions=new HashMap<String,String>();
  JCRNodeWrapper node=getNodeByUUID(formTestIssue.getIssueUUID(),getCurrentUserSession(ctx));
  boolean testIssueSent=false;
  try {
    testIssueSent=newsletterService.sendIssue(getRenderContext(ctx),node,formTestIssue.getTestmail(),formTestIssue.getUser(),"String_Node_Str",LanguageCodeConverters.languageCodeToLocale(formTestIssue.getLocale()),"String_Node_Str",newsletterVersions);
  }
 catch (  RepositoryException e) {
    logger.warn("String_Node_Str" + node.getPath(),e);
  }
  setActionMessage(msgCtx,testIssueSent,"String_Node_Str","String_Node_Str",node.getDisplayableName());
  return testIssueSent;
}

Fixed version (ground truth):
public boolean testIssue(RequestContext ctx,MessageContext msgCtx){
  final Map<String,String> newsletterVersions=new HashMap<String,String>();
  JCRNodeWrapper node=getNodeByUUID(formTestIssue.getIssueUUID(),getCurrentUserSession(ctx));
  boolean testIssueSent=false;
  JahiaUser user=userManagerService.lookup(formTestIssue.getUser()).getJahiaUser();
  try {
    testIssueSent=newsletterService.sendIssue(getRenderContext(ctx),node,formTestIssue.getTestmail(),user,"String_Node_Str",LanguageCodeConverters.languageCodeToLocale(formTestIssue.getLocale()),"String_Node_Str",newsletterVersions);
  }
 catch (  RepositoryException e) {
    logger.warn("String_Node_Str" + node.getPath(),e);
  }
  setActionMessage(msgCtx,testIssueSent,"String_Node_Str","String_Node_Str",node.getDisplayableName());
  return testIssueSent;
}
Program: 153690
Project: 153690
Buggy source:
public Set<JCRUserNode> searchUsers(String newsletterUUID,SearchCriteria searchCriteria){
  Set<JCRUserNode> notSubscribeUsers=new LinkedHashSet<JCRUserNode>();
  JCRNodeWrapper newsletter=getNodeByUUID(newsletterUUID,getCurrentUserSession("String_Node_Str"));
  Set<JCRUserNode> searchResult=PrincipalViewHelper.getSearchResult(searchCriteria.getSearchIn(),searchCriteria.getSearchString(),searchCriteria.getProperties(),searchCriteria.getStoredOn(),searchCriteria.getProviders());
  if (newsletter != null) {
    for (    JCRUserNode user : searchResult) {
      try {
        if (subscriptionService.getSubscription(newsletter,user.getPath(),getCurrentUserSession("String_Node_Str")) == null) {
          notSubscribeUsers.add(user);
        }
      }
 catch (      RepositoryException e) {
        logger.warn("String_Node_Str" + user.getName() + "String_Node_Str"+ newsletterUUID);
      }
    }
  }
  return notSubscribeUsers;
}

Fixed version (ground truth):
public Set<JCRUserNode> searchUsers(String newsletterUUID,SearchCriteria searchCriteria){
  Set<JCRUserNode> notSubscribeUsers=new LinkedHashSet<JCRUserNode>();
  JCRNodeWrapper newsletter=getNodeByUUID(newsletterUUID,getCurrentUserSession("String_Node_Str"));
  Set<JCRUserNode> searchResult=null;
  if (newsletter != null) {
    try {
      searchResult=PrincipalViewHelper.getSearchResult(searchCriteria.getSearchIn(),newsletter.getResolveSite().getSiteKey(),searchCriteria.getSearchString(),searchCriteria.getProperties(),searchCriteria.getStoredOn(),searchCriteria.getProviders());
    }
 catch (    RepositoryException e) {
      logger.error(e.getMessage(),e);
    }
    for (    JCRUserNode user : searchResult) {
      try {
        if (subscriptionService.getSubscription(newsletter,user.getPath(),getCurrentUserSession("String_Node_Str")) == null) {
          notSubscribeUsers.add(user);
        }
      }
 catch (      RepositoryException e) {
        logger.warn("String_Node_Str" + user.getName() + "String_Node_Str"+ newsletterUUID);
      }
    }
  }
  return notSubscribeUsers;
}
Program: 153693
Project: 153693
Buggy source:
private Message handleUnsubscribeMessage(CommandMessage message){
  Channel channel=getChannel((String)message.getClientId());
  if (channel == null)   return handleUnknownClientMessage(message);
  AsyncMessage reply=null;
  ServiceAdapter adapter=adapterFactory.getServiceAdapter(message);
  reply=(AcknowledgeMessage)adapter.manage(channel,message);
  postManage(channel);
  reply.setDestination(message.getDestination());
  reply.setClientId(channel.getId());
  reply.getHeaders().putAll(message.getHeaders());
  return reply;
}

Fixed version (ground truth):
private Message handleUnsubscribeMessage(CommandMessage message){
  Channel channel=getChannel((String)message.getClientId());
  if (channel == null)   return handleUnknownClientMessage(message);
  AsyncMessage reply=null;
  ServiceAdapter adapter=adapterFactory.getServiceAdapter(message);
  if (adapter != null) {
    reply=(AcknowledgeMessage)adapter.manage(channel,message);
  }
 else {
    log.warn("String_Node_Str" + message.getDestination());
    reply=new AcknowledgeMessage(message);
  }
  postManage(channel);
  reply.setDestination(message.getDestination());
  reply.setClientId(channel.getId());
  reply.getHeaders().putAll(message.getHeaders());
  return reply;
}
Program: 153694
Project: 153694
Buggy source:
public ComponentInstance newGraniteChannel(String id,String uri,String context){
  try {
    Dictionary properties=new Hashtable();
    properties.put("String_Node_Str",id);
    properties.put("String_Node_Str",context);
    properties.put("String_Node_Str","String_Node_Str");
    properties.put("String_Node_Str",uri);
    return channelBuilder.createComponentInstance(properties);
  }
 catch (  Exception e) {
    log.error(e,"String_Node_Str" + id);
    return null;
  }
}

Fixed version (ground truth):
public ComponentInstance newGraniteChannel(String id,String uri,String context){
  try {
    Dictionary properties=new Hashtable();
    properties.put("String_Node_Str",id);
    properties.put("String_Node_Str",context);
    properties.put("String_Node_Str","String_Node_Str");
    properties.put("String_Node_Str",uri);
    return graniteChannelBuilder.createComponentInstance(properties);
  }
 catch (  Exception e) {
    log.error(e,"String_Node_Str" + id);
    return null;
  }
}
Program: 153695
Project: 153695
Buggy source:
public ComponentInstance newGravityChannel(String id,String uri,String context){
  try {
    Dictionary properties=new Hashtable();
    properties.put("String_Node_Str",id);
    properties.put("String_Node_Str",context);
    properties.put("String_Node_Str","String_Node_Str");
    properties.put("String_Node_Str",uri);
    return channelBuilder.createComponentInstance(properties);
  }
 catch (  Exception e) {
    log.error(e,"String_Node_Str" + id);
    return null;
  }
}

Fixed version (ground truth):
public ComponentInstance newGravityChannel(String id,String uri,String context){
  try {
    Dictionary properties=new Hashtable();
    properties.put("String_Node_Str",id);
    properties.put("String_Node_Str",context);
    properties.put("String_Node_Str","String_Node_Str");
    properties.put("String_Node_Str",uri);
    return gravityChannelBuilder.createComponentInstance(properties);
  }
 catch (  Exception e) {
    log.error(e,"String_Node_Str" + id);
    return null;
  }
}
Program: 153696
Project: 153696
Buggy source:
@Override public Object readObject() throws IOException {
  OSGiGraniteClassUtil.setDestination(null);
  Object obj=super.readObject();
  if (obj instanceof AbstractMessage && !(obj instanceof CommandMessage)) {
    AbstractMessage message=(AbstractMessage)obj;
    OSGiGraniteClassUtil.setDestination(message.getDestination());
    if (Boolean.TRUE.equals(message.getHeader(Gravity.BYTEARRAY_BODY_HEADER))) {
      byte[] byteArray=(byte[])message.getBody();
      ByteArrayInputStream bais=new ByteArrayInputStream(byteArray);
      AMF3Deserializer deser=new AMF3Deserializer(bais);
      message.setBody(deser.readObject());
    }
  }
  return obj;
}

Fixed version (ground truth):
@Override public Object readObject() throws IOException {
  OSGiGraniteClassUtil.setDestination(null);
  Object obj=super.readObject();
  if (obj instanceof AbstractMessage && !(obj instanceof CommandMessage)) {
    AbstractMessage message=(AbstractMessage)obj;
    OSGiGraniteClassUtil.setDestination(message.getDestination());
    if (Boolean.TRUE.equals(message.getHeader(OSGiConstants.BYTEARRAY_BODY_HEADER))) {
      byte[] byteArray=(byte[])message.getBody();
      ByteArrayInputStream bais=new ByteArrayInputStream(byteArray);
      AMF3Deserializer deser=new AMF3Deserializer(bais);
      message.setBody(deser.readObject());
    }
  }
  return obj;
}
Program: 153698
Project: 153698
Buggy source:
@Validate public void start() throws MissingHandlerException, ConfigurationException, UnacceptableConfiguration {
  log.debug("String_Node_Str" + toString());
  if (servicesConfig.findChannelById(id) == null) {
    servicesConfig.addChannel(this);
    Dictionary properties=new Hashtable();
    properties.put("String_Node_Str",ENDPOINT_URI);
    Dictionary filters=new Hashtable();
    filters.put("String_Node_Str","String_Node_Str" + CONTEXT + "String_Node_Str");
    properties.put("String_Node_Str",filters);
    if (className.equalsIgnoreCase("String_Node_Str")) {
      servlet=gravityServletBuilder.createComponentInstance(properties);
    }
 else {
      servlet=graniteServletBuilder.createComponentInstance(properties);
    }
    started=true;
  }
 else {
    log.error("String_Node_Str" + id + "String_Node_Str");
  }
}

Fixed version (ground truth):
@Validate public void start(){
  log.debug("String_Node_Str" + toString());
  if (servicesConfig.findChannelById(id) == null) {
    try {
      Dictionary properties=new Hashtable();
      properties.put("String_Node_Str",ENDPOINT_URI);
      Dictionary filters=new Hashtable();
      filters.put("String_Node_Str","String_Node_Str" + CONTEXT + "String_Node_Str");
      properties.put("String_Node_Str",filters);
      if (className.equalsIgnoreCase("String_Node_Str")) {
        servlet=gravityServletBuilder.createComponentInstance(properties);
      }
 else {
        servlet=graniteServletBuilder.createComponentInstance(properties);
      }
      servicesConfig.addChannel(this);
      started=true;
    }
 catch (    Exception e) {
      log.error("String_Node_Str" + id + "String_Node_Str");
    }
  }
 else {
    log.error("String_Node_Str" + id + "String_Node_Str");
  }
}
Program: 153699
Project: 153699
Buggy source:
@Test public void channel(BundleContext context) throws IOException {
  assertThat("String_Node_Str",context,is(notNullValue()));
  setup(context);
  ServiceReference sr=osgi.getServiceReference("String_Node_Str");
  ServicesConfig sc=(ServicesConfig)osgi.getServiceObject(sr);
  ServiceReference sr2=osgi.getServiceReference("String_Node_Str");
  ConfigurationHelper ch=(ConfigurationHelper)osgi.getServiceObject(sr2);
  assertThat("String_Node_Str",sc,is(notNullValue()));
  ComponentInstance channel;
  channel=ch.newGraniteChannel("String_Node_Str","String_Node_Str");
  assertThat("String_Node_Str",sc.findChannelById("String_Node_Str"),is(notNullValue()));
  assertTrue("String_Node_Str",sc.findChannelById("String_Node_Str").getEndPoint().getUri().equals("String_Node_Str"));
  channel.dispose();
  assertThat("String_Node_Str",sc.findChannelById("String_Node_Str"),is(nullValue()));
  unsetup();
}

Fixed version (ground truth):
@Test public void channel(BundleContext context) throws IOException {
  assertThat("String_Node_Str",context,is(notNullValue()));
  setup(context);
  ServiceReference sr=osgi.getServiceReference("String_Node_Str");
  ServicesConfig sc=(ServicesConfig)osgi.getServiceObject(sr);
  ServiceReference sr2=osgi.getServiceReference("String_Node_Str");
  ConfigurationHelper ch=(ConfigurationHelper)osgi.getServiceObject(sr2);
  assertThat("String_Node_Str",sc,is(notNullValue()));
  ComponentInstance channel;
  channel=ch.newGraniteChannel("String_Node_Str","String_Node_Str","String_Node_Str");
  assertThat("String_Node_Str",sc.findChannelById("String_Node_Str"),is(notNullValue()));
  assertTrue("String_Node_Str",sc.findChannelById("String_Node_Str").getEndPoint().getUri().equals("String_Node_Str"));
  channel.dispose();
  assertThat("String_Node_Str",sc.findChannelById("String_Node_Str"),is(nullValue()));
  unsetup();
}
Program: 153702
Project: 153702
Buggy source:
protected void internalStart(){
  gravityPool=new GravityPool(gravityConfig);
  channelsTimer=new Timer();
  if (graniteConfig.isRegisterMBeans()) {
    try {
      ObjectName name=new ObjectName("String_Node_Str" + graniteConfig.getMBeanContextName());
      log.info("String_Node_Str",name);
      OpenMBean mBean=OpenMBean.createMBean(this);
      MBeanServerLocator.getInstance().register(mBean,name,true);
    }
 catch (    Exception e) {
      log.error(e,"String_Node_Str",graniteConfig.getMBeanContextName());
    }
  }
}

Fixed version (ground truth):
protected void internalStart(){
  gravityPool=new GravityPool(gravityConfig);
  channelsTimer=new Timer();
  if (graniteContext.getGraniteConfig().isRegisterMBeans()) {
    try {
      ObjectName name=new ObjectName("String_Node_Str" + graniteContext.getGraniteConfig().getMBeanContextName());
      log.info("String_Node_Str",name);
      OpenMBean mBean=OpenMBean.createMBean(this);
      MBeanServerLocator.getInstance().register(mBean,name,true);
    }
 catch (    Exception e) {
      log.error(e,"String_Node_Str",graniteContext.getGraniteConfig().getMBeanContextName());
    }
  }
}
Program: 153703
Project: 153703
Buggy source:
public GraniteConfig getGraniteConfig(){
  return graniteConfig;
}

Fixed version (ground truth):
public GraniteConfig getGraniteConfig(){
  return graniteContext.getGraniteConfig();
}
Program: 153704
Project: 153704
Buggy source:
public GraniteContext initThread(){
  return null;
}

Fixed version (ground truth):
public GraniteContext initThread(){
  return graniteContext;
}
Program: 153705
Project: 153705
Buggy source:
public ServicesConfig getServicesConfig(){
  return servicesConfig;
}

Fixed version (ground truth):
public ServicesConfig getServicesConfig(){
  return graniteContext.getServicesConfig();
}
Program: 153706
Project: 153706
Buggy source:
@Unbind public final synchronized void unbindDestination(final GraniteDestination destination){
  osgiServices.remove(destination.getId());
}

Fixed version (ground truth):
@Unbind public final synchronized void unbindDestination(final GraniteDestination destination){
  osgiServices.remove(destination.getId());
  CacheEntry ce=cacheEntries.remove(destination.getId());
  if (ce != null) {
    log.info("String_Node_Str" + ce.entry + "String_Node_Str"+ destination.getId()+ "String_Node_Str");
    ce.cache.remove(ce.entry);
  }
}
Program: 153707
Project: 153707
Buggy source:
final protected void changeItem(IStaticsPage ip){
  if (ip != null) {
    if (m_widget != null) {
      m_widget.setVisible(false);
      StaticsMain.this.remove(m_widget);
    }
    m_widget=ip.getWidget();
    StaticsMain.this.add(m_widget);
    m_widget.setLocation(20,60);
    m_widget.setSize(480,400);
    m_widget.setVisible(true);
  }
}

Fixed version (ground truth):
final protected void changeItem(IStaticsPage ip){
  if (ip != null) {
    if (m_widget != null) {
      StaticsMain.this.remove(m_widget);
    }
    m_widget=ip.getWidget();
    StaticsMain.this.add(m_widget);
    m_widget.setLocation(20,60);
    m_widget.setSize(480,400);
    m_widget.setVisible(true);
    this.pack();
  }
}
Program: 153708
Project: 153708
Buggy source:
protected static void Init(){
  if (StaticPages == null) {
    StaticPages=new ArrayList<IStaticsPage>();
    try {
      RegistePage(TestPage.class);
      RegistePage(TestPage2.class);
      RegistePage(HistoryFlowPage.class);
    }
 catch (    InstantiationException ex) {
      Logger.getLogger(StaticsMain.class.getName()).log(Level.SEVERE,null,ex);
    }
catch (    IllegalAccessException ex) {
      Logger.getLogger(StaticsMain.class.getName()).log(Level.SEVERE,null,ex);
    }
  }
}

Fixed version (ground truth):
protected static void Init(){
  if (StaticPages == null) {
    StaticPages=new ArrayList<IStaticsPage>();
    try {
      RegistePage(TestPage.class);
      RegistePage(TestPage2.class);
      RegistePage(DynamicFlowChartPage.class);
      RegistePage(AnalysisChartPage.class);
      RegistePage(HistoryFlowPage.class);
    }
 catch (    InstantiationException ex) {
      Logger.getLogger(StaticsMain.class.getName()).log(Level.SEVERE,null,ex);
    }
catch (    IllegalAccessException ex) {
      Logger.getLogger(StaticsMain.class.getName()).log(Level.SEVERE,null,ex);
    }
  }
}
Program: 153709
Project: 153709
Buggy source:
final protected void changeItem(IStaticsPage ip){
  if (ip != null) {
    if (m_widget != null) {
      StaticsMain.this.remove(m_widget);
    }
    m_widget=ip.getWidget();
    StaticsMain.this.add(m_widget);
    m_widget.setLocation(20,60);
    m_widget.setSize(480,400);
    m_widget.setVisible(true);
    this.pack();
  }
}

Fixed version (ground truth):
final protected void changeItem(IStaticsPage ip){
  if (ip != null) {
    if (m_widget != null) {
      m_widget.setVisible(false);
      StaticsMain.this.remove(m_widget);
    }
    m_widget=ip.getWidget();
    StaticsMain.this.add(m_widget);
    m_widget.setLocation(20,60);
    m_widget.setSize(480,400);
    m_widget.setVisible(true);
    this.pack();
  }
}
Program: 153710
Project: 153710
Buggy source:
private void initComponents(){
  try {
    if (SystemTray.isSupported()) {
      SystemTray st=SystemTray.getSystemTray();
      Image image=Toolkit.getDefaultToolkit().getImage("String_Node_Str");
      PopupMenu pm=new PopupMenu();
      MenuItem changeUserMenu=new MenuItem("String_Node_Str");
      changeUserMenu.addActionListener(new ActionListener(){
        public void actionPerformed(        ActionEvent e){
          onStaticsShow();
        }
      }
);
      MenuItem exitMenu=new MenuItem("String_Node_Str");
      exitMenu.addActionListener(new ActionListener(){
        public void actionPerformed(        ActionEvent e){
          System.exit(0);
        }
      }
);
      pm.add(changeUserMenu);
      pm.addSeparator();
      pm.add(exitMenu);
      TrayIcon ti=new TrayIcon(image,"String_Node_Str",pm);
      ti.setImageAutoSize(true);
      st.add(ti);
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
private void initComponents(){
  try {
    if (SystemTray.isSupported()) {
      SystemTray st=SystemTray.getSystemTray();
      PopupMenu pm=new PopupMenu();
      MenuItem changeUserMenu=new MenuItem("String_Node_Str");
      changeUserMenu.addActionListener(new ActionListener(){
        public void actionPerformed(        ActionEvent e){
          onStaticsShow();
        }
      }
);
      MenuItem exitMenu=new MenuItem("String_Node_Str");
      exitMenu.addActionListener(new ActionListener(){
        public void actionPerformed(        ActionEvent e){
          System.exit(0);
        }
      }
);
      pm.add(changeUserMenu);
      pm.addSeparator();
      pm.add(exitMenu);
      TrayIcon ti=new TrayIcon(new ImageIcon(getClass().getResource("String_Node_Str")).getImage(),"String_Node_Str",pm);
      ti.setImageAutoSize(true);
      st.add(ti);
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 153711
Project: 153711
Buggy source:
/** 
 * @param args the command line arguments
 */
public static void main(String args[]){
  CernetPacketFilter.Initialize("String_Node_Str");
  INetwork in=Network.Network.Instance();
  in.startListenThreads();
  java.awt.EventQueue.invokeLater(new Runnable(){
    public void run(){
      new SmallWindow().setVisible(true);
      new TrayIconWindow();
    }
  }
);
}

Fixed version (ground truth):
/** 
 * @param args the command line arguments
 */
public static void main(String args[]){
  CernetPacketFilter.Initialize("String_Node_Str");
  INetwork in=Network.Network.Instance();
  in.startListenThreads();
  java.awt.EventQueue.invokeLater(new Runnable(){
    public void run(){
      new SmallWindow().setVisible(true);
      TrayIconWindow.Instance();
    }
  }
);
}
Program: 153712
Project: 153712
Buggy source:
public void run(){
  new SmallWindow().setVisible(true);
  new TrayIconWindow();
}

Fixed version (ground truth):
public void run(){
  new SmallWindow().setVisible(true);
  TrayIconWindow.Instance();
}
Program: 153713
Project: 153713
Buggy source:
private void onStaticsShow(){
  if (m_mainWindow == null) {
    StaticsMain wd=new StaticsMain();
    wd.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    m_mainWindow=wd;
  }
  m_mainWindow.setVisible(true);
}

Fixed version (ground truth):
static public void onStaticsShow(){
  if (m_mainWindow == null) {
    StaticsMain wd=new StaticsMain();
    wd.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    m_mainWindow=wd;
  }
  m_mainWindow.setVisible(true);
}
Program: 153714
Project: 153714
Buggy source:
public void itemStateChanged(ItemEvent e){
  System.out.printf("String_Node_Str");
  IStaticsPage ip=(IStaticsPage)e.getItem();
  changeItem(ip);
}

Fixed version (ground truth):
public void itemStateChanged(ItemEvent e){
  IStaticsPage ip=(IStaticsPage)e.getItem();
  changeItem(ip);
}