nus-yam/ex-repair huggingface dataset:
Program: 152190
Project: 152190
Buggy source:
public void loadObjects(){
  World world=Instance.getWorld();
  for (  GameObjectLoc gameObject : Instance.getDataStore().loadGameObjectLocs()) {
    if (Config.f2pWildy && Formulae.isP2P(true,gameObject))     continue;
    if (Formulae.isP2P(gameObject) && !World.isMembers())     continue;
    world.registerGameObject(new GameObject(gameObject));
  }
  for (  ItemLoc item : Instance.getDataStore().loadItemLocs()) {
    if (Config.f2pWildy && Formulae.isP2P(true,item))     continue;
    if (Formulae.isP2P(item) && !World.isMembers())     continue;
    world.registerItem(new Item(item));
  }
  for (  NPCLoc npc : Instance.getDataStore().loadNPCLocs()) {
    if (Config.f2pWildy && Formulae.isP2P(true,npc))     continue;
    if (Formulae.isP2P(npc) && !World.isMembers())     continue;
    world.registerNpc(new Npc(npc));
  }
}

Fixed version (ground truth):
public void loadObjects() throws Exception {
  World world=Instance.getWorld();
  for (  GameObjectLoc gameObject : Instance.getDataStore().loadGameObjectLocs()) {
    if (Config.f2pWildy && Formulae.isP2P(true,gameObject))     continue;
    if (Formulae.isP2P(gameObject) && !World.isMembers())     continue;
    world.registerGameObject(new GameObject(gameObject));
  }
  for (  ItemLoc item : Instance.getDataStore().loadItemLocs()) {
    if (Config.f2pWildy && Formulae.isP2P(true,item))     continue;
    if (Formulae.isP2P(item) && !World.isMembers())     continue;
    world.registerItem(new Item(item));
  }
  for (  NPCLoc npc : Instance.getDataStore().loadNPCLocs()) {
    if (Config.f2pWildy && Formulae.isP2P(true,npc))     continue;
    if (Formulae.isP2P(npc) && !World.isMembers())     continue;
    world.registerNpc(new Npc(npc));
  }
}
Program: 152191
Project: 152191
Buggy source:
/** 
 * Loads the npc handling classes
 */
private void loadNpcHandlers(){
  NpcHandlerDef[] handlerDefs=Instance.getDataStore().loadNpcHandlers();
  for (  NpcHandlerDef handlerDef : handlerDefs) {
    try {
      String className=handlerDef.getClassName();
      Class<?> c=Class.forName(className);
      if (c != null) {
        NpcHandler handler=(NpcHandler)c.newInstance();
        for (        int npcID : handlerDef.getAssociatedNpcs()) {
          npcHandlers.put(npcID,handler);
        }
      }
    }
 catch (    Exception e) {
      Logger.error(e);
    }
  }
}

Fixed version (ground truth):
/** 
 * Loads the npc handling classes
 * @throws Exception 
 */
private void loadNpcHandlers() throws Exception {
  NpcHandlerDef[] handlerDefs=Instance.getDataStore().loadNpcHandlers();
  for (  NpcHandlerDef handlerDef : handlerDefs) {
    try {
      String className=handlerDef.getClassName();
      Class<?> c=Class.forName(className);
      if (c != null) {
        NpcHandler handler=(NpcHandler)c.newInstance();
        for (        int npcID : handlerDef.getAssociatedNpcs()) {
          npcHandlers.put(npcID,handler);
        }
      }
    }
 catch (    Exception e) {
      Logger.error(e);
    }
  }
}
Program: 152193
Project: 152193
Buggy source:
/** 
 * Increments and returns the current count.
 * @param hash - The hash of the player.
 */
private int incrementAndGet(long hash){
  final int count;
synchronized (playerToPacketCount) {
    count=playerToPacketCount.get(hash) + 1;
    playerToPacketCount.put(hash,count);
  }
  return count;
}

Fixed version (ground truth):
/** 
 * Increments and returns the current count.
 * @param hash - The hash of the player.
 */
private int incrementAndGet(long hash){
  final int count;
synchronized (playerToPacketCount) {
    Integer i=playerToPacketCount.get(hash);
    if (i == null) {
      count=1;
    }
 else {
      count=i + 1;
    }
    playerToPacketCount.put(hash,count);
  }
  return count;
}
Program: 152195
Project: 152195
Buggy source:
/** 
 * Gets the tile value as point x, y
 */
public TileValue getTileValue(int x,int y){
  if (!withinWorld(x,y)) {
    return null;
  }
  TileValue t=tileType[x][y];
  if (t == null) {
    t=new TileValue();
    tileType[x][y]=t;
  }
  return t;
}

Fixed version (ground truth):
/** 
 * Gets the tile value as point x, y
 */
public TileValue getTileValue(int x,int y){
  if (!withinWorld(x,y)) {
    return null;
  }
  TileValue t=tileType[x][y];
  if (t == null) {
    t=TileValue.create(0,new byte[6]);
    tileType[x][y]=t;
  }
  return t;
}
Program: 152196
Project: 152196
Buggy source:
/** 
 * Loads the npc handling classes
 * @throws Exception 
 */
private void loadNpcHandlers() throws Exception {
  NpcHandlerDef[] handlerDefs=Instance.getDataStore().loadNpcHandlers();
  for (  NpcHandlerDef handlerDef : handlerDefs) {
    try {
      String className=handlerDef.getClassName();
      Class<?> c=Class.forName(className);
      if (c != null) {
        NpcHandler handler=(NpcHandler)c.newInstance();
        for (        int npcID : handlerDef.getAssociatedNpcs()) {
          npcHandlers.put(npcID,handler);
        }
      }
    }
 catch (    Exception e) {
      Logger.error(e);
    }
  }
}

Fixed version (ground truth):
/** 
 * Loads the npc handling classes
 * @throws Exception
 */
private void loadNpcHandlers() throws Exception {
  NpcHandlerDef[] handlerDefs=Instance.getDataStore().loadNpcHandlers();
  for (  NpcHandlerDef handlerDef : handlerDefs) {
    try {
      String className=handlerDef.getClassName();
      Class<?> c=Class.forName(className);
      if (c != null) {
        NpcHandler handler=(NpcHandler)c.newInstance();
        for (        int npcID : handlerDef.getAssociatedNpcs()) {
          npcHandlers.put(npcID,handler);
        }
      }
    }
 catch (    Exception e) {
      Logger.error(e);
    }
  }
}
Program: 152197
Project: 152197
Buggy source:
/** 
 * Updates the map to include a new object
 */
public void registerObject(GameObject o){
  if (o.getGameObjectDef().getType() != 1 && o.getGameObjectDef().getType() != 2) {
    return;
  }
  int dir=o.getDirection();
  int width, height;
  if (dir == 0 || dir == 4) {
    width=o.getGameObjectDef().getWidth();
    height=o.getGameObjectDef().getHeight();
  }
 else {
    height=o.getGameObjectDef().getWidth();
    width=o.getGameObjectDef().getHeight();
  }
  for (int x=o.getX(); x < o.getX() + width; x++) {
    for (int y=o.getY(); y < o.getY() + height; y++) {
      if (o.getGameObjectDef().getType() == 1) {
        getTileValue(x,y).objectValue|=0x40;
      }
 else       if (dir == 0) {
        getTileValue(x,y).objectValue|=2;
        getTileValue(x - 1,y).objectValue|=8;
      }
 else       if (dir == 2) {
        getTileValue(x,y).objectValue|=4;
        getTileValue(x,y + 1).objectValue|=1;
      }
 else       if (dir == 4) {
        getTileValue(x,y).objectValue|=8;
        getTileValue(x + 1,y).objectValue|=2;
      }
 else       if (dir == 6) {
        getTileValue(x,y).objectValue|=1;
        getTileValue(x,y - 1).objectValue|=4;
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Updates the map to include a new object
 */
public void registerObject(GameObject o){
  if (o.getGameObjectDef().getType() != 1 && o.getGameObjectDef().getType() != 2) {
    return;
  }
  int dir=o.getDirection();
  int width, height;
  if (dir == 0 || dir == 4) {
    width=o.getGameObjectDef().getWidth();
    height=o.getGameObjectDef().getHeight();
  }
 else {
    height=o.getGameObjectDef().getWidth();
    width=o.getGameObjectDef().getHeight();
  }
  for (int x=o.getX(); x < o.getX() + width; x++) {
    for (int y=o.getY(); y < o.getY() + height; y++) {
      MutableTileValue t=new MutableTileValue(getTileValue(x,y));
      if (o.getGameObjectDef().getType() == 1) {
        t.objectValue|=0x40;
      }
 else       if (dir == 0) {
        t.objectValue|=2;
        MutableTileValue t1=new MutableTileValue(getTileValue(x - 1,y));
        t1.objectValue|=8;
        setTileValue(x - 1,y,t1.toTileValue());
      }
 else       if (dir == 2) {
        t.objectValue|=4;
        MutableTileValue t1=new MutableTileValue(getTileValue(x,y + 1));
        t1.objectValue|=1;
        setTileValue(x,y + 1,t1.toTileValue());
      }
 else       if (dir == 4) {
        t.objectValue|=8;
        MutableTileValue t1=new MutableTileValue(getTileValue(x + 1,y));
        t1.objectValue|=2;
        setTileValue(x + 1,y,t1.toTileValue());
      }
 else       if (dir == 6) {
        t.objectValue|=1;
        MutableTileValue t1=new MutableTileValue(getTileValue(x,y - 1));
        t1.objectValue|=4;
        setTileValue(x,y - 1,t1.toTileValue());
      }
      setTileValue(x,y,t.toTileValue());
    }
  }
}
Program: 152198
Project: 152198
Buggy source:
/** 
 * Removes a door from the map
 */
public void unregisterDoor(GameObject o){
  if (o.getDoorDef().getDoorType() != 1) {
    return;
  }
  int dir=o.getDirection();
  int x=o.getX(), y=o.getY();
  if (dir == 0) {
    getTileValue(x,y).objectValue&=0xfffe;
    getTileValue(x,y - 1).objectValue&=65535 - 4;
  }
 else   if (dir == 1) {
    getTileValue(x,y).objectValue&=0xfffd;
    getTileValue(x - 1,y).objectValue&=65535 - 8;
  }
 else   if (dir == 2) {
    getTileValue(x,y).objectValue&=0xffef;
  }
 else   if (dir == 3) {
    getTileValue(x,y).objectValue&=0xffdf;
  }
}

Fixed version (ground truth):
/** 
 * Removes a door from the map
 */
public void unregisterDoor(GameObject o){
  if (o.getDoorDef().getDoorType() != 1) {
    return;
  }
  int dir=o.getDirection();
  int x=o.getX(), y=o.getY();
  MutableTileValue t=new MutableTileValue(getTileValue(x,y));
  if (dir == 0) {
    t.objectValue&=0xfffe;
    MutableTileValue t1=new MutableTileValue(getTileValue(x,y - 1));
    t1.objectValue&=65535 - 4;
    setTileValue(x,y - 1,t1.toTileValue());
  }
 else   if (dir == 1) {
    t.objectValue&=0xfffd;
    MutableTileValue t1=new MutableTileValue(getTileValue(x - 1,y));
    t1.objectValue&=65535 - 8;
    setTileValue(x - 1,y,t1.toTileValue());
  }
 else   if (dir == 2) {
    t.objectValue&=0xffef;
  }
 else   if (dir == 3) {
    t.objectValue&=0xffdf;
  }
  setTileValue(x,y,t.toTileValue());
}
Program: 152199
Project: 152199
Buggy source:
/** 
 * Updates the map to include a new door
 */
public void registerDoor(GameObject o){
  if (o.getDoorDef().getDoorType() != 1) {
    return;
  }
  int dir=o.getDirection();
  int x=o.getX(), y=o.getY();
  if (dir == 0) {
    getTileValue(x,y).objectValue|=1;
    getTileValue(x,y - 1).objectValue|=4;
  }
 else   if (dir == 1) {
    getTileValue(x,y).objectValue|=2;
    getTileValue(x - 1,y).objectValue|=8;
  }
 else   if (dir == 2) {
    getTileValue(x,y).objectValue|=0x10;
  }
 else   if (dir == 3) {
    getTileValue(x,y).objectValue|=0x20;
  }
}

Fixed version (ground truth):
/** 
 * Updates the map to include a new door
 */
public void registerDoor(GameObject o){
  if (o.getDoorDef().getDoorType() != 1) {
    return;
  }
  int dir=o.getDirection();
  int x=o.getX(), y=o.getY();
  MutableTileValue t=new MutableTileValue(getTileValue(x,y));
  if (dir == 0) {
    t.objectValue|=1;
    MutableTileValue t1=new MutableTileValue(getTileValue(x,y - 1));
    t1.objectValue|=4;
    setTileValue(x,y - 1,t1.toTileValue());
  }
 else   if (dir == 1) {
    t.objectValue|=2;
    MutableTileValue t1=new MutableTileValue(getTileValue(x - 1,y));
    t1.objectValue|=8;
    setTileValue(x - 1,y,t1.toTileValue());
  }
 else   if (dir == 2) {
    t.objectValue|=0x10;
  }
 else   if (dir == 3) {
    t.objectValue|=0x20;
  }
  setTileValue(x,y,t.toTileValue());
}
Program: 152200
Project: 152200
Buggy source:
/** 
 * Removes an object from the map
 */
public void unregisterObject(GameObject o){
  if (o.getGameObjectDef().getType() != 1 && o.getGameObjectDef().getType() != 2) {
    return;
  }
  int dir=o.getDirection();
  int width, height;
  if (dir == 0 || dir == 4) {
    width=o.getGameObjectDef().getWidth();
    height=o.getGameObjectDef().getHeight();
  }
 else {
    height=o.getGameObjectDef().getWidth();
    width=o.getGameObjectDef().getHeight();
  }
  for (int x=o.getX(); x < o.getX() + width; x++) {
    for (int y=o.getY(); y < o.getY() + height; y++) {
      if (o.getGameObjectDef().getType() == 1) {
        getTileValue(x,y).objectValue&=0xffbf;
      }
 else       if (dir == 0) {
        getTileValue(x,y).objectValue&=0xfffd;
        getTileValue(x - 1,y).objectValue&=65535 - 8;
      }
 else       if (dir == 2) {
        getTileValue(x,y).objectValue&=0xfffb;
        getTileValue(x,y + 1).objectValue&=65535 - 1;
      }
 else       if (dir == 4) {
        getTileValue(x,y).objectValue&=0xfff7;
        getTileValue(x + 1,y).objectValue&=65535 - 2;
      }
 else       if (dir == 6) {
        getTileValue(x,y).objectValue&=0xfffe;
        getTileValue(x,y - 1).objectValue&=65535 - 4;
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Removes an object from the map
 */
public void unregisterObject(GameObject o){
  if (o.getGameObjectDef().getType() != 1 && o.getGameObjectDef().getType() != 2) {
    return;
  }
  int dir=o.getDirection();
  int width, height;
  if (dir == 0 || dir == 4) {
    width=o.getGameObjectDef().getWidth();
    height=o.getGameObjectDef().getHeight();
  }
 else {
    height=o.getGameObjectDef().getWidth();
    width=o.getGameObjectDef().getHeight();
  }
  for (int x=o.getX(); x < o.getX() + width; x++) {
    for (int y=o.getY(); y < o.getY() + height; y++) {
      MutableTileValue t=new MutableTileValue(getTileValue(x,y));
      if (o.getGameObjectDef().getType() == 1) {
        t.objectValue&=0xffbf;
      }
 else       if (dir == 0) {
        t.objectValue&=0xfffd;
        MutableTileValue t1=new MutableTileValue(getTileValue(x - 1,y));
        t1.objectValue&=65535 - 8;
        setTileValue(x - 1,y,t1.toTileValue());
      }
 else       if (dir == 2) {
        t.objectValue&=0xfffb;
        MutableTileValue t1=new MutableTileValue(getTileValue(x,y + 1));
        t1.objectValue&=65535 - 1;
        setTileValue(x,y + 1,t1.toTileValue());
      }
 else       if (dir == 4) {
        t.objectValue&=0xfff7;
        MutableTileValue t1=new MutableTileValue(getTileValue(x + 1,y));
        t1.objectValue&=65535 - 2;
        setTileValue(x + 1,y,t1.toTileValue());
      }
 else       if (dir == 6) {
        t.objectValue&=0xfffe;
        MutableTileValue t1=new MutableTileValue(getTileValue(x,y - 1));
        t1.objectValue&=65535 - 4;
        setTileValue(x,y - 1,t1.toTileValue());
      }
      setTileValue(x,y,t.toTileValue());
    }
  }
}
Program: 152202
Project: 152202
Buggy source:
@Override public PlayerSave loadPlayer(long user){
  PlayerSave save=new PlayerSave(user);
  save.setLocation(213,452);
  save.setAppearance((byte)2,(byte)8,(byte)14,(byte)0,(byte)1,(byte)2,true,0l);
  int[] arrayOfOnes=new int[Config.statArray.length];
  Arrays.fill(arrayOfOnes,1);
  save.setExp(arrayOfOnes.clone());
  save.setCurStats(arrayOfOnes.clone());
  return save;
}

Fixed version (ground truth):
@Override public PlayerSave loadPlayer(long user){
  PlayerSave save=new PlayerSave(user);
  save.setLocation(213,452);
  save.setAppearance((byte)2,(byte)8,(byte)14,(byte)0,(byte)1,(byte)2,true,0l);
  int[] exp=new int[Config.statArray.length];
  Arrays.fill(exp,1);
  int[] stats=exp.clone();
  exp[3]=1200;
  save.setExp(exp);
  stats[3]=10;
  save.setCurStats(stats);
  return save;
}
Program: 152203
Project: 152203
Buggy source:
public void handlePacket(Packet p,IoSession session) throws Exception {
  Player player=(Player)session.getAttachment();
  if (!player.canReport()) {
    player.getActionSender().sendMessage("String_Node_Str");
    return;
  }
  long temp=-121;
  byte b=1;
  try {
    temp=p.readLong();
    b=p.readByte();
  }
 catch (  Exception e) {
    return;
  }
 finally {
    if (temp == player.getUsernameHash()) {
      player.getActionSender().sendMessage("String_Node_Str");
      return;
    }
    AlertHandler.sendAlert(player.getUsername() + "String_Node_Str" + DataConversions.hashToUsername(temp),1);
    Instance.getReport().submitRepot(player.getUsernameHash(),temp,b,player);
    player.setLastReport();
    world.addEntryToSnapshots(new Activity(player.getUsername(),player.getUsername() + "String_Node_Str" + DataConversions.hashToUsername(temp)));
    player.getActionSender().sendMessage("String_Node_Str");
  }
}

Fixed version (ground truth):
public void handlePacket(Packet p,IoSession session) throws Exception {
  Player player=(Player)session.getAttachment();
  if (!player.canReport()) {
    player.getActionSender().sendMessage("String_Node_Str");
    return;
  }
  long temp=-121;
  byte b=1;
  try {
    temp=p.readLong();
    b=p.readByte();
  }
 catch (  Exception e) {
    return;
  }
 finally {
    if (temp == player.getUsernameHash()) {
      player.getActionSender().sendMessage("String_Node_Str");
      return;
    }
    AlertHandler.sendAlert(player.getUsername() + "String_Node_Str" + DataConversions.hashToUsername(temp),1);
    Instance.getReport().submitReport(player.getUsernameHash(),temp,b,player);
    player.setLastReport();
    world.addEntryToSnapshots(new Activity(player.getUsername(),player.getUsername() + "String_Node_Str" + DataConversions.hashToUsername(temp)));
    player.getActionSender().sendMessage("String_Node_Str");
  }
}
Program: 152204
Project: 152204
Buggy source:
public final void run(){
  if (stop && owner.withinRange(location,radius)) {
    owner.resetPath();
    arrived();
  }
 else   if (owner.hasMoved()) {
    return;
  }
 else   if (owner.withinRange(location,radius)) {
    arrived();
  }
  super.matchRunning=false;
}

Fixed version (ground truth):
public final void run(){
  if (stop && owner.withinRange(location,radius)) {
    arrived();
    owner.resetPath();
  }
 else   if (owner.hasMoved()) {
    return;
  }
 else   if (owner.withinRange(location,radius)) {
    arrived();
  }
  super.matchRunning=false;
}
Program: 152206
Project: 152206
Buggy source:
/** 
 * Performs coordinate checks on the locations in the P2P_LOCS array to decide whether items/object/npc's/general x,y coordinates are in P2P area
 * @param objs - ItemLoc, GameObjectLoc, NPCLoc or an Integer.
 * @return - true if inside P2P area, otherwise false.
 */
public static boolean isP2P(boolean f2pwildy,Object... objs){
  int x=-1;
  int y=-1;
  if (objs.length == 1) {
    Object obj=objs[0];
    if (obj instanceof GameObjectLoc) {
      x=((GameObjectLoc)obj).x;
      y=((GameObjectLoc)obj).y;
    }
 else     if ((obj instanceof ItemLoc)) {
      x=((ItemLoc)obj).x;
      y=((ItemLoc)obj).y;
    }
 else     if (obj instanceof NPCLoc) {
      x=((NPCLoc)obj).startX;
      y=((NPCLoc)obj).startY;
    }
  }
 else {
    if (objs[0] instanceof Integer && objs[1] instanceof Integer) {
      x=(Integer)objs[0];
      y=(Integer)objs[1];
    }
  }
  if (x == -1)   return false;
  if (!f2pwildy) {
    for (int i=0; i < P2P_LOCS.length; i++) {
      for (int ele=0; ele < 4; ele++) {
        if (x >= P2P_LOCS[i][0].getX() && x <= P2P_LOCS[i][1].getX() && y >= P2P_LOCS[i][0].getY() + ((ele) * 944) && y <= P2P_LOCS[i][1].getY() + ((ele) * 944))         return true;
      }
    }
  }
 else {
    for (int i=0; i < F2PWILD_LOCS.length; i++) {
      for (int ele=0; ele < 4; ele++) {
        if (x >= F2PWILD_LOCS[i][0].getX() && x <= F2PWILD_LOCS[i][1].getX() && y >= F2PWILD_LOCS[i][0].getY() + ((ele) * 944) && y <= F2PWILD_LOCS[i][1].getY() + ((ele) * 944))         return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Performs coordinate checks on the locations in the P2P_LOCS array to decide whether items/object/npc's/general x,y coordinates are in P2P area
 * @param objs - ItemLoc, GameObjectLoc, NPCLoc or an Integer.
 * @return - true if inside P2P area, otherwise false.
 */
public static boolean isP2P(Boolean f2pwildy,Object... objs){
  int x=-1;
  int y=-1;
  if (objs.length == 1) {
    Object obj=objs[0];
    if (obj instanceof GameObjectLoc) {
      x=((GameObjectLoc)obj).x;
      y=((GameObjectLoc)obj).y;
    }
 else     if ((obj instanceof ItemLoc)) {
      x=((ItemLoc)obj).x;
      y=((ItemLoc)obj).y;
    }
 else     if (obj instanceof NPCLoc) {
      x=((NPCLoc)obj).startX;
      y=((NPCLoc)obj).startY;
    }
  }
 else {
    if (objs[0] instanceof Integer && objs[1] instanceof Integer) {
      x=(Integer)objs[0];
      y=(Integer)objs[1];
    }
  }
  if (x == -1)   return false;
  if (!f2pwildy) {
    for (int i=0; i < P2P_LOCS.length; i++) {
      for (int ele=0; ele < 4; ele++) {
        if (x >= P2P_LOCS[i][0].getX() && x <= P2P_LOCS[i][1].getX() && y >= P2P_LOCS[i][0].getY() + ((ele) * 944) && y <= P2P_LOCS[i][1].getY() + ((ele) * 944))         return true;
      }
    }
  }
 else {
    for (int i=0; i < F2PWILD_LOCS.length; i++) {
      for (int ele=0; ele < 4; ele++) {
        if (x >= F2PWILD_LOCS[i][0].getX() && x <= F2PWILD_LOCS[i][1].getX() && y >= F2PWILD_LOCS[i][0].getY() + ((ele) * 944) && y <= F2PWILD_LOCS[i][1].getY() + ((ele) * 944))         return true;
      }
    }
  }
  return false;
}
Program: 152214
Project: 152214
Buggy source:
private boolean isBlockedShulkerBox(World world,BlockPosition blockPosition,IBlockData blockData){
  TileEntity tile=world.getTileEntity(blockPosition);
  if (!(tile instanceof TileEntityShulkerBox)) {
    return false;
  }
  EnumDirection enumDirection=blockData.get(BlockShulkerBox.a);
  if (((TileEntityShulkerBox)tile).p() == TileEntityShulkerBox.AnimationPhase.CLOSED) {
    AxisAlignedBB axisAlignedBB=Block.j.b(0.5F * enumDirection.getAdjacentX(),0.5F * enumDirection.getAdjacentY(),0.5F * enumDirection.getAdjacentZ()).a(enumDirection.getAdjacentX(),enumDirection.getAdjacentY(),enumDirection.getAdjacentZ());
    try {
      return world.a(axisAlignedBB.a(blockPosition.shift(enumDirection)));
    }
 catch (    Exception e) {
      return world.b(axisAlignedBB.a(blockPosition.shift(enumDirection)));
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean isBlockedShulkerBox(World world,BlockPosition blockPosition,IBlockData blockData){
  TileEntity tile=world.getTileEntity(blockPosition);
  if (!(tile instanceof TileEntityShulkerBox)) {
    return false;
  }
  EnumDirection enumDirection=blockData.get(BlockShulkerBox.a);
  if (((TileEntityShulkerBox)tile).p() == TileEntityShulkerBox.AnimationPhase.CLOSED) {
    AxisAlignedBB axisAlignedBB=Block.j.b(0.5F * enumDirection.getAdjacentX(),0.5F * enumDirection.getAdjacentY(),0.5F * enumDirection.getAdjacentZ()).a(enumDirection.getAdjacentX(),enumDirection.getAdjacentY(),enumDirection.getAdjacentZ());
    try {
      return world.a(axisAlignedBB.a(blockPosition.shift(enumDirection)));
    }
 catch (    NoSuchMethodError e) {
      return world.b(axisAlignedBB.a(blockPosition.shift(enumDirection)));
    }
  }
  return false;
}
Program: 152216
Project: 152216
Buggy source:
private boolean isConfigOutdated(){
  return getConfigVersion() < LATEST_CONFIG_VERSION;
}

Fixed version (ground truth):
private boolean isConfigOutdated(){
  return getConfigVersion() < CONFIG_VERSION;
}
Program: 152217
Project: 152217
Buggy source:
public SpecialPlayerInventory(Player p,boolean online){
  super(((CraftPlayer)p).getHandle());
  this.owner=(CraftPlayer)p;
  this.items=player.inventory.items;
  this.armor=player.inventory.armor;
  this.playerOnline=online;
  OpenInv.inventories.put(owner.getName().toLowerCase(),this);
}

Fixed version (ground truth):
public SpecialPlayerInventory(Player p,Boolean online){
  super(((CraftPlayer)p).getHandle());
  this.owner=(CraftPlayer)p;
  this.items=player.inventory.items;
  this.armor=player.inventory.armor;
  this.playerOnline=online;
  OpenInv.inventories.put(owner.getName().toLowerCase(),this);
}
Program: 152219
Project: 152219
Buggy source:
/** 
 * @see Listener#resume()
 */
public synchronized void resume(){
  if (acceptor != null && suspended) {
    try {
      LOG.debug("String_Node_Str");
      acceptor.bind(address);
      LOG.debug("String_Node_Str");
      updatePort();
    }
 catch (    IOException e) {
      LOG.error("String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
/** 
 * @see Listener#resume()
 */
public synchronized void resume(){
  if (acceptor != null && suspended) {
    try {
      LOG.debug("String_Node_Str");
      acceptor.bind(address);
      LOG.debug("String_Node_Str");
      updatePort();
      suspended=false;
    }
 catch (    IOException e) {
      LOG.error("String_Node_Str",e);
    }
  }
}
Program: 152220
Project: 152220
Buggy source:
private String[] validateSelectedTypes(final String types[]){
  if (types == null) {
    return null;
  }
  for (int i=0; i < types.length; ++i) {
    boolean bMatch=false;
    for (int j=0; j < AVAILABLE_TYPES.length; ++j) {
      if (AVAILABLE_TYPES[j].equalsIgnoreCase(types[i])) {
        bMatch=true;
        break;
      }
    }
    if (!bMatch) {
      return null;
    }
  }
  String[] selectedTypes=new String[types.length];
  System.arraycopy(types,0,selectedTypes,0,types.length);
  return selectedTypes;
}

Fixed version (ground truth):
private String[] validateSelectedTypes(final String types[]){
  if (types == null) {
    return new String[0];
  }
  List<String> selectedTypes=new ArrayList<String>();
  for (int i=0; i < types.length; ++i) {
    for (int j=0; j < AVAILABLE_TYPES.length; ++j) {
      if (AVAILABLE_TYPES[j].equalsIgnoreCase(types[i])) {
        selectedTypes.add(AVAILABLE_TYPES[j]);
        break;
      }
    }
  }
  return selectedTypes.toArray(new String[0]);
}
Program: 152221
Project: 152221
Buggy source:
/** 
 * Execute command.
 */
public void execute(final FtpIoSession session,final FtpServerContext context,final FtpRequest request) throws IOException, FtpException {
  session.resetState();
  String argument=request.getArgument();
  int spIndex=argument.indexOf(' ');
  if (spIndex == -1) {
    session.write(LocalizedFtpReply.translate(session,request,context,FtpReply.REPLY_503_BAD_SEQUENCE_OF_COMMANDS,"String_Node_Str",null));
    return;
  }
  String listTypes=argument.substring(spIndex + 1);
  StringTokenizer st=new StringTokenizer(listTypes,"String_Node_Str");
  String types[]=new String[st.countTokens()];
  for (int i=0; i < types.length; ++i) {
    types[i]=st.nextToken();
  }
  String[] validatedTypes=validateSelectedTypes(types);
  if (validatedTypes != null) {
    session.setAttribute("String_Node_Str",validatedTypes);
    session.write(LocalizedFtpReply.translate(session,request,context,FtpReply.REPLY_200_COMMAND_OKAY,"String_Node_Str",listTypes));
  }
 else {
    session.write(LocalizedFtpReply.translate(session,request,context,FtpReply.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS,"String_Node_Str",listTypes));
  }
}

Fixed version (ground truth):
/** 
 * Execute command.
 */
public void execute(final FtpIoSession session,final FtpServerContext context,final FtpRequest request) throws IOException, FtpException {
  session.resetState();
  String argument=request.getArgument();
  String listTypes;
  String types[];
  int spIndex=argument.indexOf(' ');
  if (spIndex == -1) {
    types=new String[0];
    listTypes="String_Node_Str";
  }
 else {
    listTypes=argument.substring(spIndex + 1);
    StringTokenizer st=new StringTokenizer(listTypes,"String_Node_Str");
    types=new String[st.countTokens()];
    for (int i=0; i < types.length; ++i) {
      types[i]=st.nextToken();
    }
  }
  String[] validatedTypes=validateSelectedTypes(types);
  if (validatedTypes != null) {
    session.setAttribute("String_Node_Str",validatedTypes);
    session.write(LocalizedFtpReply.translate(session,request,context,FtpReply.REPLY_200_COMMAND_OKAY,"String_Node_Str",listTypes));
  }
 else {
    session.write(LocalizedFtpReply.translate(session,request,context,FtpReply.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS,"String_Node_Str",listTypes));
  }
}
Program: 152222
Project: 152222
Buggy source:
/** 
 * Get ISO 8601 timestamp.
 */
public final static String getISO8601Date(long millis){
  StringBuffer sb=new StringBuffer(19);
  Calendar cal=new GregorianCalendar();
  cal.setTimeInMillis(millis);
  sb.append(cal.get(Calendar.YEAR));
  sb.append('-');
  int month=cal.get(Calendar.MONTH) + 1;
  if (month < 10) {
    sb.append('0');
  }
  sb.append(month);
  sb.append('-');
  int date=cal.get(Calendar.DATE);
  if (date < 10) {
    sb.append('0');
  }
  sb.append(date);
  sb.append('T');
  int hour=cal.get(Calendar.HOUR_OF_DAY);
  if (hour < 10) {
    sb.append('0');
  }
  sb.append(hour);
  sb.append(':');
  int min=cal.get(Calendar.MINUTE);
  if (min < 10) {
    sb.append('0');
  }
  sb.append(min);
  sb.append(':');
  int sec=cal.get(Calendar.SECOND);
  if (sec < 10) {
    sb.append('0');
  }
  sb.append(sec);
  return sb.toString();
}

Fixed version (ground truth):
/** 
 * Get ISO 8601 timestamp.
 */
public final static String getISO8601Date(long millis){
  StringBuffer sb=new StringBuffer(19);
  Calendar cal=new GregorianCalendar(TIME_ZONE_UTC);
  cal.setTimeInMillis(millis);
  sb.append(cal.get(Calendar.YEAR));
  sb.append('-');
  int month=cal.get(Calendar.MONTH) + 1;
  if (month < 10) {
    sb.append('0');
  }
  sb.append(month);
  sb.append('-');
  int date=cal.get(Calendar.DATE);
  if (date < 10) {
    sb.append('0');
  }
  sb.append(date);
  sb.append('T');
  int hour=cal.get(Calendar.HOUR_OF_DAY);
  if (hour < 10) {
    sb.append('0');
  }
  sb.append(hour);
  sb.append(':');
  int min=cal.get(Calendar.MINUTE);
  if (min < 10) {
    sb.append('0');
  }
  sb.append(min);
  sb.append(':');
  int sec=cal.get(Calendar.SECOND);
  if (sec < 10) {
    sb.append('0');
  }
  sb.append(sec);
  return sb.toString();
}
Program: 152223
Project: 152223
Buggy source:
/** 
 * Get unix style date string.
 */
public final static String getUnixDate(long millis){
  if (millis < 0) {
    return "String_Node_Str";
  }
  StringBuffer sb=new StringBuffer(16);
  Calendar cal=new GregorianCalendar();
  cal.setTimeInMillis(millis);
  sb.append(MONTHS[cal.get(Calendar.MONTH)]);
  sb.append(' ');
  int day=cal.get(Calendar.DATE);
  if (day < 10) {
    sb.append(' ');
  }
  sb.append(day);
  sb.append(' ');
  long sixMonth=15811200000L;
  long nowTime=System.currentTimeMillis();
  if (Math.abs(nowTime - millis) > sixMonth) {
    int year=cal.get(Calendar.YEAR);
    sb.append(' ');
    sb.append(year);
  }
 else {
    int hh=cal.get(Calendar.HOUR_OF_DAY);
    if (hh < 10) {
      sb.append('0');
    }
    sb.append(hh);
    sb.append(':');
    int mm=cal.get(Calendar.MINUTE);
    if (mm < 10) {
      sb.append('0');
    }
    sb.append(mm);
  }
  return sb.toString();
}

Fixed version (ground truth):
/** 
 * Get unix style date string.
 */
public final static String getUnixDate(long millis){
  if (millis < 0) {
    return "String_Node_Str";
  }
  StringBuffer sb=new StringBuffer(16);
  Calendar cal=new GregorianCalendar(TIME_ZONE_UTC);
  cal.setTimeInMillis(millis);
  sb.append(MONTHS[cal.get(Calendar.MONTH)]);
  sb.append(' ');
  int day=cal.get(Calendar.DATE);
  if (day < 10) {
    sb.append(' ');
  }
  sb.append(day);
  sb.append(' ');
  long sixMonth=15811200000L;
  long nowTime=System.currentTimeMillis();
  if (Math.abs(nowTime - millis) > sixMonth) {
    int year=cal.get(Calendar.YEAR);
    sb.append(' ');
    sb.append(year);
  }
 else {
    int hh=cal.get(Calendar.HOUR_OF_DAY);
    if (hh < 10) {
      sb.append('0');
    }
    sb.append(hh);
    sb.append(':');
    int mm=cal.get(Calendar.MINUTE);
    if (mm < 10) {
      sb.append('0');
    }
    sb.append(mm);
  }
  return sb.toString();
}
Program: 152224
Project: 152224
Buggy source:
/** 
 * Get FTP date.
 */
public final static String getFtpDate(long millis){
  StringBuffer sb=new StringBuffer(20);
  Calendar cal=new GregorianCalendar();
  cal.setTimeInMillis(millis);
  sb.append(cal.get(Calendar.YEAR));
  int month=cal.get(Calendar.MONTH) + 1;
  if (month < 10) {
    sb.append('0');
  }
  sb.append(month);
  int date=cal.get(Calendar.DATE);
  if (date < 10) {
    sb.append('0');
  }
  sb.append(date);
  int hour=cal.get(Calendar.HOUR_OF_DAY);
  if (hour < 10) {
    sb.append('0');
  }
  sb.append(hour);
  int min=cal.get(Calendar.MINUTE);
  if (min < 10) {
    sb.append('0');
  }
  sb.append(min);
  int sec=cal.get(Calendar.SECOND);
  if (sec < 10) {
    sb.append('0');
  }
  sb.append(sec);
  sb.append('.');
  int milli=cal.get(Calendar.MILLISECOND);
  if (milli < 100) {
    sb.append('0');
  }
  if (milli < 10) {
    sb.append('0');
  }
  sb.append(milli);
  return sb.toString();
}

Fixed version (ground truth):
/** 
 * Get FTP date.
 */
public final static String getFtpDate(long millis){
  StringBuffer sb=new StringBuffer(20);
  Calendar cal=new GregorianCalendar(TIME_ZONE_UTC);
  cal.setTimeInMillis(millis);
  sb.append(cal.get(Calendar.YEAR));
  int month=cal.get(Calendar.MONTH) + 1;
  if (month < 10) {
    sb.append('0');
  }
  sb.append(month);
  int date=cal.get(Calendar.DATE);
  if (date < 10) {
    sb.append('0');
  }
  sb.append(date);
  int hour=cal.get(Calendar.HOUR_OF_DAY);
  if (hour < 10) {
    sb.append('0');
  }
  sb.append(hour);
  int min=cal.get(Calendar.MINUTE);
  if (min < 10) {
    sb.append('0');
  }
  sb.append(min);
  int sec=cal.get(Calendar.SECOND);
  if (sec < 10) {
    sb.append('0');
  }
  sb.append(sec);
  sb.append('.');
  int milli=cal.get(Calendar.MILLISECOND);
  if (milli < 100) {
    sb.append('0');
  }
  if (milli < 10) {
    sb.append('0');
  }
  sb.append(milli);
  return sb.toString();
}
Program: 152225
Project: 152225
Buggy source:
public void testMDTMForFile() throws Exception {
  assertFalse(TEST_FILE1.exists());
  assertTrue(TEST_FILE1.createNewFile());
  Date expected=new Date(TEST_FILE1.lastModified());
  assertEquals(213,client.sendCommand("String_Node_Str" + TEST_FILE1.getName()));
  Date actual=FTP_DATE_FORMAT.parse(client.getReplyString().substring(4).trim());
  assertEquals(expected,actual);
}

Fixed version (ground truth):
public void testMDTMForFile() throws Exception {
  assertFalse(TEST_FILE1.exists());
  assertTrue(TEST_FILE1.createNewFile());
  Calendar expected=Calendar.getInstance(TimeZone.getTimeZone("String_Node_Str"));
  expected.clear();
  expected.setTimeInMillis(TEST_FILE1.lastModified());
  assertEquals(213,client.sendCommand("String_Node_Str" + TEST_FILE1.getName()));
  Calendar actual=Calendar.getInstance(TimeZone.getTimeZone("String_Node_Str"));
  actual.clear();
  actual.setTime(FTP_DATE_FORMAT.parse(client.getReplyString().substring(4).trim()));
  assertEquals(expected,actual);
}
Program: 152226
Project: 152226
Buggy source:
public long getLastModified(){
  return LAST_MODIFIED_IN_2005.getTime();
}

Fixed version (ground truth):
public long getLastModified(){
  return LAST_MODIFIED_IN_2005.getTimeInMillis();
}
Program: 152227
Project: 152227
Buggy source:
/** 
 * Get last modified time.
 * @return The timestamp of the last modified time for the {@link FtpFile}
 */
long getLastModified();

Fixed version (ground truth):
/** 
 * Get last modified time in UTC.
 * @return The timestamp of the last modified time for the {@link FtpFile}
 */
long getLastModified();
Program: 152229
Project: 152229
Buggy source:
public String toString(){
  int code=getCode();
  String notNullMessage=getMessage();
  if (notNullMessage == null) {
    notNullMessage="String_Node_Str";
  }
  StringBuffer sb=new StringBuffer();
  if (notNullMessage.indexOf('\n') == -1) {
    sb.append(code);
    sb.append("String_Node_Str");
    sb.append(notNullMessage);
    sb.append(CRLF);
  }
 else {
    String[] lines=notNullMessage.split("String_Node_Str");
    sb.append(code);
    sb.append("String_Node_Str");
    for (int i=0; i < lines.length; i++) {
      String line=lines[i];
      if (i + 1 == lines.length) {
        sb.append(code);
        sb.append("String_Node_Str");
      }
      sb.append(line);
      sb.append(CRLF);
    }
  }
  return sb.toString();
}

Fixed version (ground truth):
public String toString(){
  int code=getCode();
  String notNullMessage=getMessage();
  if (notNullMessage == null) {
    notNullMessage="String_Node_Str";
  }
  StringBuffer sb=new StringBuffer();
  if (notNullMessage.indexOf('\n') == -1) {
    sb.append(code);
    sb.append("String_Node_Str");
    sb.append(notNullMessage);
    sb.append(CRLF);
  }
 else {
    String[] lines=notNullMessage.split("String_Node_Str");
    sb.append(code);
    sb.append("String_Node_Str");
    for (int i=0; i < lines.length; i++) {
      String line=lines[i];
      if (i + 1 == lines.length) {
        sb.append(code);
        sb.append("String_Node_Str");
      }
      if (line.length() > 0 && Character.isDigit(line.charAt(0))) {
        sb.append("String_Node_Str");
      }
      sb.append(line);
      sb.append(CRLF);
    }
  }
  return sb.toString();
}
Program: 152231
Project: 152231
Buggy source:
/** 
 * Execute command
 */
public void execute(final FtpIoSession session,final FtpServerContext context,final FtpRequest request) throws IOException {
  session.resetState();
  session.write(LocalizedFtpReply.translate(session,request,context,FtpReply.REPLY_221_CLOSING_CONTROL_CONNECTION,"String_Node_Str",null));
  session.close(false).awaitUninterruptibly(10000);
  session.getDataConnection().closeDataConnection();
}

Fixed version (ground truth):
/** 
 * Execute command
 */
public void execute(final FtpIoSession session,final FtpServerContext context,final FtpRequest request) throws IOException {
  session.resetState();
  session.write(LocalizedFtpReply.translate(session,request,context,FtpReply.REPLY_221_CLOSING_CONTROL_CONNECTION,"String_Node_Str",null));
  LOG.debug("String_Node_Str");
  session.close(false).awaitUninterruptibly(10000);
  session.getDataConnection().closeDataConnection();
}
Program: 152234
Project: 152234
Buggy source:
public void sessionOpened(final FtpIoSession session) throws Exception {
  context.getFtpletContainer().onConnect(session.getFtpletSession());
  session.updateLastAccessTime();
  session.write(LocalizedFtpReply.translate(session,null,context,FtpReply.REPLY_220_SERVICE_READY,null,null));
}

Fixed version (ground truth):
public void sessionOpened(final FtpIoSession session) throws Exception {
  FtpletContainer ftplets=context.getFtpletContainer();
  FtpletResult ftpletRet;
  try {
    ftpletRet=ftplets.onConnect(session.getFtpletSession());
  }
 catch (  Exception e) {
    LOG.debug("String_Node_Str",e);
    ftpletRet=FtpletResult.DISCONNECT;
  }
  if (ftpletRet == FtpletResult.DISCONNECT) {
    LOG.debug("String_Node_Str");
    session.close(false).awaitUninterruptibly(10000);
  }
 else {
    session.updateLastAccessTime();
    session.write(LocalizedFtpReply.translate(session,null,context,FtpReply.REPLY_220_SERVICE_READY,null,null));
  }
}
Program: 152235
Project: 152235
Buggy source:
public void sessionClosed(final FtpIoSession session) throws Exception {
  try {
    context.getFtpletContainer().onDisconnect(session.getFtpletSession());
  }
 catch (  Exception e) {
    LOG.warn("String_Node_Str",e);
  }
  FileSystemView fs=session.getFileSystemView();
  if (fs != null) {
    try {
      fs.dispose();
    }
 catch (    Exception e) {
      LOG.warn("String_Node_Str",e);
    }
  }
  ServerFtpStatistics stats=((ServerFtpStatistics)context.getFtpStatistics());
  if (stats != null) {
    stats.setLogout(session);
    stats.setCloseConnection(session);
  }
}

Fixed version (ground truth):
public void sessionClosed(final FtpIoSession session) throws Exception {
  LOG.debug("String_Node_Str");
  try {
    context.getFtpletContainer().onDisconnect(session.getFtpletSession());
  }
 catch (  Exception e) {
    LOG.warn("String_Node_Str",e);
  }
  try {
    ServerDataConnectionFactory dc=session.getDataConnection();
    if (dc != null) {
      dc.closeDataConnection();
    }
  }
 catch (  Exception e) {
    LOG.warn("String_Node_Str",e);
  }
  FileSystemView fs=session.getFileSystemView();
  if (fs != null) {
    try {
      fs.dispose();
    }
 catch (    Exception e) {
      LOG.warn("String_Node_Str",e);
    }
  }
  ServerFtpStatistics stats=((ServerFtpStatistics)context.getFtpStatistics());
  if (stats != null) {
    stats.setLogout(session);
    stats.setCloseConnection(session);
    LOG.debug("String_Node_Str");
  }
 else {
    LOG.warn("String_Node_Str");
  }
  LOG.debug("String_Node_Str");
}
Program: 152236
Project: 152236
Buggy source:
/** 
 * Close data socket.
 */
public synchronized void closeDataConnection(){
  if (dataSoc != null) {
    try {
      dataSoc.close();
    }
 catch (    Exception ex) {
      LOG.warn("String_Node_Str",ex);
    }
    dataSoc=null;
  }
  if (servSoc != null) {
    try {
      servSoc.close();
    }
 catch (    Exception ex) {
      LOG.warn("String_Node_Str",ex);
    }
    FtpServerContext ctx=serverContext;
    if (ctx != null) {
      DataConnectionConfiguration dcc=session.getListener().getDataConnectionConfiguration();
      if (dcc != null) {
        dcc.releasePassivePort(port);
      }
    }
    servSoc=null;
  }
  requestTime=0L;
}

Fixed version (ground truth):
/** 
 * Close data socket. This method must be idempotent as we might call it multiple times during disconnect.
 */
public synchronized void closeDataConnection(){
  if (dataSoc != null) {
    try {
      dataSoc.close();
    }
 catch (    Exception ex) {
      LOG.warn("String_Node_Str",ex);
    }
    dataSoc=null;
  }
  if (servSoc != null) {
    try {
      servSoc.close();
    }
 catch (    Exception ex) {
      LOG.warn("String_Node_Str",ex);
    }
    if (session != null) {
      DataConnectionConfiguration dcc=session.getListener().getDataConnectionConfiguration();
      if (dcc != null) {
        dcc.releasePassivePort(port);
      }
    }
    servSoc=null;
  }
  requestTime=0L;
}
Program: 152237
Project: 152237
Buggy source:
/** 
 * Creates a new instance of <code>LocalizedFileTransferReply</code>.
 * @param code the reply code
 * @param message the detailed message
 * @param file the file or directory the data transfer is related to
 * @param bytesTransferred the number of bytes transferred
 */
protected LocalizedDataTransferFtpReply(int code,String message,FtpFile file,long bytesTransferred){
  super(code,message);
  this.file=file;
  this.bytesTransferred=bytesTransferred;
}

Fixed version (ground truth):
/** 
 * Creates a new instance of <code>LocalizedFileTransferReply</code>.
 * @param code the reply code
 * @param message the detailed message
 * @param file the file or directory the data transfer is related to
 * @param bytesTransferred the number of bytes transferred
 */
public LocalizedDataTransferFtpReply(int code,String message,FtpFile file,long bytesTransferred){
  super(code,message);
  this.file=file;
  this.bytesTransferred=bytesTransferred;
}
Program: 152238
Project: 152238
Buggy source:
/** 
 * Creates a new instance of <code>LocalizedFileTransferReply</code>.
 * @param code the reply code
 * @param message the detailed message
 * @param file the file or directory the data transfer is related to
 */
protected LocalizedFileActionFtpReply(int code,String message,FtpFile file){
  super(code,message);
  this.file=file;
}

Fixed version (ground truth):
/** 
 * Creates a new instance of <code>LocalizedFileTransferReply</code>.
 * @param code the reply code
 * @param message the detailed message
 * @param file the file or directory the data transfer is related to
 */
public LocalizedFileActionFtpReply(int code,String message,FtpFile file){
  super(code,message);
  this.file=file;
}
Program: 152239
Project: 152239
Buggy source:
/** 
 * Private constructor, only allow creating through factory method
 */
protected LocalizedFtpReply(int code,String message){
  super(code,message);
}

Fixed version (ground truth):
/** 
 * Creates a new instance of <code>LocalizedFtpReply</code>.
 * @param code the reply code
 * @param message the reply text
 */
public LocalizedFtpReply(int code,String message){
  super(code,message);
}
Program: 152240
Project: 152240
Buggy source:
/** 
 * Creates a new instance of <code>LocalizedRenameFtpReply</code>.
 * @param code the reply code
 * @param message the detailed message
 * @param from the old file
 * @param to the new file
 */
protected LocalizedRenameFtpReply(int code,String message,FtpFile from,FtpFile to){
  super(code,message);
  this.from=from;
  this.to=to;
}

Fixed version (ground truth):
/** 
 * Creates a new instance of <code>LocalizedRenameFtpReply</code>.
 * @param code the reply code
 * @param message the detailed message
 * @param from the old file
 * @param to the new file
 */
public LocalizedRenameFtpReply(int code,String message,FtpFile from,FtpFile to){
  super(code,message);
  this.from=from;
  this.to=to;
}
Program: 152242
Project: 152242
Buggy source:
@Override public boolean equals(Object obj){
  if (obj != null && obj instanceof NativeFtpFile) {
    return this.file.equals(((NativeFtpFile)obj).file);
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (obj != null && obj instanceof NativeFtpFile) {
    File thisCanonicalFile;
    File otherCanonicalFile;
    try {
      thisCanonicalFile=this.file.getCanonicalFile();
      otherCanonicalFile=((NativeFtpFile)obj).file.getCanonicalFile();
    }
 catch (    IOException e) {
      throw new RuntimeException("String_Node_Str",e);
    }
    return thisCanonicalFile.equals(otherCanonicalFile);
  }
  return false;
}
Program: 152243
Project: 152243
Buggy source:
/** 
 * @see Listener#resume()
 */
public synchronized void resume(){
  if (acceptor != null && suspended) {
    try {
      LOG.debug("String_Node_Str");
      acceptor.bind(address);
      LOG.debug("String_Node_Str");
    }
 catch (    IOException e) {
      LOG.error("String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
/** 
 * @see Listener#resume()
 */
public synchronized void resume(){
  if (acceptor != null && suspended) {
    try {
      LOG.debug("String_Node_Str");
      acceptor.bind(address);
      LOG.debug("String_Node_Str");
      updatePort();
    }
 catch (    IOException e) {
      LOG.error("String_Node_Str",e);
    }
  }
}
Program: 152245
Project: 152245
Buggy source:
protected FtpServerFactory createServer() throws Exception {
  assertTrue(USERS_FILE.getAbsolutePath() + "String_Node_Str",USERS_FILE.exists());
  FtpServerFactory serverFactory=new FtpServerFactory();
  serverFactory.setConnectionConfig(createConnectionConfigFactory().createConnectionConfig());
  ListenerFactory listenerFactory=new ListenerFactory();
  listenerFactory.setPort(port);
  listenerFactory.setDataConnectionConfiguration(createDataConnectionConfigurationFactory().createDataConnectionConfiguration());
  serverFactory.addListener("String_Node_Str",listenerFactory.createListener());
  PropertiesUserManagerFactory umFactory=new PropertiesUserManagerFactory();
  umFactory.setAdminName("String_Node_Str");
  umFactory.setPasswordEncryptor(new ClearTextPasswordEncryptor());
  umFactory.setFile(USERS_FILE);
  serverFactory.setUserManager(umFactory.createUserManager());
  return serverFactory;
}

Fixed version (ground truth):
protected FtpServerFactory createServer() throws Exception {
  assertTrue(USERS_FILE.getAbsolutePath() + "String_Node_Str",USERS_FILE.exists());
  FtpServerFactory serverFactory=new FtpServerFactory();
  serverFactory.setConnectionConfig(createConnectionConfigFactory().createConnectionConfig());
  ListenerFactory listenerFactory=new ListenerFactory();
  listenerFactory.setPort(0);
  listenerFactory.setDataConnectionConfiguration(createDataConnectionConfigurationFactory().createDataConnectionConfiguration());
  serverFactory.addListener("String_Node_Str",listenerFactory.createListener());
  PropertiesUserManagerFactory umFactory=new PropertiesUserManagerFactory();
  umFactory.setAdminName("String_Node_Str");
  umFactory.setPasswordEncryptor(new ClearTextPasswordEncryptor());
  umFactory.setFile(USERS_FILE);
  serverFactory.setUserManager(umFactory.createUserManager());
  return serverFactory;
}
Program: 152246
Project: 152246
Buggy source:
/** 
 * @throws IOException
 * @throws Exception
 */
protected void initServer() throws IOException, Exception {
  initPort();
  server=(DefaultFtpServer)createServer().createServer();
  if (isStartServer()) {
    server.start();
  }
}

Fixed version (ground truth):
/** 
 * @throws IOException
 * @throws Exception
 */
protected void initServer() throws IOException, Exception {
  server=(DefaultFtpServer)createServer().createServer();
  if (isStartServer()) {
    server.start();
  }
}
Program: 152247
Project: 152247
Buggy source:
protected void doConnect() throws Exception {
  try {
    client.connect("String_Node_Str",port);
  }
 catch (  FTPConnectionClosedException e) {
    Thread.sleep(200);
    client.connect("String_Node_Str",port);
  }
}

Fixed version (ground truth):
protected void doConnect() throws Exception {
  try {
    client.connect("String_Node_Str",getListenerPort());
  }
 catch (  FTPConnectionClosedException e) {
    Thread.sleep(200);
    client.connect("String_Node_Str",getListenerPort());
  }
}