nus-yam/ex-repair huggingface dataset:
Program: 12890
Project: 12890
Buggy source:
public AbstractRouter(BlockFace from,org.bukkit.Location loc,boolean isOldVersion){
  super(loc);
  this.setFrom(from);
  this.addIO(from,loc.getBlock());
  this.IsOldVersion=isOldVersion;
}

Fixed version (ground truth):
public AbstractRouter(BlockFace from,org.bukkit.Location loc,boolean isOldVersion){
  super(loc);
  this.setFrom(from);
  this.IsOldVersion=isOldVersion;
  this.addIO(from,loc.getBlock());
}
Program: 12891
Project: 12891
Buggy source:
BC9001(org.bukkit.block.Block block,org.bukkit.entity.Vehicle vehicle){
  super(block,vehicle);
  this.netmask=8;
}

Fixed version (ground truth):
BC9001(org.bukkit.block.Block block,org.bukkit.entity.Vehicle vehicle){
  super(block,vehicle);
  this.netmask=ByteCartAPI.MAXSTATIONLOG;
}
Program: 12892
Project: 12892
Buggy source:
private final int getFreeSubnet(int netmask){
  boolean free;
  int start=getFirstStationNumber();
  int end=getLastStationNumber();
  int step=256 >> netmask;
  if (ByteCart.debug)   ByteCart.log.info("String_Node_Str" + start + "String_Node_Str"+ end+ "String_Node_Str"+ step+ "String_Node_Str"+ this.getCounter().toString());
  for (int i=start; i < end; i+=step) {
    free=true;
    for (int j=i; j < i + step; j++) {
      free&=(this.getCounter().getCount(j) == 0);
    }
    if (free) {
      if (ByteCart.debug)       ByteCart.log.info("String_Node_Str" + i + "String_Node_Str"+ free);
      return i;
    }
    if (ByteCart.debug)     ByteCart.log.info("String_Node_Str" + i + "String_Node_Str"+ free);
  }
  LogUtil.sendError(this.getContent().getPlayer(),"String_Node_Str" + this.getCenter().getLocation().toString() + "String_Node_Str"+ "String_Node_Str"+ step+ "String_Node_Str"+ this.buildAddress(start));
  return -1;
}

Fixed version (ground truth):
private final int getFreeSubnet(int netmask){
  boolean free;
  int start=getFirstStationNumber();
  int end=getLastStationNumber();
  int step=ByteCartAPI.MAXSTATION >> netmask;
  if (ByteCart.debug)   ByteCart.log.info("String_Node_Str" + start + "String_Node_Str"+ end+ "String_Node_Str"+ step+ "String_Node_Str"+ this.getCounter().toString());
  for (int i=start; i < end; i+=step) {
    free=true;
    for (int j=i; j < i + step; j++) {
      free&=(this.getCounter().getCount(j) == 0);
    }
    if (free) {
      if (ByteCart.debug)       ByteCart.log.info("String_Node_Str" + i + "String_Node_Str"+ free);
      return i;
    }
    if (ByteCart.debug)     ByteCart.log.info("String_Node_Str" + i + "String_Node_Str"+ free);
  }
  LogUtil.sendError(this.getContent().getPlayer(),"String_Node_Str" + this.getCenter().getLocation().toString() + "String_Node_Str"+ "String_Node_Str"+ step+ "String_Node_Str"+ this.buildAddress(start));
  return -1;
}
Program: 12894
Project: 12894
Buggy source:
private final boolean isInSubnet(int address,int netmask){
  return (address >= this.getFirstStationNumber() && (address | (255 >> netmask)) < this.getLastStationNumber());
}

Fixed version (ground truth):
private final boolean isInSubnet(int address,int netmask){
  return (address >= this.getFirstStationNumber() && (address | ((ByteCartAPI.MAXSTATION - 1) >> netmask)) < this.getLastStationNumber());
}
Program: 12895
Project: 12895
Buggy source:
@Override public void doAction(Side to){
  Address address=this.getSignAddress();
  int mask=this.getNetmask();
  if (mask < 8) {
    Stack<Integer> end=this.getEnd();
    if (to.equals(Side.LEVER_ON) && (end.isEmpty() || mask > end.peek())) {
      end.push(mask);
      if (ByteCart.debug)       ByteCart.log.info("String_Node_Str" + mask + "String_Node_Str");
    }
 else     if (to.equals(Side.LEVER_OFF) && !end.isEmpty()) {
      if (ByteCart.debug)       ByteCart.log.info("String_Node_Str" + end.peek() + "String_Node_Str");
      end.pop();
    }
  }
  save();
  if (getContent().getCurrent() != getContent().getRegion())   return;
  if (address.isValid()) {
    if (this.getContent().isFullreset()) {
      if (this.getNetmask() == 8) {
        UpdaterClearStationEvent event=new UpdaterClearStationEvent(this,address,((BC9001)this.getBcSign()).getStationName());
        Bukkit.getServer().getPluginManager().callEvent(event);
      }
 else {
        UpdaterClearSubnetEvent event=new UpdaterClearSubnetEvent(this,address,256 >> this.getNetmask());
        Bukkit.getServer().getPluginManager().callEvent(event);
      }
      address.remove();
      if (ByteCart.debug)       ByteCart.log.info("String_Node_Str");
    }
  }
 else {
    UpdaterSignInvalidateEvent event=new UpdaterSignInvalidateEvent(this);
    Bukkit.getServer().getPluginManager().callEvent(event);
    address.remove();
    if (ByteCart.debug)     ByteCart.log.info("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void doAction(Side to){
  Address address=this.getSignAddress();
  int mask=this.getNetmask();
  if (mask < 8) {
    Stack<Integer> end=this.getEnd();
    if (to.equals(Side.LEVER_ON) && (end.isEmpty() || mask > end.peek())) {
      end.push(mask);
      if (ByteCart.debug)       ByteCart.log.info("String_Node_Str" + mask + "String_Node_Str");
    }
 else     if (to.equals(Side.LEVER_OFF) && !end.isEmpty()) {
      if (ByteCart.debug)       ByteCart.log.info("String_Node_Str" + end.peek() + "String_Node_Str");
      end.pop();
    }
  }
  save();
  if (getContent().getCurrent() != getContent().getRegion())   return;
  if (address.isValid()) {
    if (this.getContent().isFullreset()) {
      if (this.getNetmask() == 8) {
        UpdaterClearStationEvent event=new UpdaterClearStationEvent(this,address,((BC9001)this.getBcSign()).getStationName());
        Bukkit.getServer().getPluginManager().callEvent(event);
      }
 else {
        UpdaterClearSubnetEvent event=new UpdaterClearSubnetEvent(this,address,ByteCartAPI.MAXSTATION >> this.getNetmask());
        Bukkit.getServer().getPluginManager().callEvent(event);
      }
      address.remove();
      if (ByteCart.debug)       ByteCart.log.info("String_Node_Str");
    }
  }
 else {
    UpdaterSignInvalidateEvent event=new UpdaterSignInvalidateEvent(this);
    Bukkit.getServer().getPluginManager().callEvent(event);
    address.remove();
    if (ByteCart.debug)     ByteCart.log.info("String_Node_Str");
  }
}
Program: 12896
Project: 12896
Buggy source:
/** 
 * Get an IC with a code declared 2 blocks behind the clicked sign
 * @param block the sign clicked
 * @param player the player who clicked the sign
 * @return a Clickable IC, or null
 */
static final public Clickable getBackwardClickedIC(Block block,Player player){
  Material type=block.getState().getType();
  if (type.equals(Material.SIGN_POST) || type.equals(Material.WALL_SIGN)) {
    BlockFace f=((org.bukkit.material.Sign)block.getState().getData()).getFacing().getOppositeFace();
    f=MathUtil.straightUp(f);
    final Block relative=block.getRelative(f,2);
    if (AbstractIC.checkEligibility(relative)) {
      return ClickedSignFactory.getClickedIC(block,((Sign)relative.getState()).getLine(1),player);
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Get an IC with a code declared 2 blocks behind the clicked sign
 * @param block the sign clicked
 * @param player the player who clicked the sign
 * @return a Clickable IC, or null
 */
static final public Clickable getBackwardClickedIC(Block block,Player player){
  Material type=block.getState().getType();
  if (type.equals(Material.SIGN_POST) || type.equals(Material.WALL_SIGN)) {
    BlockFace f=((org.bukkit.material.Sign)block.getState().getData()).getFacing().getOppositeFace();
    f=MathUtil.straightUp(f);
    final Block relative=block.getRelative(f,2);
    if (AbstractIC.checkEligibility(relative)) {
      return ClickedSignFactory.getClickedIC(relative,((Sign)relative.getState()).getLine(1),player);
    }
  }
  return null;
}
Program: 12897
Project: 12897
Buggy source:
BC8010(Block block,org.bukkit.entity.Vehicle vehicle) throws ClassNotFoundException, IOException {
  super(block,vehicle);
  this.IsTrackNumberProvider=true;
  From=this.getCardinal().getOppositeFace();
  destination=AddressFactory.getAddress(this.getInventory());
  Sign=AddressFactory.getAddress(this.getBlock(),3);
  center=this.getBlock().getRelative(this.getCardinal(),6).getRelative(MathUtil.clockwise(this.getCardinal()));
  BlockState blockstate;
  if ((blockstate=center.getRelative(BlockFace.UP,5).getState()) instanceof InventoryHolder) {
    Inventory ChestInventory=((InventoryHolder)blockstate).getInventory();
    RoutingTable=RoutingTableFactory.getRoutingTable(ChestInventory);
  }
 else {
    RoutingTable=null;
  }
}

Fixed version (ground truth):
BC8010(Block block,org.bukkit.entity.Vehicle vehicle) throws ClassNotFoundException, IOException {
  super(block,vehicle);
  this.IsTrackNumberProvider=true;
  From=this.getCardinal().getOppositeFace();
  destination=AddressFactory.getAddress(this.getInventory());
  if (destination == null) {
    destination=AddressFactory.getDefaultTicket(this.getInventory());
  }
  Sign=AddressFactory.getAddress(this.getBlock(),3);
  center=this.getBlock().getRelative(this.getCardinal(),6).getRelative(MathUtil.clockwise(this.getCardinal()));
  BlockState blockstate;
  if ((blockstate=center.getRelative(BlockFace.UP,5).getState()) instanceof InventoryHolder) {
    Inventory ChestInventory=((InventoryHolder)blockstate).getInventory();
    RoutingTable=RoutingTableFactory.getRoutingTable(ChestInventory);
  }
 else {
    RoutingTable=null;
  }
}
Program: 12898
Project: 12898
Buggy source:
/** 
 * Static method to check the format of an address A resolvable name will return true This method does not check if the address fields are in a valid range
 * @param s the string containing the address to check
 * @return true if the address is in the valid format or a resolvable name
 */
static public boolean isResolvableAddressOrName(String s){
  if (!(s.matches("String_Node_Str")) || !isResolvableName(s)) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Static method to check the format of an address A resolvable name will return true This method does not check if the address fields are in a valid range
 * @param s the string containing the address to check
 * @return true if the address is in the valid format or a resolvable name
 */
static public boolean isResolvableAddressOrName(String s){
  if ((s.matches("String_Node_Str")) || isResolvableName(s)) {
    return true;
  }
  return false;
}
Program: 12899
Project: 12899
Buggy source:
@Override protected SimpleCollisionAvoider.Side route(){
  SignPreSubnetEvent event;
  AddressRouted dst=this.getDestinationAddress();
  int ttl;
  if (this.isAddressMatching() && (ttl=dst.getTTL()) != 0) {
    dst.updateTTL(ttl - 1);
    event=new SignPreSubnetEvent(this,Side.RIGHT);
  }
 else   event=new SignPreSubnetEvent(this,Side.LEFT);
  Bukkit.getServer().getPluginManager().callEvent(event);
  return event.getSide();
}

Fixed version (ground truth):
@Override protected SimpleCollisionAvoider.Side route(){
  SignPreSubnetEvent event;
  AddressRouted dst=this.getDestinationAddress();
  int ttl;
  if (this.isAddressMatching() && (ttl=dst.getTTL()) != 0) {
    dst.updateTTL(ttl - 1);
    dst.finalizeAddress();
    event=new SignPreSubnetEvent(this,Side.RIGHT);
  }
 else   event=new SignPreSubnetEvent(this,Side.LEFT);
  Bukkit.getServer().getPluginManager().callEvent(event);
  return event.getSide();
}
Program: 12900
Project: 12900
Buggy source:
private final boolean isExactSubnet(int address,int netmask){
  return (address == this.getCurrentSubnet() && (address | (255 >> netmask)) == (this.getNext() - 1));
}

Fixed version (ground truth):
private final boolean isExactSubnet(int address,int netmask){
  return (address == this.getFirstStationNumber() && (address | (255 >> netmask)) == (this.getLastStationNumber() - 1));
}
Program: 12901
Project: 12901
Buggy source:
private final boolean isInSubnet(int address,int netmask){
  return (address >= this.getCurrentSubnet() && (address | (255 >> netmask)) < this.getNext());
}

Fixed version (ground truth):
private final boolean isInSubnet(int address,int netmask){
  return (address >= this.getFirstStationNumber() && (address | (255 >> netmask)) < this.getLastStationNumber());
}
Program: 12902
Project: 12902
Buggy source:
public final void leaveSubnet(){
  if (!this.getStart().empty() && !this.getEnd().empty()) {
    this.fillSubnet();
    Stack<Integer> startstack=this.getStart();
    Stack<Integer> endstack=this.getEnd();
    int start=startstack.pop();
    int end=endstack.pop();
    int newstart=startstack.peek();
    int newend=endstack.peek();
    UpdaterLeaveSubnetEvent event=new UpdaterLeaveSubnetEvent(this,AddressFactory.getAddress(buildAddress(start)),end - start,AddressFactory.getAddress(buildAddress(newstart)),newend - newstart);
    Bukkit.getServer().getPluginManager().callEvent(event);
  }
}

Fixed version (ground truth):
public final void leaveSubnet(){
  if (!this.getStart().empty() && !this.getEnd().empty()) {
    this.fillSubnet();
    Stack<Integer> startstack=this.getStart();
    Stack<Integer> endstack=this.getEnd();
    int start=startstack.pop();
    int end=endstack.pop();
    int newstart=getFirstStationNumber();
    int newend=getLastStationNumber();
    UpdaterLeaveSubnetEvent event=new UpdaterLeaveSubnetEvent(this,AddressFactory.getAddress(buildAddress(start)),end - start,AddressFactory.getAddress(buildAddress(newstart)),newend - newstart);
    Bukkit.getServer().getPluginManager().callEvent(event);
  }
}
Program: 12903
Project: 12903
Buggy source:
private final int getFreeSubnet(int netmask){
  boolean free;
  int start=(this.getStart().empty() ? 0 : this.getStart().peek());
  int end=(this.getEnd().empty()) ? 256 : this.getEnd().peek();
  int step=256 >> netmask;
  if (ByteCart.debug)   ByteCart.log.info("String_Node_Str" + start + "String_Node_Str"+ end+ "String_Node_Str"+ step+ "String_Node_Str"+ this.getCounter().toString());
  for (int i=start; i < end; i+=step) {
    free=true;
    for (int j=i; j < i + step; j++) {
      free&=(this.getCounter().getCount(j) == 0);
    }
    if (free) {
      if (ByteCart.debug)       ByteCart.log.info("String_Node_Str" + i + "String_Node_Str"+ free);
      return i;
    }
    if (ByteCart.debug)     ByteCart.log.info("String_Node_Str" + i + "String_Node_Str"+ free);
  }
  LogUtil.sendError(this.getContent().getPlayer(),"String_Node_Str" + this.getCenter().getLocation().toString() + "String_Node_Str"+ "String_Node_Str"+ step+ "String_Node_Str"+ this.buildAddress(start));
  return -1;
}

Fixed version (ground truth):
private final int getFreeSubnet(int netmask){
  boolean free;
  int start=getFirstStationNumber();
  int end=getLastStationNumber();
  int step=256 >> netmask;
  if (ByteCart.debug)   ByteCart.log.info("String_Node_Str" + start + "String_Node_Str"+ end+ "String_Node_Str"+ step+ "String_Node_Str"+ this.getCounter().toString());
  for (int i=start; i < end; i+=step) {
    free=true;
    for (int j=i; j < i + step; j++) {
      free&=(this.getCounter().getCount(j) == 0);
    }
    if (free) {
      if (ByteCart.debug)       ByteCart.log.info("String_Node_Str" + i + "String_Node_Str"+ free);
      return i;
    }
    if (ByteCart.debug)     ByteCart.log.info("String_Node_Str" + i + "String_Node_Str"+ free);
  }
  LogUtil.sendError(this.getContent().getPlayer(),"String_Node_Str" + this.getCenter().getLocation().toString() + "String_Node_Str"+ "String_Node_Str"+ step+ "String_Node_Str"+ this.buildAddress(start));
  return -1;
}
Program: 12904
Project: 12904
Buggy source:
private final void fillSubnet(){
  int start=this.getCurrentSubnet();
  int end=this.getNext();
  if (ByteCart.debug)   ByteCart.log.info("String_Node_Str" + start + "String_Node_Str"+ end);
  for (int i=start; i < end; i++)   this.getCounter().incrementCount(i,64);
}

Fixed version (ground truth):
private final void fillSubnet(){
  int start=this.getFirstStationNumber();
  int end=this.getLastStationNumber();
  if (ByteCart.debug)   ByteCart.log.info("String_Node_Str" + start + "String_Node_Str"+ end);
  for (int i=start; i < end; i++)   this.getCounter().incrementCount(i,64);
}
Program: 12906
Project: 12906
Buggy source:
@Override public Side giveSimpleDirection(){
  if (this.getNetmask() < 8 && (!(this.getStart().empty() ^ this.getEnd().empty())) && !this.isExactSubnet(this.getCurrentSubnet(),this.getNetmask()))   return Side.RIGHT;
  return Side.LEFT;
}

Fixed version (ground truth):
@Override public Side giveSimpleDirection(){
  if (this.getNetmask() < 8 && (!(this.getStart().empty() ^ this.getEnd().empty())) && !this.isExactSubnet(this.getFirstStationNumber(),this.getNetmask()))   return Side.RIGHT;
  return Side.LEFT;
}
Program: 12907
Project: 12907
Buggy source:
@Override public void doAction(Side to){
  Address address=this.getSignAddress();
  if (address.isValid() && (address.getRegion().getAmount() != getContent().getRegion() || address.getTrack().getAmount() == 0))   return;
  if (address.isValid() && this.getContent().isFullreset()) {
    if (this.getNetmask() == 8) {
      UpdaterClearStationEvent event=new UpdaterClearStationEvent(this,address);
      Bukkit.getServer().getPluginManager().callEvent(event);
    }
 else {
      UpdaterClearSubnetEvent event=new UpdaterClearSubnetEvent(this,address,256 >> this.getNetmask());
      Bukkit.getServer().getPluginManager().callEvent(event);
    }
  }
 else {
    UpdaterSignInvalidateEvent event=new UpdaterSignInvalidateEvent(this);
    Bukkit.getServer().getPluginManager().callEvent(event);
    if (!this.getContent().isFullreset())     return;
  }
  address.remove();
  if (ByteCart.debug)   ByteCart.log.info("String_Node_Str");
  int mask=this.getNetmask();
  if (mask < 8) {
    Stack<Integer> end=this.getEnd();
    if (to.equals(Side.RIGHT) && (end.isEmpty() || mask > end.peek())) {
      end.push(mask);
    }
 else     if (to.equals(Side.LEFT) && !end.isEmpty()) {
      end.pop();
    }
  }
  save();
}

Fixed version (ground truth):
@Override public void doAction(Side to){
  Address address=this.getSignAddress();
  int mask=this.getNetmask();
  if (mask < 8) {
    Stack<Integer> end=this.getEnd();
    if (to.equals(Side.RIGHT) && (end.isEmpty() || mask > end.peek())) {
      end.push(mask);
      if (ByteCart.debug)       ByteCart.log.info("String_Node_Str" + mask + "String_Node_Str");
    }
 else     if (to.equals(Side.LEFT) && !end.isEmpty()) {
      if (ByteCart.debug)       ByteCart.log.info("String_Node_Str" + end.peek() + "String_Node_Str");
      end.pop();
    }
  }
  save();
  if (address.isValid() && (address.getRegion().getAmount() != getContent().getRegion() || address.getTrack().getAmount() == 0))   return;
  if (address.isValid() && this.getContent().isFullreset()) {
    if (this.getNetmask() == 8) {
      UpdaterClearStationEvent event=new UpdaterClearStationEvent(this,address);
      Bukkit.getServer().getPluginManager().callEvent(event);
    }
 else {
      UpdaterClearSubnetEvent event=new UpdaterClearSubnetEvent(this,address,256 >> this.getNetmask());
      Bukkit.getServer().getPluginManager().callEvent(event);
    }
  }
 else {
    UpdaterSignInvalidateEvent event=new UpdaterSignInvalidateEvent(this);
    Bukkit.getServer().getPluginManager().callEvent(event);
    if (!this.getContent().isFullreset())     return;
  }
  address.remove();
  if (ByteCart.debug)   ByteCart.log.info("String_Node_Str");
}
Program: 12908
Project: 12908
Buggy source:
@Override protected void initChannel(Channel ch){
  ch.pipeline().addLast(new LoggingHandler(),new ConnectionStateHandler(),HandshakeHandler.produceLoginHandshake(),new LoginServerCodec(),new MessageDemuxDecoder());
}

Fixed version (ground truth):
@Override protected void initChannel(Channel ch){
  ch.pipeline().addLast(new LoggingHandler(),new ConnectionStateHandler(),HandshakeHandler.produceLoginHandshake(encrypted),new LoginServerCodec(),new MessageDemuxDecoder());
}
Program: 12909
Project: 12909
Buggy source:
@Override public Channel getServerChannel(ServerBootstrap bootstrap) throws InterruptedException {
  bootstrap.childAttr(ClientBean.HANDLE_KEY,null);
  bootstrap.childHandler(new LoginShardChannelInitializer());
  return bootstrap.bind(8112).sync().channel();
}

Fixed version (ground truth):
@Override public Channel getServerChannel(ServerBootstrap bootstrap) throws InterruptedException {
  bootstrap.childAttr(ClientBean.HANDLE_KEY,null);
  bootstrap.childHandler(new LoginShardChannelInitializer(EncryptionOptions.Enable));
  return bootstrap.bind(8112).sync().channel();
}
Program: 12910
Project: 12910
Buggy source:
/** 
 * Executed when a client wants to log in.
 * @param action 
 */
@Event.Handler public void onAccountLogin(P004_AccountLogin action){
  LOGGER.debug("String_Node_Str");
  Channel channel=action.getChannel();
  String email=action.getEmail();
  String password=new String(action.getPassword(),CHARSET_UTF16);
  String characterName=action.getCharacterName();
  LoginModel model=new LoginModel(email,characterName);
  if (!model.isValid(password)) {
    StreamTerminatorView.send(channel,model.getErrorCode());
    LOGGER.debug("String_Node_Str");
    return;
  }
  LOGGER.info("String_Node_Str",email);
  ClientBean client=new ClientBean(channel,action.getLoginCount(),model.getAccount(),model.getChara());
  ClientBean.set(channel,clientHandleRegistry.register(client));
  LoginView.sendLoginInfo(channel,model.getAccount());
}

Fixed version (ground truth):
/** 
 * Executed when a client wants to log in.
 * @param action 
 */
@Event.Handler public void onAccountLogin(P004_AccountLogin action){
  LOGGER.debug("String_Node_Str");
  Channel channel=action.getChannel();
  ClientBean.setLoginCount(channel,action.getLoginCount());
  String email=action.getEmail();
  String password=new String(action.getPassword(),CHARSET_UTF16);
  String characterName=action.getCharacterName();
  if (email == null || characterName == null) {
    return;
  }
  LoginModel model=new LoginModel(email,characterName);
  if (!model.isValid(password)) {
    StreamTerminatorView.send(channel,model.getErrorCode());
    LOGGER.debug("String_Node_Str");
    return;
  }
  LOGGER.info("String_Node_Str",email);
  ClientBean client=new ClientBean(channel,model.getAccount(),model.getChara());
  ClientBean.set(channel,clientHandleRegistry.register(client));
  LoginView.sendLoginInfo(channel,model.getAccount());
}
Program: 12911
Project: 12911
Buggy source:
/** 
 * Event handler.
 * @param event 
 */
@Event.Handler public void onNewClient(NetworkClientConnectedEvent event){
  LOGGER.debug("String_Node_Str");
  event.getChannel().attr(GameAppContextKey.KEY).set(context);
  event.getChannel().attr(GameAppContextKey.IS_SET).set(true);
}

Fixed version (ground truth):
/** 
 * Event handler.
 * @param event 
 */
@Event.Handler public void onNewClient(NetworkClientConnectedEvent event){
  LOGGER.debug("String_Node_Str");
  event.getChannel().attr(GameAppContextKey.KEY).set(context);
  event.getChannel().attr(GameAppContextKey.IS_SET).set(true);
  event.getChannel().attr(ClientBean.LOGIN_COUNT).set(0);
}
Program: 12912
Project: 12912
Buggy source:
public ClientBean(Channel channel,long loginCount,Account acc,Character chara){
  this.channel=channel;
  this.loginCount=loginCount;
  this.account=acc;
  this.character=chara;
}

Fixed version (ground truth):
public ClientBean(Channel channel,Account acc,Character chara){
  this.channel=channel;
  this.account=acc;
  this.character=chara;
}
Program: 12913
Project: 12913
Buggy source:
public long getLoginCount(){
  return loginCount;
}

Fixed version (ground truth):
public long getLoginCount(){
  return channel.attr(ClientBean.LOGIN_COUNT).get();
}
Program: 12914
Project: 12914
Buggy source:
public void setLoginCount(long loginCount){
  this.loginCount=loginCount;
}

Fixed version (ground truth):
public static void setLoginCount(Channel channel,long loginCount){
  channel.attr(ClientBean.LOGIN_COUNT).set((int)loginCount);
}
Program: 12915
Project: 12915
Buggy source:
public static void sendAccountGuiInfo(Channel channel){
  LOGGER.debug("String_Node_Str");
  P022_AccountGuiInfo accountGuiSettings=new P022_AccountGuiInfo();
  accountGuiSettings.init(channel);
  accountGuiSettings.setLoginCount(ClientBean.get(channel).getLoginCount());
  channel.write(accountGuiSettings);
  sendFriendInfo(channel,ErrorCode.None);
}

Fixed version (ground truth):
public static void sendAccountGuiInfo(Channel channel){
  LOGGER.debug("String_Node_Str");
  P022_AccountGuiInfo accountGuiSettings=new P022_AccountGuiInfo();
  accountGuiSettings.init(channel);
  accountGuiSettings.setLoginCount(ClientBean.get(channel).getLoginCount());
  accountGuiSettings.setSettings(new byte[]{});
  channel.writeAndFlush(accountGuiSettings);
  sendFriendInfo(channel,ErrorCode.None);
}
Program: 12916
Project: 12916
Buggy source:
public static void sendFriendInfo(Channel channel,ErrorCode errorNumber){
  LOGGER.debug("String_Node_Str");
  P020_FriendsListEnd friendListEnd=new P020_FriendsListEnd();
  friendListEnd.init(channel);
  friendListEnd.setLoginCount(ClientBean.get(channel).getLoginCount());
  friendListEnd.setUnknown1(1);
  channel.write(friendListEnd);
  LOGGER.debug("String_Node_Str");
  P017_AccountPermissions accountPermissions=new P017_AccountPermissions();
  accountPermissions.init(channel);
  accountPermissions.setLoginCount(ClientBean.get(channel).getLoginCount());
  accountPermissions.setTerritory(2);
  accountPermissions.setTerritoryChanges(4);
  accountPermissions.setUnknown1(new byte[]{0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00});
  accountPermissions.setUnknown2(new byte[]{-0x80,0x3F,0x02,0x00,0x03,0x00,0x08,0x00});
  accountPermissions.setUnknown3(new byte[]{0x37,0x4B,0x09,-0x45,-0x3E,-0x0A,0x74,0x43,-0x56,-0x55,0x35,0x4D,-0x12,-0x49,-0x51,0x08});
  accountPermissions.setUnknown4(new byte[]{0x55,-0x4A,0x77,0x59,0x0C,0x0C,0x15,0x46,-0x53,-0x56,0x33,0x43,0x4A,-0x6F,0x23,0x6A});
  accountPermissions.setChangeAccountSettings(8);
  accountPermissions.setAccountFeatures(new byte[]{0x01,0x00,0x06,0x00,0x57,0x00,0x01,0x00});
  accountPermissions.setEulaAccepted((byte)23);
  accountPermissions.setUnknown5(0);
  channel.write(accountPermissions);
  LOGGER.debug("String_Node_Str");
  StreamTerminatorView.send(channel,errorNumber);
}

Fixed version (ground truth):
public static void sendFriendInfo(Channel channel,ErrorCode errorNumber){
  LOGGER.debug("String_Node_Str");
  P020_FriendsListEnd friendListEnd=new P020_FriendsListEnd();
  friendListEnd.init(channel);
  friendListEnd.setLoginCount(ClientBean.get(channel).getLoginCount());
  friendListEnd.setUnknown1(1);
  channel.writeAndFlush(friendListEnd);
  LOGGER.debug("String_Node_Str");
  P017_AccountPermissions accountPermissions=new P017_AccountPermissions();
  accountPermissions.init(channel);
  accountPermissions.setLoginCount(ClientBean.get(channel).getLoginCount());
  accountPermissions.setTerritory(2);
  accountPermissions.setTerritoryChanges(4);
  accountPermissions.setUnknown1(new byte[]{0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00});
  accountPermissions.setUnknown2(new byte[]{-0x80,0x3F,0x02,0x00,0x03,0x00,0x08,0x00});
  accountPermissions.setUnknown3(new byte[]{0x37,0x4B,0x09,-0x45,-0x3E,-0x0A,0x74,0x43,-0x56,-0x55,0x35,0x4D,-0x12,-0x49,-0x51,0x08});
  accountPermissions.setUnknown4(new byte[]{0x55,-0x4A,0x77,0x59,0x0C,0x0C,0x15,0x46,-0x53,-0x56,0x33,0x43,0x4A,-0x6F,0x23,0x6A});
  accountPermissions.setChangeAccountSettings(8);
  accountPermissions.setAccountFeatures(new byte[]{0x01,0x00,0x06,0x00,0x57,0x00,0x01,0x00});
  accountPermissions.setEulaAccepted((byte)23);
  accountPermissions.setUnknown5(0);
  channel.writeAndFlush(accountPermissions);
  LOGGER.debug("String_Node_Str");
  StreamTerminatorView.send(channel,errorNumber);
}
Program: 12918
Project: 12918
Buggy source:
/** 
 * This method is used to refer the client (session) to a game server. Note that the UUIDs of the internal client and server are only given to the client as their hashCode()
 * @param channel
 * @param address                 Of the map shard's server socket.
 * @param serverUid
 * @param clientUid
 * @param gameMapId 
 */
public static void referToGameServer(Channel channel,InetSocketAddress address,UUID serverUid,UUID clientUid,int gameMapId){
  P009_ReferToGameServer referToGameServer=new P009_ReferToGameServer();
  referToGameServer.init(channel);
  referToGameServer.setLoginCount(ClientBean.get(channel).getLoginCount());
  referToGameServer.setSecurityKey1(serverUid.hashCode());
  referToGameServer.setGameMapID(gameMapId);
  ByteBuffer buf=ByteBuffer.allocate(24);
  buf.order(ByteOrder.LITTLE_ENDIAN);
  buf.putShort((short)2);
  buf.order(ByteOrder.BIG_ENDIAN);
  buf.putShort((short)address.getPort());
  buf.order(ByteOrder.LITTLE_ENDIAN);
  buf.put(address.getAddress().getAddress());
  referToGameServer.setServerConnectionInfo(buf.array());
  referToGameServer.setSecurityKey2(clientUid.hashCode());
  channel.write(referToGameServer);
}

Fixed version (ground truth):
/** 
 * This method is used to refer the client (session) to a game server. Note that the UUIDs of the internal client and server are only given to the client as their hashCode()
 * @param channel
 * @param address                 Of the map shard's server socket.
 * @param serverUid
 * @param clientUid
 * @param gameMapId 
 */
public static void referToGameServer(Channel channel,InetSocketAddress address,UUID serverUid,UUID clientUid,int gameMapId){
  P009_ReferToGameServer referToGameServer=new P009_ReferToGameServer();
  referToGameServer.init(channel);
  referToGameServer.setLoginCount(ClientBean.get(channel).getLoginCount());
  referToGameServer.setSecurityKey1(serverUid.hashCode());
  referToGameServer.setGameMapID(gameMapId);
  ByteBuffer buf=ByteBuffer.allocate(24);
  buf.order(ByteOrder.LITTLE_ENDIAN);
  buf.putShort((short)2);
  buf.order(ByteOrder.BIG_ENDIAN);
  buf.putShort((short)address.getPort());
  buf.order(ByteOrder.LITTLE_ENDIAN);
  buf.put(address.getAddress().getAddress());
  referToGameServer.setServerConnectionInfo(buf.array());
  referToGameServer.setSecurityKey2(clientUid.hashCode());
  channel.writeAndFlush(referToGameServer);
}
Program: 12919
Project: 12919
Buggy source:
/** 
 * Static computer user stuff...
 * @param channel 
 */
public static void computerInfoReply(Channel channel){
  LOGGER.debug("String_Node_Str");
  P001_ComputerInfoReply computerInfoReply=new P001_ComputerInfoReply();
  computerInfoReply.init(channel);
  computerInfoReply.setUnknown1(1905605949);
  computerInfoReply.setLoginCount(ClientBean.get(channel).getLoginCount());
  computerInfoReply.setUnknown2(0);
  computerInfoReply.setUnknown3(1);
  channel.write(computerInfoReply);
}

Fixed version (ground truth):
/** 
 * Static computer user stuff...
 * @param channel 
 */
public static void computerInfoReply(Channel channel){
  LOGGER.debug("String_Node_Str");
  P001_ComputerInfoReply computerInfoReply=new P001_ComputerInfoReply();
  computerInfoReply.init(channel);
  computerInfoReply.setUnknown1(1905605949);
  computerInfoReply.setLoginCount(ClientBean.getPerformedActionsCount(channel));
  computerInfoReply.setUnknown2(0);
  computerInfoReply.setUnknown3(1);
  channel.writeAndFlush(computerInfoReply);
}
Program: 12920
Project: 12920
Buggy source:
public static void send(Channel channel,ErrorCode errorCode){
  P003_StreamTerminator streamTerminator=new P003_StreamTerminator();
  streamTerminator.init(channel);
  streamTerminator.setLoginCount(ClientBean.get(channel).getLoginCount());
  streamTerminator.setErrorCode(errorCode.get());
  if (errorCode != ErrorCode.None) {
    LOGGER.debug(String.format("String_Node_Str",channel.remoteAddress().toString(),errorCode.message()));
  }
  channel.write(streamTerminator);
}

Fixed version (ground truth):
public static void send(Channel channel,ErrorCode errorCode){
  P003_StreamTerminator streamTerminator=new P003_StreamTerminator();
  streamTerminator.init(channel);
  streamTerminator.setLoginCount(ClientBean.getPerformedActionsCount(channel));
  streamTerminator.setErrorCode(errorCode.get());
  if (errorCode != ErrorCode.None) {
    LOGGER.debug(String.format("String_Node_Str",channel.remoteAddress().toString(),errorCode.message()));
  }
  channel.writeAndFlush(streamTerminator);
}
Program: 12921
Project: 12921
Buggy source:
@Override protected void initChannel(Channel ch){
  Collection<Integer> outBlackList=new ArrayList<>();
  outBlackList.add(0);
  ch.pipeline().addLast(new ConnectionStateHandler(),HandshakeHandler.produceGameHandshake(),new GameServerCodec(),new MessageDemuxDecoder(),new NettyGWLoggingHandler(BlackList,new ArrayList<Integer>(),outBlackList));
}

Fixed version (ground truth):
@Override protected void initChannel(Channel ch){
  Collection<Integer> outBlackList=new ArrayList<>();
  outBlackList.add(0);
  ch.pipeline().addLast(new LoggingHandler(),new ConnectionStateHandler(),HandshakeHandler.produceGameHandshake(encrypted),new GameServerCodec(),new MessageDemuxDecoder(),new NettyGWLoggingHandler(BlackList,new ArrayList<Integer>(),outBlackList));
}
Program: 12922
Project: 12922
Buggy source:
@Override public Channel getServerChannel(ServerBootstrap bootstrap) throws InterruptedException {
  bootstrap.childAttr(ClientBean.HANDLE_KEY,null);
  bootstrap.childHandler(new MapShardChannelInitializer());
  return bootstrap.bind(9112).sync().channel();
}

Fixed version (ground truth):
@Override public Channel getServerChannel(ServerBootstrap bootstrap) throws InterruptedException {
  bootstrap.childAttr(ClientBean.HANDLE_KEY,null);
  bootstrap.childHandler(new MapShardChannelInitializer(EncryptionOptions.Enable));
  return bootstrap.bind(9112).sync().channel();
}
Program: 12924
Project: 12924
Buggy source:
/** 
 * Handles movement events. This only concerns entities that just started moving or changed direction.
 * @param startMove
 */
@EventHandler public void onStartMoving(StartMovingEvent startMove){
  Entity et=startMove.getThisEntity();
  int agentID=et.get(AgentIdentifiers.class).agentID;
  GWVector pos=et.get(Position.class).position;
  GWVector dir=startMove.getDirection();
  et.get(Direction.class).direction=dir;
  Movement move=et.get(Movement.class);
  move.moveType=startMove.getType();
  move.moveState=MovementState.Moving;
  GWVector futurePos=pos.add(dir.mul(0.001F * heartBeatInterval));
  for (  Session session : lookupTable.getAllSessions()) {
    MovementView.sendChangeDirection(session,agentID,dir,move.moveType);
    MovementView.sendUpdateMovement(session,agentID,futurePos,move.moveType);
  }
}

Fixed version (ground truth):
/** 
 * Handles movement events. This only concerns entities that just started moving or changed direction.
 * @param startMove
 */
@EventHandler public void onStartMoving(StartMovingEvent startMove){
  Entity et=startMove.getThisEntity();
  int agentID=et.get(AgentIdentifiers.class).agentID;
  GWVector pos=et.get(Position.class).position;
  GWVector dir=startMove.getDirection();
  et.get(Direction.class).direction=dir.getUnit();
  Movement move=et.get(Movement.class);
  move.moveType=startMove.getType();
  move.moveState=MovementState.Moving;
  GWVector futurePos=pos.add(dir.mul(0.001F * heartBeatInterval));
  for (  Session session : lookupTable.getAllSessions()) {
    MovementView.sendChangeDirection(session,agentID,dir,move.moveType);
    MovementView.sendUpdateMovement(session,agentID,futurePos,move.moveType);
  }
}
Program: 12925
Project: 12925
Buggy source:
/** 
 * Event handler. Rotate event, this siganls that an entity changed its direction while not moving.
 * @param rot
 */
@EventHandler public void onRotate(RotateEvent rot){
  Entity et=rot.getThisEntity();
  int agentID=et.get(AgentIdentifiers.class).agentID;
  Direction dir=et.get(Direction.class);
  dir.direction=rot.getNewDirection();
  float rotation=dir.direction.toRotation();
  for (  Session session : lookupTable.getAllSessions()) {
    MovementView.sendRotateAgent(session,agentID,rotation);
  }
}

Fixed version (ground truth):
/** 
 * Event handler. Rotate event, this siganls that an entity changed its direction while not moving.
 * @param rot
 */
@EventHandler public void onRotate(RotateEvent rot){
  Entity et=rot.getThisEntity();
  int agentID=et.get(AgentIdentifiers.class).agentID;
  Direction dir=et.get(Direction.class);
  dir.direction=rot.getNewDirection().getUnit();
  float rotation=dir.direction.toRotation();
  for (  Session session : lookupTable.getAllSessions()) {
    MovementView.sendRotateAgent(session,agentID,rotation);
  }
}
Program: 12926
Project: 12926
Buggy source:
/** 
 * This is invoked periodically. (Or never, depending on the interval)
 * @param timeDelta
 */
@Override protected void update(int timeDelta){
  Collection<Entity> entities=entityManager.getEntitiesWith(AgentIdentifiers.class,Position.class,Direction.class,Movement.class);
  for (  Entity entity : entities) {
    if (entity.get(Movement.class).moveState == MovementState.NotMoving) {
      continue;
    }
    int agentID=entity.get(AgentIdentifiers.class).agentID;
    GWVector pos=entity.get(Position.class).position;
    GWVector dir=entity.get(Direction.class).direction;
    Movement move=entity.get(Movement.class);
    float timeDiff=0.001F * timeDelta;
    GWVector newDir=dir.mul(move.speed * timeDiff);
    GWVector futurePos=pos.add(newDir);
    entity.get(Position.class).position=futurePos;
    for (    Session session : lookupTable.getAllSessions()) {
      MovementView.sendUpdateMovement(session,agentID,futurePos,move.moveType);
    }
  }
}

Fixed version (ground truth):
/** 
 * This is invoked periodically. (Or never, depending on the interval)
 * @param timeDelta
 */
@Override protected void update(int timeDelta){
  Collection<Entity> entities=entityManager.getEntitiesWith(AgentIdentifiers.class,Position.class,Direction.class,Movement.class);
  for (  Entity entity : entities) {
    if (entity.get(Movement.class).moveState == MovementState.NotMoving) {
      continue;
    }
    int agentID=entity.get(AgentIdentifiers.class).agentID;
    GWVector pos=entity.get(Position.class).position;
    GWVector dir=entity.get(Direction.class).direction.getUnit();
    Movement move=entity.get(Movement.class);
    float timeDiff=0.001F * timeDelta;
    GWVector newDir=dir.mul(move.speed * timeDiff);
    GWVector futurePos=pos.add(newDir);
    entity.get(Position.class).position=futurePos;
    for (    Session session : lookupTable.getAllSessions()) {
      MovementView.sendUpdateMovement(session,agentID,futurePos,move.moveType);
    }
  }
}
Program: 12927
Project: 12927
Buggy source:
/** 
 * Helper.
 * @return 
 */
private GameAppFactory produceMapShard(){
  GameAppFactory mapshard=new GenericGameAppFactory("String_Node_Str","String_Node_Str",250,false,new HashMap<String,String>());
  Map<String,String> dummy=new HashMap<>();
  mapshard.addShardlet(new com.gamerevision.gwlpr.mapshard.controllers.StartUp(),dbParams).addShardlet(new com.gamerevision.gwlpr.mapshard.controllers.Handshake(),dummy).addShardlet(new CharacterCreation(),dummy).addShardlet(new InstanceLoad(),dummy).addShardlet(new com.gamerevision.gwlpr.mapshard.controllers.StaticReply(),dummy);
  return mapshard;
}

Fixed version (ground truth):
/** 
 * Helper.
 * @return 
 */
private GameAppFactory produceMapShard(){
  GameAppFactory mapshard=new GenericGameAppFactory("String_Node_Str","String_Node_Str",250,false,new HashMap<String,String>());
  Map<String,String> dummy=new HashMap<>();
  mapshard.addShardlet(new com.gamerevision.gwlpr.mapshard.controllers.StartUp(),dbParams).addShardlet(new com.gamerevision.gwlpr.mapshard.controllers.Handshake(),dummy).addShardlet(new HeartBeat(),dummy).addShardlet(new CharacterCreation(),dummy).addShardlet(new InstanceLoad(),dummy).addShardlet(new com.gamerevision.gwlpr.mapshard.controllers.StaticReply(),dummy);
  return mapshard;
}
Program: 12928
Project: 12928
Buggy source:
/** 
 * Executed when a client wants to log in.
 * @param action 
 */
@EventHandler public void onAccountLogin(P004_AccountLoginAction action){
  LOGGER.debug("String_Node_Str");
  Session session=action.getSession();
  SessionAttachment attach=(SessionAttachment)session.getAttachment();
  attach.setLoginCount(action.getLoginCount());
  String email=new String(action.getEmail());
  String password=new String(action.getPassword(),Charset.forName("String_Node_Str"));
  String characterName=new String(action.getCharacterName());
  CheckLoginInfo checkInfo=new CheckLoginInfo(db,email);
  if (!(checkInfo.isValid(password) || true)) {
    StreamTerminatorView.create(session,checkInfo.getErrorCode());
    LOGGER.debug("String_Node_Str");
    return;
  }
  LOGGER.info("String_Node_Str",email);
  attach.setAccountId(DBAccount.getByEMail(db,email).getId());
  attach.setCharacterId(DBCharacter.getCharacter(db,characterName).getId());
  loginView.sendLoginInfo(session,attach.getAccountId());
}

Fixed version (ground truth):
/** 
 * Executed when a client wants to log in.
 * @param action 
 */
@EventHandler public void onAccountLogin(P004_AccountLoginAction action){
  LOGGER.debug("String_Node_Str");
  Session session=action.getSession();
  SessionAttachment attach=(SessionAttachment)session.getAttachment();
  attach.setLoginCount(action.getLoginCount());
  String email=new String(action.getEmail());
  String password=new String(action.getPassword(),Charset.forName("String_Node_Str"));
  String characterName=new String(action.getCharacterName());
  CheckLoginInfo checkInfo=new CheckLoginInfo(db,email,characterName);
  if (!checkInfo.isValid(password)) {
    StreamTerminatorView.create(session,checkInfo.getErrorCode());
    LOGGER.debug("String_Node_Str");
    return;
  }
  LOGGER.info("String_Node_Str",email);
  attach.setAccountId(DBAccount.getByEMail(db,email).getId());
  attach.setCharacterId(DBCharacter.getCharacter(db,characterName).getId());
  loginView.sendLoginInfo(session,attach.getAccountId());
}
Program: 12929
Project: 12929
Buggy source:
public boolean isValid(String password){
  if (account == null) {
    errorCode=227;
    return false;
  }
  if (password.startsWith(account.getPassword())) {
    return true;
  }
  errorCode=227;
  return false;
}

Fixed version (ground truth):
/** 
 * Returns boolean whether the login information is valid or not. TODO: Extend it (better validation, banned, ...)
 */
public boolean isValid(String password){
  if (account == null) {
    errorCode=227;
    return false;
  }
  if (false && !password.startsWith(account.getPassword())) {
    errorCode=227;
    return false;
  }
  if (chara == null) {
    errorCode=227;
    return false;
  }
  return true;
}
Program: 12930
Project: 12930
Buggy source:
public CheckLoginInfo(DatabaseConnectionProvider connectionProvider,String eMail){
  this.account=DBAccount.getByEMail(connectionProvider,eMail);
}

Fixed version (ground truth):
/** 
 * Constructor.
 */
public CheckLoginInfo(DatabaseConnectionProvider connectionProvider,String eMail,String charName){
  this.account=DBAccount.getByEMail(connectionProvider,eMail);
  this.chara=DBCharacter.getCharacter(connectionProvider,charName);
}
Program: 12931
Project: 12931
Buggy source:
/** 
 * Event handler. Handshake step: This is the actual interaction with the client.
 * @param action 
 */
@EventHandler public void onClientSeed(P16896_ClientSeedAction action){
  LOGGER.debug("String_Node_Str");
  Session session=action.getSession();
  SessionAttachment attach=((SessionAttachment)session.getAttachment());
  HandshakeView.serverSeed(session);
  HandshakeView.instanceHead(session);
  if (mapData.getMapID() == 0) {
    LOGGER.debug("String_Node_Str");
    CharacterCreationView.charCreateHead(session);
    return;
  }
  LoadCharacter loader=new LoadCharacter(db,attach.getCharacterId(),mapData.getSpawn());
  Entity player=loader.createPlayerEntityFor(entityManager);
  attach.setEntity(player);
  attach.setCharacterName(player.get(Name.class));
  attach.setAgentID(player.get(AgentID.class));
  attach.setLocalID(player.get(LocalID.class));
  HandshakeView.charName(session,attach.getCharacterName().name);
  HandshakeView.districtInfo(session,attach.getLocalID().localID,mapData.getMapID());
}

Fixed version (ground truth):
/** 
 * Event handler. Handshake step: This is the actual interaction with the client.
 * @param action 
 */
@EventHandler public void onClientSeed(P16896_ClientSeedAction action){
  LOGGER.debug("String_Node_Str");
  Session session=action.getSession();
  SessionAttachment attach=((SessionAttachment)session.getAttachment());
  HandshakeView.serverSeed(session);
  HandshakeView.instanceHead(session);
  if (mapData.getMapID() == 0) {
    LOGGER.debug("String_Node_Str");
    CharacterCreationView.charCreateHead(session);
    return;
  }
  LoadCharacter loader=new LoadCharacter(db,attach.getCharacterId(),mapData.getSpawn());
  Entity player=loader.createPlayerEntityFor(entityManager);
  attach.setEntity(player);
  attach.setCharacterName(player.get(Name.class));
  attach.setAgentID(player.get(AgentID.class));
  attach.setLocalID(player.get(LocalID.class));
  clientlookup.addClient(session,player);
  HandshakeView.charName(session,attach.getCharacterName().name);
  HandshakeView.districtInfo(session,attach.getLocalID().localID,mapData.getMapID());
}
Program: 12933
Project: 12933
Buggy source:
/** 
 * Helper. Generates the map data we need for this mapshard.
 * @param dbMapID                 The map ID as used for the db records.
 * @return      The completed map data.
 */
private MapData loadMapData(int dbMapID){
  int mapID=0;
  int mapFileHash=165811;
  float spawnX=-6558;
  float spawnY=-6010;
  int spawnPlane=0;
  return new MapData(mapID,mapFileHash,new GWVector(spawnX,spawnY,spawnPlane));
}

Fixed version (ground truth):
/** 
 * Helper. Generates the map data we need for this mapshard.
 * @param dbMapID                 The map ID as used for the db records.
 * @return      The completed map data.
 */
private MapData loadMapData(int dbMapID){
  int mapID=dbMapID;
  int mapFileHash=165811;
  float spawnX=-6558;
  float spawnY=-6010;
  int spawnPlane=0;
  return new MapData(mapID,mapFileHash,new GWVector(spawnX,spawnY,spawnPlane));
}
Program: 12934
Project: 12934
Buggy source:
/** 
 * Constructor.
 * @param aggregator
 * @param entityManager
 * @param clientLookupTable 
 */
public AgentVisibility(EventAggregator aggregator,EntityManager entityManager,ClientLookupTable clientLookupTable){
  super(aggregator,UPDATEINTERVAL);
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param aggregator
 * @param entityManager
 * @param clientLookupTable 
 */
public AgentVisibility(EventAggregator aggregator,EntityManager entityManager,ClientLookupTable clientLookupTable){
  super(aggregator,UPDATEINTERVAL);
  this.entityManager=entityManager;
  this.clientLookup=clientLookupTable;
}
Program: 12935
Project: 12935
Buggy source:
@Test public void runTest() throws InterruptedException {
}

Fixed version (ground truth):
@Test public void runTest() throws InterruptedException {
  GlobalExecutor.init(new ScheduledThreadPoolExecutor(12));
  EventAggregator agg=new ConcurrentEventAggregator();
  TestSystem sys=new TestSystem(agg);
  agg.register(sys);
  sys.gotUpdate=false;
  sys.gotTestEvent=false;
  Method[] methods=sys.getClass().getMethods();
  for (  Method method : methods) {
    if (method.getAnnotation(EventHandler.class) == null) {
      continue;
    }
    LOGGER.info("String_Node_Str",method.getName());
  }
  agg.triggerEvent(new HeartBeatEvent(10));
  sys.gotUpdate=false;
  sys.gotTestEvent=false;
  agg.triggerEvent(new TestEvent());
  LOGGER.info("String_Node_Str");
}
Program: 12936
Project: 12936
Buggy source:
private DBCharacter(ResultSet resultSet){
  try {
    this.name=resultSet.getString("String_Node_Str");
    this.appearance=resultSet.getBytes("String_Node_Str");
  }
 catch (  SQLException ex) {
    LOGGER.error("String_Node_Str");
  }
}

Fixed version (ground truth):
private DBCharacter(ResultSet resultSet){
  try {
    this.name=resultSet.getString("String_Node_Str");
    this.skin=resultSet.getByte("String_Node_Str");
    this.sex=resultSet.getByte("String_Node_Str");
    this.height=resultSet.getByte("String_Node_Str");
    this.haircolor=resultSet.getByte("String_Node_Str");
    this.face=resultSet.getByte("String_Node_Str");
    this.primaryProfession=resultSet.getByte("String_Node_Str");
    this.hairstyle=resultSet.getByte("String_Node_Str");
    this.campaign=resultSet.getByte("String_Node_Str");
  }
 catch (  SQLException ex) {
    LOGGER.error("String_Node_Str");
  }
}