nus-yam/ex-repair huggingface dataset:
Program: 151881
Project: 151881
Buggy source:
@Override public void load(){
  if (layered) {
    properties=(SortedProperties)defaultProperties.clone();
  }
 else {
    properties=new SortedProperties();
  }
  try {
    InputStream stream=new FileInputStream(getFile());
    try {
      properties.load(stream);
    }
  finally {
      stream.close();
    }
  }
 catch (  FileNotFoundException e) {
    System.out.println(getFilename() + "String_Node_Str");
    properties=(SortedProperties)defaultProperties.clone();
    save();
  }
catch (  IOException e) {
    System.out.println("String_Node_Str" + e);
    System.out.println("String_Node_Str" + getFilename());
  }
}

Fixed version (ground truth):
@Override public void load(){
  if (layered) {
    properties=(SortedProperties)defaultProperties.clone();
  }
 else {
    properties=new SortedProperties();
  }
  try {
    InputStream stream=new FileInputStream(getFile());
    try {
      properties.load(stream);
    }
  finally {
      stream.close();
    }
  }
 catch (  FileNotFoundException e) {
    missingFile();
    properties=(SortedProperties)defaultProperties.clone();
    save();
  }
catch (  IOException e) {
    System.out.println("String_Node_Str" + e);
    System.out.println("String_Node_Str" + getFilename());
  }
}
Program: 151883
Project: 151883
Buggy source:
/** 
 * PERMISSIONS 
 */
public boolean vanillaOnlineMode(){
  return !server.options.getBoolean("String_Node_Str") && server.options.getBoolean("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * PERMISSIONS 
 */
public boolean vanillaOnlineMode(){
  return false;
}
Program: 151884
Project: 151884
Buggy source:
@Override public void finalize(){
  timer.cancel();
  cleanLoginRequests();
}

Fixed version (ground truth):
@Override public void finalize(){
  try {
    timer.cancel();
  }
 catch (  Exception e) {
  }
  cleanLoginRequests();
}
Program: 151885
Project: 151885
Buggy source:
@Override public void save(){
  load();
  options.setProperty("String_Node_Str","String_Node_Str");
  if (simpleServerOptions.getBoolean("String_Node_Str")) {
    options.setProperty("String_Node_Str","String_Node_Str");
  }
 else {
    options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  }
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  super.save();
}

Fixed version (ground truth):
@Override public void save(){
  load();
  options.setProperty("String_Node_Str","String_Node_Str");
  options.setProperty("String_Node_Str","String_Node_Str");
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  super.save();
}
Program: 151886
Project: 151886
Buggy source:
public void handleOutput(String line){
  if (!server.options.getBoolean("String_Node_Str") && line.contains("String_Node_Str")) {
    return;
  }
  Integer[] ports=server.getRobotPorts();
  if (ports != null) {
    for (    Integer port : ports) {
      if (port != null) {
        if (line.contains(port.toString())) {
          server.removeRobotPort(port);
          return;
        }
      }
    }
  }
  if (line.contains("String_Node_Str")) {
synchronized (this) {
      loaded=true;
      notifyAll();
    }
  }
 else   if (line.contains("String_Node_Str") || line.contains("String_Node_Str")) {
    server.setSaving(false);
    if (server.options.getBoolean("String_Node_Str")) {
      server.runCommand("String_Node_Str",t("String_Node_Str"));
    }
  }
 else   if (line.contains("String_Node_Str")) {
    handleError(new Exception(line));
  }
 else   if (line.matches("String_Node_Str")) {
    return;
  }
 else   if (line.contains("String_Node_Str") && server.options.getBoolean("String_Node_Str")) {
    return;
  }
 else {
    Matcher connect=CONNECT.matcher(line);
    if (connect.find()) {
      if (server.bots.ninja(connect.group(1))) {
        return;
      }
    }
 else {
      Matcher disconnect=DISCONNECT.matcher(line);
      if (disconnect.find()) {
        if (server.bots.ninja(disconnect.group(1))) {
          return;
        }
      }
    }
  }
  server.addOutputLine(line);
  System.out.println(line);
}

Fixed version (ground truth):
public void handleOutput(String line){
  if (!server.options.getBoolean("String_Node_Str") && line.contains("String_Node_Str")) {
    return;
  }
  Integer[] ports=server.getRobotPorts();
  if (ports != null) {
    for (    Integer port : ports) {
      if (port != null) {
        if (line.contains(port.toString())) {
          server.removeRobotPort(port);
          return;
        }
      }
    }
  }
  if (ignoreLine()) {
    return;
  }
  if (line.contains("String_Node_Str")) {
synchronized (this) {
      loaded=true;
      notifyAll();
    }
  }
 else   if (line.contains("String_Node_Str") || line.contains("String_Node_Str")) {
    server.setSaving(false);
    if (server.options.getBoolean("String_Node_Str")) {
      server.runCommand("String_Node_Str",t("String_Node_Str"));
    }
  }
 else   if (line.contains("String_Node_Str")) {
    handleError(new Exception(line));
  }
 else   if (line.matches("String_Node_Str")) {
    return;
  }
 else   if (line.contains("String_Node_Str") && server.options.getBoolean("String_Node_Str")) {
    ignoreNextLines(3);
    return;
  }
 else {
    Matcher connect=CONNECT.matcher(line);
    if (connect.find()) {
      if (server.bots.ninja(connect.group(1))) {
        return;
      }
    }
 else {
      Matcher disconnect=DISCONNECT.matcher(line);
      if (disconnect.find()) {
        if (server.bots.ninja(disconnect.group(1))) {
          return;
        }
      }
    }
  }
  server.addOutputLine(line);
  System.out.println(line);
}
Program: 151887
Project: 151887
Buggy source:
private void sendMessagePacket(String message) throws IOException {
  if (message.length() > MESSAGE_SIZE) {
    System.out.println("String_Node_Str" + message);
    return;
  }
  write(0x03);
  write(message);
  packetFinished();
}

Fixed version (ground truth):
private void sendMessagePacket(String message) throws IOException {
  if (message.length() > MESSAGE_SIZE) {
    System.out.println("String_Node_Str" + message);
    return;
  }
  if (message.length() > 0) {
    write(0x03);
    write(message);
    packetFinished();
  }
}
Program: 151888
Project: 151888
Buggy source:
private void sendMessage(String message) throws IOException {
  if (message.length() > MESSAGE_SIZE) {
    int end=MESSAGE_SIZE - 1;
    while (end > 0 && message.charAt(end) != ' ') {
      end--;
    }
    if (end == 0) {
      end=MESSAGE_SIZE;
    }
 else {
      end++;
    }
    if (message.charAt(end) == '\u00a7') {
      end--;
    }
    String firstPart=message.substring(0,end);
    sendMessagePacket(firstPart);
    sendMessage(getLastColorCode(firstPart) + message.substring(end));
  }
 else {
    int end=message.length();
    if (message.charAt(end - 1) == '\u00a7') {
      end--;
    }
    sendMessagePacket(message.substring(0,end));
  }
}

Fixed version (ground truth):
private void sendMessage(String message) throws IOException {
  if (message.length() > 0) {
    if (message.length() > MESSAGE_SIZE) {
      int end=MESSAGE_SIZE - 1;
      while (end > 0 && message.charAt(end) != ' ') {
        end--;
      }
      if (end == 0) {
        end=MESSAGE_SIZE;
      }
 else {
        end++;
      }
      if (end > 0 && message.charAt(end) == '\u00a7') {
        end--;
      }
      String firstPart=message.substring(0,end);
      sendMessagePacket(firstPart);
      sendMessage(getLastColorCode(firstPart) + message.substring(end));
    }
 else {
      int end=message.length();
      if (message.charAt(end - 1) == '\u00a7') {
        end--;
      }
      sendMessagePacket(message.substring(0,end));
    }
  }
}
Program: 151890
Project: 151890
Buggy source:
public void removePlayerArea(Player player){
  String name=player.getName().toLowerCase();
  if (!playerHasArea(player)) {
    return;
  }
  String path="String_Node_Str" + escape(name) + "String_Node_Str";
  config.clearTree(path);
  if (config.getList("String_Node_Str").size() == 0) {
    config.addProperty("String_Node_Str","String_Node_Str");
  }
}

Fixed version (ground truth):
public void removePlayerArea(Player player){
  String name=player.getName().toLowerCase();
  if (!playerHasArea(player)) {
    return;
  }
  String path="String_Node_Str" + escape(name) + "String_Node_Str";
  config.clearTree(path);
  if (config.getList("String_Node_Str").size() == 0) {
    config.addProperty("String_Node_Str","String_Node_Str");
  }
  save();
}
Program: 151891
Project: 151891
Buggy source:
public Chest adjacentChest(Coordinate coordinate){
  Chest chest=chestAt(coordinate);
  if (chest == null)   chest=chestAt(coordinate.add(1,0,0));
  if (chest == null)   chest=chestAt(coordinate.add(1,0,0));
  if (chest == null)   chest=chestAt(coordinate.add(1,0,0));
  return chest;
}

Fixed version (ground truth):
public Chest adjacentChest(Coordinate coordinate){
  Chest chest=chestAt(coordinate);
  if (chest == null)   chest=chestAt(coordinate.add(1,0,0));
  if (chest == null)   chest=chestAt(coordinate.add(-1,0,0));
  if (chest == null)   chest=chestAt(coordinate.add(0,0,1));
  if (chest == null)   chest=chestAt(coordinate.add(0,0,-1));
  return chest;
}
Program: 151892
Project: 151892
Buggy source:
public Chest adjacentChest(Coordinate coordinate){
  Chest chest=chestAt(coordinate);
  if (chest == null) {
    chest=chestAt(coordinate.add(1,0,0));
  }
  if (chest == null) {
    chest=chestAt(coordinate.add(-1,0,0));
  }
  if (chest == null) {
    chest=chestAt(coordinate.add(0,0,1));
  }
  if (chest == null) {
    chest=chestAt(coordinate.add(0,0,-1));
  }
  return chest;
}

Fixed version (ground truth):
public Chest adjacentChest(Coordinate coordinate){
  Chest chest=chestAt(coordinate.add(1,0,0));
  if (chest == null) {
    chest=chestAt(coordinate.add(-1,0,0));
  }
  if (chest == null) {
    chest=chestAt(coordinate.add(0,0,1));
  }
  if (chest == null) {
    chest=chestAt(coordinate.add(0,0,-1));
  }
  return chest;
}
Program: 151893
Project: 151893
Buggy source:
public boolean parseCommand(String message){
  if (closed) {
    return true;
  }
  if (message.equals(server.getCommandParser().commandPrefix() + "String_Node_Str"))   message=lastCommand;
  PlayerCommand command=server.getCommandParser().getPlayerCommand(message);
  if (command == null) {
    return false;
  }
  boolean invalidCommand=command.getName() == null;
  if (invalidCommand && !commandAllowed(command.getName())) {
    addMessage("String_Node_Str");
    return true;
  }
  command.execute(this,message);
  lastCommand=message;
  return !((server.permissions.commandShouldPassThroughToMod(command.getName()) || server.options.getBoolean("String_Node_Str") || invalidCommand) && server.options.contains("String_Node_Str"));
}

Fixed version (ground truth):
public boolean parseCommand(String message){
  if (closed) {
    return true;
  }
  if (message.equals(server.getCommandParser().commandPrefix() + "String_Node_Str"))   message=lastCommand;
  PlayerCommand command=server.getCommandParser().getPlayerCommand(message);
  if (command == null) {
    return false;
  }
  boolean invalidCommand=command.getName() == null;
  if (!invalidCommand && !commandAllowed(command.getName())) {
    addMessage("String_Node_Str");
    return true;
  }
  command.execute(this,message);
  lastCommand=message;
  return !((server.permissions.commandShouldPassThroughToMod(command.getName()) || server.options.getBoolean("String_Node_Str") || invalidCommand) && server.options.contains("String_Node_Str"));
}
Program: 151894
Project: 151894
Buggy source:
public boolean parseCommand(String message){
  if (closed) {
    return true;
  }
  if (message.equals(server.getCommandParser().commandPrefix() + "String_Node_Str"))   message=lastCommand;
  PlayerCommand command=server.getCommandParser().getPlayerCommand(message);
  if (command == null) {
    return false;
  }
  boolean invalidCommand=command.getName() == null;
  if (!invalidCommand && !commandAllowed(command.getName())) {
    addMessage("String_Node_Str");
    return true;
  }
  command.execute(this,message);
  lastCommand=message;
  return !((server.permissions.commandShouldPassThroughToMod(command.getName()) || server.options.getBoolean("String_Node_Str") || invalidCommand) && server.options.contains("String_Node_Str"));
}

Fixed version (ground truth):
public boolean parseCommand(String message){
  if (closed) {
    return true;
  }
  if (message.equals(server.getCommandParser().commandPrefix() + "String_Node_Str"))   message=lastCommand;
  PlayerCommand command=server.getCommandParser().getPlayerCommand(message);
  if (command == null) {
    return false;
  }
  boolean invalidCommand=command.getName() == null;
  if (!invalidCommand && !commandAllowed(command.getName())) {
    addMessage("String_Node_Str");
    return true;
  }
  command.execute(this,message);
  lastCommand=message;
  return !((server.permissions.commandShouldPassThroughToMod(command.getName()) || server.options.getBoolean("String_Node_Str") || invalidCommand|| command instanceof ExternalCommand) && server.options.contains("String_Node_Str"));
}
Program: 151895
Project: 151895
Buggy source:
private void copyUnknownBlob() throws IOException {
  byte unknown=in.readByte();
  write(unknown);
  while (unknown != 0x7f) {
    int type=(unknown & 0xE0) >> 5;
switch (type) {
case 0:
      write(in.readByte());
    break;
case 1:
  write(in.readShort());
break;
case 2:
write(in.readInt());
break;
case 3:
write(in.readFloat());
break;
case 4:
write(in.readUTF());
break;
case 5:
write(in.readShort());
write(in.readByte());
write(in.readShort());
}
unknown=in.readByte();
write(unknown);
}
}

Fixed version (ground truth):
private void copyUnknownBlob() throws IOException {
  byte unknown=in.readByte();
  write(unknown);
  while (unknown != 0x7f) {
    int type=(unknown & 0xE0) >> 5;
switch (type) {
case 0:
      write(in.readByte());
    break;
case 1:
  write(in.readShort());
break;
case 2:
write(in.readInt());
break;
case 3:
write(in.readFloat());
break;
case 4:
write(readUTF16());
break;
case 5:
write(in.readShort());
write(in.readByte());
write(in.readShort());
}
unknown=in.readByte();
write(unknown);
}
}
Program: 151896
Project: 151896
Buggy source:
private void sendMessage(String message) throws IOException {
  write(0x03);
  write(message);
  packetFinished();
}

Fixed version (ground truth):
private void sendMessage(String message) throws IOException {
}
Program: 151898
Project: 151898
Buggy source:
@Override public void run(){
  try {
    while (run) {
      lastRead=System.currentTimeMillis();
      try {
        handlePacket();
        if (isServerTunnel) {
          while (player.hasMessages()) {
            sendMessage(player.getMessage());
          }
        }
        flushAll();
      }
 catch (      IOException e) {
        if (run && !player.isRobot()) {
          System.out.println("String_Node_Str" + e);
          System.out.println("String_Node_Str" + streamType + "String_Node_Str"+ player.getIPAddress());
        }
        break;
      }
    }
    try {
      if (player.isKicked()) {
        kick(player.getKickMsg());
      }
      flushAll();
    }
 catch (    IOException e) {
    }
  }
  finally {
    if (EXPENSIVE_DEBUG_LOGGING) {
      inputDumper.cleanup();
      outputDumper.cleanup();
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    while (run) {
      lastRead=System.currentTimeMillis();
      try {
        handlePacket();
        if (isServerTunnel) {
          while (player.hasMessages()) {
            sendMessage(player.getMessage());
          }
        }
        flushAll();
      }
 catch (      IOException e) {
        if (run && !player.isRobot()) {
          System.out.println("String_Node_Str" + e);
          System.out.println("String_Node_Str" + streamType + "String_Node_Str"+ player.getIPAddress());
          e.printStackTrace();
        }
        break;
      }
    }
    try {
      if (player.isKicked()) {
        kick(player.getKickMsg());
      }
      flushAll();
    }
 catch (    IOException e) {
    }
  }
  finally {
    if (EXPENSIVE_DEBUG_LOGGING) {
      inputDumper.cleanup();
      outputDumper.cleanup();
    }
  }
}
Program: 151899
Project: 151899
Buggy source:
@Override public void execute(Player player,String message){
  player.handleVisitRequests();
}

Fixed version (ground truth):
public void execute(Player player,String message){
  player.handleVisitRequests();
}
Program: 151900
Project: 151900
Buggy source:
private void freeze(int time){
  if (!frozen) {
    frozen=true;
    timer=new Timer();
    timer.schedule(new TimeFreezer(this,time),0,DELAY);
    player.addMessage("String_Node_Str");
  }
}

Fixed version (ground truth):
private void freeze(int time){
  if (!frozen) {
    frozen=true;
    timer=new Timer();
    int delay=DELAY;
    if (time == DAY) {
      delay=DELAY_DAY;
    }
 else     if (time == NIGHT) {
      delay=DELAY_NIGHT;
    }
    timer.schedule(new TimeFreezer(this,time),0,delay);
    player.addMessage("String_Node_Str");
  }
}
Program: 151901
Project: 151901
Buggy source:
public void execute(Player player,String message){
  server=player.getServer();
  this.player=player;
  String[] arguments=extractArguments(message);
  if (arguments.length == 0) {
    setTime(0);
    player.addMessage("String_Node_Str");
  }
 else   if (arguments.length >= 1) {
    String argument=arguments[0];
    int time=0;
    if (argument.equals("String_Node_Str"))     time=DAY;
 else     if (argument.equals("String_Node_Str"))     time=NIGHT;
 else {
      try {
        time=Integer.parseInt(argument);
      }
 catch (      NumberFormatException e) {
        player.addMessage("String_Node_Str");
        return;
      }
      if (time < 0 || time > 23999) {
        player.addMessage("String_Node_Str");
        return;
      }
    }
    if (arguments.length < 2)     setTime(time);
    if (arguments.length >= 2) {
      argument=arguments[1];
      if (argument.equals("String_Node_Str")) {
        freeze(time);
      }
 else       if (argument.equals("String_Node_Str")) {
        unfreeze();
      }
 else {
        player.addMessage("String_Node_Str");
      }
    }
  }
}

Fixed version (ground truth):
public void execute(Player player,String message){
  server=player.getServer();
  this.player=player;
  String[] arguments=extractArguments(message);
  if (arguments.length == 0) {
    usage();
  }
 else   if (arguments.length >= 1) {
    String argument=arguments[0];
    int time=0;
    if (argument.equals("String_Node_Str")) {
      time=DAY;
    }
 else     if (argument.equals("String_Node_Str")) {
      time=NIGHT;
    }
 else     if (argument.equals("String_Node_Str") || argument.equals("String_Node_Str")) {
      player.addMessage("String_Node_Str");
      usage();
      return;
    }
 else     if (argument.equals("String_Node_Str")) {
      unfreeze();
      return;
    }
 else {
      try {
        time=Integer.parseInt(argument);
      }
 catch (      NumberFormatException e) {
        player.addMessage("String_Node_Str");
        usage();
        return;
      }
      if (time < 0 || time > 23999) {
        player.addMessage("String_Node_Str");
        return;
      }
    }
    unfreeze();
    if (arguments.length < 2)     setTime(time);
    if (arguments.length >= 2) {
      argument=arguments[1];
      if (argument.equals("String_Node_Str")) {
        freeze(time);
      }
 else {
        player.addMessage("String_Node_Str");
      }
    }
  }
}
Program: 151902
Project: 151902
Buggy source:
public boolean ownsLock(Player player,int x,byte y,int z){
  Coordinate coordinate=new Coordinate(x,y,z);
  Chest chest=locations.get(coordinate);
  return (chest != null) && (chest.owner == player.getName() || chest.isOpen());
}

Fixed version (ground truth):
public boolean ownsLock(Player player,int x,byte y,int z){
  Coordinate coordinate=new Coordinate(x,y,z);
  Chest chest=locations.get(coordinate);
  return (chest != null) && (chest.owner.toLowerCase().equals(player.getName().toLowerCase()) || chest.isOpen());
}
Program: 151903
Project: 151903
Buggy source:
private void kickAllPlayers(){
  String message="String_Node_Str";
  if (restart) {
    message="String_Node_Str";
  }
  for (  Player p : playerList.getArray()) {
    p.kick(message);
  }
}

Fixed version (ground truth):
private void kickAllPlayers(){
  String message="String_Node_Str";
  if (restart) {
    message="String_Node_Str";
  }
  for (  Player player : playerList.getArray()) {
    player.kick(message);
  }
}
Program: 151905
Project: 151905
Buggy source:
public boolean setName(String name){
  name=name.trim();
  if (name.length() == 0 || this.name != null) {
    kick("String_Node_Str");
    return false;
  }
  if (server.options.getBoolean("String_Node_Str") && !server.whitelist.isWhitelisted(name)) {
    kick("String_Node_Str");
    return false;
  }
  this.name=name;
  updateGroup();
  watchdog.setName("String_Node_Str" + name);
  server.connectionLog("String_Node_Str",extsocket,name);
  server.playerList.addPlayer(this);
  return true;
}

Fixed version (ground truth):
public boolean setName(String name){
  name=name.trim();
  if (name.length() == 0 || this.name != null) {
    kick("String_Node_Str");
    return false;
  }
  if (server.options.getBoolean("String_Node_Str") && !server.whitelist.isWhitelisted(name)) {
    kick("String_Node_Str");
    return false;
  }
  if (server.playerList.findPlayerExact(name) != null) {
    kick("String_Node_Str");
    return false;
  }
  this.name=name;
  updateGroup();
  watchdog.setName("String_Node_Str" + name);
  server.connectionLog("String_Node_Str",extsocket,name);
  server.playerList.addPlayer(this);
  return true;
}
Program: 151906
Project: 151906
Buggy source:
public void close(){
  serverToClient.stop();
  clientToServer.stop();
}

Fixed version (ground truth):
public void close(){
  if (serverToClient != null) {
    serverToClient.stop();
  }
  if (clientToServer != null) {
    clientToServer.stop();
  }
  if (name != null) {
    server.playerList.removePlayer(this);
    name=null;
  }
}
Program: 151907
Project: 151907
Buggy source:
private void cleanup(){
  if (!closed) {
    closed=true;
    entityId=0;
    if (serverToClient != null) {
      serverToClient.stop();
    }
    if (clientToServer != null) {
      clientToServer.stop();
    }
    if (name != null) {
      server.playerList.removePlayer(this);
    }
    try {
      extsocket.close();
    }
 catch (    IOException e) {
    }
    try {
      intsocket.close();
    }
 catch (    IOException e) {
    }
    if (!isRobot) {
      System.out.println("String_Node_Str" + extsocket.getInetAddress().getHostAddress());
    }
  }
}

Fixed version (ground truth):
private void cleanup(){
  if (!closed) {
    closed=true;
    entityId=0;
    close();
    try {
      extsocket.close();
    }
 catch (    IOException e) {
    }
    try {
      intsocket.close();
    }
 catch (    IOException e) {
    }
    if (!isRobot) {
      System.out.println("String_Node_Str" + extsocket.getInetAddress().getHostAddress());
    }
  }
}
Program: 151908
Project: 151908
Buggy source:
@Override public void run(){
  try {
    while (run) {
      lastRead=System.currentTimeMillis();
      try {
        handlePacket();
        if (isServerTunnel) {
          while (player.hasMessages()) {
            sendMessage(player.getMessage());
          }
        }
        flushAll();
      }
 catch (      IOException e) {
        if (run) {
          e.printStackTrace();
          System.out.println(streamType + "String_Node_Str" + player.getName());
        }
        break;
      }
    }
    try {
      if (player.isKicked()) {
        kick(player.getKickMsg());
      }
      flushAll();
    }
 catch (    IOException e) {
    }
  }
  finally {
    if (EXPENSIVE_DEBUG_LOGGING) {
      inputDumper.cleanup();
      outputDumper.cleanup();
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    while (run) {
      lastRead=System.currentTimeMillis();
      try {
        handlePacket();
        if (isServerTunnel) {
          while (player.hasMessages()) {
            sendMessage(player.getMessage());
          }
        }
        flushAll();
      }
 catch (      IOException e) {
        if (run) {
          e.printStackTrace();
          System.out.println(streamType + "String_Node_Str" + player.getIPAddress());
        }
        break;
      }
    }
    try {
      if (player.isKicked()) {
        kick(player.getKickMsg());
      }
      flushAll();
    }
 catch (    IOException e) {
    }
  }
  finally {
    if (EXPENSIVE_DEBUG_LOGGING) {
      inputDumper.cleanup();
      outputDumper.cleanup();
    }
  }
}
Program: 151909
Project: 151909
Buggy source:
protected void loadDefaults(){
  defaultOptions=new Properties();
  InputStream stream=getClass().getResourceAsStream(resourceLocation + "String_Node_Str" + filename);
  try {
    try {
      defaultOptions.load(stream);
    }
  finally {
      stream.close();
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
    System.out.println("String_Node_Str" + filename);
  }
  options=new Properties(defaultOptions);
}

Fixed version (ground truth):
protected void loadDefaults(){
  defaultOptions=new Properties();
  InputStream stream=getClass().getResourceAsStream(resourceLocation + "String_Node_Str" + filename);
  try {
    try {
      defaultOptions.load(stream);
    }
  finally {
      stream.close();
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
    System.out.println("String_Node_Str" + filename);
  }
  options=(Properties)defaultOptions.clone();
}
Program: 151910
Project: 151910
Buggy source:
public void load(){
  options=new Properties(defaultOptions);
  File file=new File(filename);
  try {
    InputStream stream=new FileInputStream(file);
    try {
      options.load(stream);
    }
  finally {
      stream.close();
    }
  }
 catch (  FileNotFoundException e) {
    missingFile();
  }
catch (  IOException e) {
    e.printStackTrace();
    System.out.println("String_Node_Str" + filename);
  }
}

Fixed version (ground truth):
public void load(){
  options=(Properties)defaultOptions.clone();
  File file=new File(filename);
  try {
    InputStream stream=new FileInputStream(file);
    try {
      options.load(stream);
    }
  finally {
      stream.close();
    }
  }
 catch (  FileNotFoundException e) {
    missingFile();
  }
catch (  IOException e) {
    e.printStackTrace();
    System.out.println("String_Node_Str" + filename);
  }
}
Program: 151911
Project: 151911
Buggy source:
@Override protected void loadDefaults(){
}

Fixed version (ground truth):
@Override protected void loadDefaults(){
  defaultOptions=new Properties();
}
Program: 151912
Project: 151912
Buggy source:
@Override public void save(){
  options=new Properties();
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str","String_Node_Str");
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  super.save();
}

Fixed version (ground truth):
@Override public void save(){
  load();
  options=new Properties();
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str","String_Node_Str");
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  super.save();
}
Program: 151913
Project: 151913
Buggy source:
public void serialEvent(SerialPortEvent arg0){
  int data;
  try {
    while ((data=in.read()) > -1) {
      if (state == RCV_WAIT) {
        if (data == START_BYTE) {
          state=RCV_MSG;
          buffer_idx=0;
        }
      }
 else       if (state == RCV_MSG) {
        if (data == ESCAPE_BYTE) {
          state=RCV_ESC;
        }
 else         if (data == STOP_BYTE) {
          byte[] packet=new byte[buffer_idx];
          for (int i=0; i < buffer_idx; i++)           packet[i]=buffer[i];
          for (          JArduinoObserver o : observers) {
            o.receiveMsg(packet);
          }
          state=RCV_WAIT;
        }
 else         if (data == START_BYTE) {
          state=RCV_MSG;
          buffer_idx=0;
        }
 else {
          buffer[buffer_idx]=(byte)data;
          buffer_idx++;
        }
      }
 else       if (state == RCV_ESC) {
        buffer[buffer_idx]=(byte)data;
        buffer_idx++;
        state=RCV_MSG;
      }
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void serialEvent(SerialPortEvent arg0){
  int data;
  try {
    while ((data=in.read()) > -1) {
      if (state == RCV_WAIT) {
        if (data == START_BYTE) {
          state=RCV_MSG;
          buffer_idx=0;
        }
      }
 else       if (state == RCV_MSG) {
        if (data == ESCAPE_BYTE) {
          state=RCV_ESC;
        }
 else         if (data == STOP_BYTE) {
          byte[] packet=new byte[buffer_idx];
          for (int i=0; i < buffer_idx; i++) {
            packet[i]=buffer[i];
          }
          for (          JArduinoObserver o : observers) {
            o.receiveMsg(packet);
          }
          state=RCV_WAIT;
        }
 else         if (data == START_BYTE) {
          state=RCV_MSG;
          buffer_idx=0;
        }
 else {
          buffer[buffer_idx]=(byte)data;
          buffer_idx++;
        }
      }
 else       if (state == RCV_ESC) {
        buffer[buffer_idx]=(byte)data;
        buffer_idx++;
        state=RCV_MSG;
      }
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}
Program: 151914
Project: 151914
Buggy source:
public static void main(String[] args){
  String serialPort;
  if (args.length == 1) {
    serialPort=args[0];
  }
 else {
    serialPort=SerialSelectorGUI.selectSerialPort();
  }
  JArduino arduino=new ToneKeyKeyboard(serialPort);
  arduino.runArduinoProcess();
}

Fixed version (ground truth):
public static void main(String[] args){
  String serialPort;
  if (args.length == 1) {
    serialPort=args[0];
  }
 else {
    serialPort=Serial4JArduino.selectSerialPort();
  }
  JArduino arduino=new ToneKeyKeyboard(serialPort);
  arduino.runArduinoProcess();
}
Program: 151915
Project: 151915
Buggy source:
public static void main(String[] args){
  String serialPort;
  if (args.length == 1) {
    serialPort=args[0];
  }
 else {
    serialPort=SerialSelectorGUI.selectSerialPort();
  }
  JArduino arduino=new AnalogInOutSerial(serialPort);
  arduino.runArduinoProcess();
}

Fixed version (ground truth):
public static void main(String[] args){
  String serialPort;
  if (args.length == 1) {
    serialPort=args[0];
  }
 else {
    serialPort=Serial4JArduino.selectSerialPort();
  }
  JArduino arduino=new AnalogInOutSerial(serialPort);
  arduino.runArduinoProcess();
}
Program: 151916
Project: 151916
Buggy source:
public static void main(String[] args){
  String serialPort;
  if (args.length == 1) {
    serialPort=args[0];
  }
 else {
    serialPort=SerialSelectorGUI.selectSerialPort();
  }
  JArduino arduino=new AnalogInput(serialPort);
  arduino.runArduinoProcess();
}

Fixed version (ground truth):
public static void main(String[] args){
  String serialPort;
  if (args.length == 1) {
    serialPort=args[0];
  }
 else {
    serialPort=Serial4JArduino.selectSerialPort();
  }
  JArduino arduino=new AnalogInput(serialPort);
  arduino.runArduinoProcess();
}
Program: 151917
Project: 151917
Buggy source:
public static void main(String[] args){
  String serialPort;
  if (args.length == 1) {
    serialPort=args[0];
  }
 else {
    serialPort=SerialSelectorGUI.selectSerialPort();
  }
  JArduino arduino=new Blink(serialPort);
  arduino.runArduinoProcess();
}

Fixed version (ground truth):
public static void main(String[] args){
  String serialPort;
  if (args.length == 1) {
    serialPort=args[0];
  }
 else {
    serialPort=Serial4JArduino.selectSerialPort();
  }
  JArduino arduino=new Blink(serialPort);
  arduino.runArduinoProcess();
}
Program: 151918
Project: 151918
Buggy source:
public static void main(String[] args){
  String serialPort;
  if (args.length == 1) {
    serialPort=args[0];
  }
 else {
    serialPort=SerialSelectorGUI.selectSerialPort();
  }
  JArduino arduino=new Ping(serialPort);
  arduino.runArduinoProcess();
}

Fixed version (ground truth):
public static void main(String[] args){
  String serialPort;
  if (args.length == 1) {
    serialPort=args[0];
  }
 else {
    serialPort=Serial4JArduino.selectSerialPort();
  }
  JArduino arduino=new Ping(serialPort);
  arduino.runArduinoProcess();
}
Program: 151919
Project: 151919
Buggy source:
public static void main(String[] args){
  String serialPort;
  if (args.length == 1) {
    serialPort=args[0];
  }
 else {
    serialPort=SerialSelectorGUI.selectSerialPort();
  }
  JArduino arduino=new SimpleInterrupt(serialPort);
  arduino.runArduinoProcess();
}

Fixed version (ground truth):
public static void main(String[] args){
  String serialPort;
  if (args.length == 1) {
    serialPort=args[0];
  }
 else {
    serialPort=Serial4JArduino.selectSerialPort();
  }
  JArduino arduino=new SimpleInterrupt(serialPort);
  arduino.runArduinoProcess();
}
Program: 151920
Project: 151920
Buggy source:
public static void main(String[] args){
  String serialPort;
  if (args.length == 1) {
    serialPort=args[0];
  }
 else {
    serialPort=SerialSelectorGUI.selectSerialPort();
  }
  JArduino arduino=new Button(serialPort);
  arduino.runArduinoProcess();
}

Fixed version (ground truth):
public static void main(String[] args){
  String serialPort;
  if (args.length == 1) {
    serialPort=args[0];
  }
 else {
    serialPort=Serial4JArduino.selectSerialPort();
  }
  JArduino arduino=new Button(serialPort);
  arduino.runArduinoProcess();
}
Program: 151921
Project: 151921
Buggy source:
public static void main(String[] args){
  String serialPort;
  if (args.length == 1) {
    serialPort=args[0];
  }
 else {
    serialPort=SerialSelectorGUI.selectSerialPort();
  }
  JArduino arduino=new StateChangeDetection(serialPort);
  arduino.runArduinoProcess();
}

Fixed version (ground truth):
public static void main(String[] args){
  String serialPort;
  if (args.length == 1) {
    serialPort=args[0];
  }
 else {
    serialPort=Serial4JArduino.selectSerialPort();
  }
  JArduino arduino=new StateChangeDetection(serialPort);
  arduino.runArduinoProcess();
}
Program: 151922
Project: 151922
Buggy source:
public static void main(String[] args){
  String serialPort;
  if (args.length == 1) {
    serialPort=args[0];
  }
 else {
    serialPort=SerialSelectorGUI.selectSerialPort();
  }
  JArduino arduino=new ToneKeyboard(serialPort);
  arduino.runArduinoProcess();
}

Fixed version (ground truth):
public static void main(String[] args){
  String serialPort;
  if (args.length == 1) {
    serialPort=args[0];
  }
 else {
    serialPort=Serial4JArduino.selectSerialPort();
  }
  JArduino arduino=new ToneKeyboard(serialPort);
  arduino.runArduinoProcess();
}
Program: 151923
Project: 151923
Buggy source:
public static void main(String[] args){
  String serialPort;
  if (args.length == 1) {
    serialPort=args[0];
  }
 else {
    serialPort=SerialSelectorGUI.selectSerialPort();
  }
  JArduino arduino=new ToneMelody(serialPort);
  arduino.runArduinoProcess();
}

Fixed version (ground truth):
public static void main(String[] args){
  String serialPort;
  if (args.length == 1) {
    serialPort=args[0];
  }
 else {
    serialPort=Serial4JArduino.selectSerialPort();
  }
  JArduino arduino=new ToneMelody(serialPort);
  arduino.runArduinoProcess();
}
Program: 151924
Project: 151924
Buggy source:
public static void main(String[] args){
  String serialPort;
  if (args.length == 1) {
    serialPort=args[0];
  }
 else {
    serialPort=SerialSelectorGUI.selectSerialPort();
  }
  JArduino arduino=new ToneMultiple(serialPort);
  arduino.runArduinoProcess();
}

Fixed version (ground truth):
public static void main(String[] args){
  String serialPort;
  if (args.length == 1) {
    serialPort=args[0];
  }
 else {
    serialPort=Serial4JArduino.selectSerialPort();
  }
  JArduino arduino=new ToneMultiple(serialPort);
  arduino.runArduinoProcess();
}
Program: 151925
Project: 151925
Buggy source:
public static void main(String[] args){
  String serialPort;
  if (args.length == 1) {
    serialPort=args[0];
  }
 else {
    serialPort=SerialSelectorGUI.selectSerialPort();
  }
  JArduino arduino=new TonePitchFollower(serialPort);
  arduino.runArduinoProcess();
}

Fixed version (ground truth):
public static void main(String[] args){
  String serialPort;
  if (args.length == 1) {
    serialPort=args[0];
  }
 else {
    serialPort=Serial4JArduino.selectSerialPort();
  }
  JArduino arduino=new TonePitchFollower(serialPort);
  arduino.runArduinoProcess();
}
Program: 151926
Project: 151926
Buggy source:
public static void main(String[] args){
  String serialPort;
  if (args.length == 1) {
    serialPort=args[0];
  }
 else {
    serialPort=SerialSelectorGUI.selectSerialPort();
  }
  Serial4JArduino device=null;
  try {
    device=new Serial4JArduino(serialPort);
    InteractiveJArduinoDataControllerClient controller2=new InteractiveJArduinoDataControllerClient();
    device.register(controller2);
    controller2.register(device);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
 finally {
    device.close();
  }
}

Fixed version (ground truth):
public static void main(String[] args){
  String serialPort;
  if (args.length == 1) {
    serialPort=args[0];
  }
 else {
    serialPort=Serial4JArduino.selectSerialPort();
  }
  Serial4JArduino device=null;
  try {
    device=new Serial4JArduino(serialPort);
    InteractiveJArduinoDataControllerClient controller2=new InteractiveJArduinoDataControllerClient();
    device.register(controller2);
    controller2.register(device);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
 finally {
    device.close();
  }
}
Program: 151927
Project: 151927
Buggy source:
public static void main(String[] args){
  Serial4JArduino device=null;
  try {
    String serialPort="String_Node_Str";
    if (args.length == 1) {
      serialPort=args[0];
    }
 else {
      serialPort=Serial4JArduino.selectSerialPort();
    }
    device=new Serial4JArduino(serialPort);
    InteractiveJArduinoDataControllerClientAdvanced controller=new InteractiveJArduinoDataControllerClientAdvanced();
    device.register(controller);
    controller.register(device);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
 finally {
    device.close();
  }
}

Fixed version (ground truth):
public static void main(String[] args){
  Serial4JArduino device=null;
  String serialPort=null;
  try {
    if (args.length == 1) {
      serialPort=args[0];
    }
 else {
      serialPort=Serial4JArduino.selectSerialPort();
    }
    InteractiveJArduinoDataControllerClientAdvanced controller=new InteractiveJArduinoDataControllerClientAdvanced();
    if (serialPort != null) {
      device=new Serial4JArduino(serialPort);
      device.register(controller);
      controller.register(device);
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
 finally {
    if (device != null) {
      device.close();
    }
  }
}
Program: 151928
Project: 151928
Buggy source:
/** 
 * Return a List of Objects from a single table column given a SQL Key using an SQL statement matching the sqlKey String in a properties file loaded via Yank.addSQLStatements(...).
 * @param sqlKey The SQL Key found in a properties file corresponding to the desired SQL statement value
 * @param params The replacement parameters
 * @param columnType The Class of the desired return Objects matching the table
 * @return The Column as a List
 * @throws SQLStatementNotFoundException if an SQL statement could not be found for the given sqlKey String
 */
public static <T>List<T> queryColumnSQLKey(String sqlKey,String columnName,Class<T> columnType,Object[] params){
  String sql=YANK_POOL_MANAGER.getMergedSqlProperties().getProperty(sqlKey);
  if (sql == null || sql.equalsIgnoreCase("String_Node_Str")) {
    throw new SQLStatementNotFoundException();
  }
 else {
    return queryBeanList(sql,columnType,params);
  }
}

Fixed version (ground truth):
/** 
 * Return a List of Objects from a single table column given a SQL Key using an SQL statement matching the sqlKey String in a properties file loaded via Yank.addSQLStatements(...).
 * @param sqlKey The SQL Key found in a properties file corresponding to the desired SQL statement value
 * @param params The replacement parameters
 * @param columnType The Class of the desired return Objects matching the table
 * @return The Column as a List
 * @throws SQLStatementNotFoundException if an SQL statement could not be found for the given sqlKey String
 */
public static <T>List<T> queryColumnSQLKey(String sqlKey,String columnName,Class<T> columnType,Object[] params){
  String sql=YANK_POOL_MANAGER.getMergedSqlProperties().getProperty(sqlKey);
  if (sql == null || sql.equalsIgnoreCase("String_Node_Str")) {
    throw new SQLStatementNotFoundException();
  }
 else {
    return queryColumn(sql,columnName,columnType,params);
  }
}
Program: 151929
Project: 151929
Buggy source:
/** 
 * Return just one scalar given a SQL Key using an SQL statement matching the sqlKey String in a properties file loaded via Yank.addSQLStatements(...). If more than one row match the query, only the first row is returned.
 * @param sqlKey The SQL Key found in a properties file corresponding to the desired SQL statement value
 * @param scalarType The Class of the desired return scalar matching the table
 * @param params The replacement parameters
 * @return The Object
 * @throws SQLStatementNotFoundException if an SQL statement could not be found for the given sqlKey String
 */
public static <T>T queryScalarSQLKey(String sqlKey,Class<T> scalarType,Object[] params){
  String sql=YANK_POOL_MANAGER.getMergedSqlProperties().getProperty(sqlKey);
  if (sql == null || sql.equalsIgnoreCase("String_Node_Str")) {
    throw new SQLStatementNotFoundException();
  }
 else {
    return queryBean(sql,scalarType,params);
  }
}

Fixed version (ground truth):
/** 
 * Return just one scalar given a SQL Key using an SQL statement matching the sqlKey String in a properties file loaded via Yank.addSQLStatements(...). If more than one row match the query, only the first row is returned.
 * @param sqlKey The SQL Key found in a properties file corresponding to the desired SQL statement value
 * @param scalarType The Class of the desired return scalar matching the table
 * @param params The replacement parameters
 * @return The Object
 * @throws SQLStatementNotFoundException if an SQL statement could not be found for the given sqlKey String
 */
public static <T>T queryScalarSQLKey(String sqlKey,Class<T> scalarType,Object[] params){
  String sql=YANK_POOL_MANAGER.getMergedSqlProperties().getProperty(sqlKey);
  if (sql == null || sql.equalsIgnoreCase("String_Node_Str")) {
    throw new SQLStatementNotFoundException();
  }
 else {
    return queryScalar(sql,scalarType,params);
  }
}
Program: 151930
Project: 151930
Buggy source:
/** 
 * Init method without a MYSQL_SQL.properties file
 * @param dbProperties
 */
public void init(Properties dbProperties){
  logger.info("String_Node_Str");
  if (dbProperties == null) {
    logger.error("String_Node_Str");
  }
  sqlProperties=new Properties();
  loadDriver(dbProperties);
  createPools(dbProperties);
}

Fixed version (ground truth):
/** 
 * Init method without a MYSQL_SQL.properties file
 * @param dbProperties
 */
public void init(Properties dbProperties){
  logger.info("String_Node_Str");
  if (dbProperties == null) {
    logger.error("String_Node_Str");
  }
  this.sqlProperties=new Properties();
  createPools(dbProperties);
}
Program: 151931
Project: 151931
Buggy source:
/** 
 * Returns an open connection. If no one is available, and the max number of connections has not been reached, a new connection is created.
 * @param poolName The pool name as defined in the properties file
 * @return Connection, the connection or null
 */
public Connection getConnection(String poolName){
  DBConnectionPool pool=pools.get(poolName);
  if (pool != null) {
    return pool.getConnection();
  }
 else {
    logger.error("String_Node_Str" + poolName);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Returns an open connection. If no one is available, and the max number of connections has not been reached, a new connection is created.
 * @param poolName The pool name as defined in the properties file
 * @return Connection, the connection or null if the number of connections in use exceeds the max allowed connections
 */
public Connection getConnection(String poolName){
  DBConnectionPool pool=pools.get(poolName);
  if (pool != null) {
    return pool.getConnection();
  }
 else {
    logger.error("String_Node_Str" + poolName);
    return null;
  }
}
Program: 151933
Project: 151933
Buggy source:
/** 
 * Closes all open connections and deregisters all drivers.
 */
public synchronized void release(){
  logger.info("String_Node_Str");
  Set<String> allPools=pools.keySet();
  for (Iterator<String> iterator=allPools.iterator(); iterator.hasNext(); ) {
    String poolName=iterator.next();
    logger.debug("String_Node_Str" + poolName + "String_Node_Str");
    pools.get(poolName).release();
  }
  try {
    DriverManager.deregisterDriver(jdbcDriver);
  }
 catch (  SQLException e) {
    logger.error("String_Node_Str" + jdbcDriver.getClass().getName(),e);
  }
  logger.info("String_Node_Str" + jdbcDriver.getClass().getName());
}

Fixed version (ground truth):
/** 
 * Closes all open connections
 */
public synchronized void release(){
  logger.info("String_Node_Str");
  Set<String> allPools=pools.keySet();
  for (Iterator<String> iterator=allPools.iterator(); iterator.hasNext(); ) {
    String poolName=iterator.next();
    logger.debug("String_Node_Str" + poolName + "String_Node_Str");
    pools.get(poolName).release();
  }
}