nus-yam/ex-repair huggingface dataset:
Program: 11863
Project: 11863
Buggy source:
@Override public Tile tileAt(int relX,int y,int relZ){
  int index=WorldUtils.getBlockArrayIndex(relX,y,relZ);
  return new TridentTile(Coordinates.create(this.world,relX + this.getX() * 16,y,relZ + this.getZ() * 16),null,(byte)0);
}

Fixed version (ground truth):
@Override public Tile tileAt(int relX,int y,int relZ){
  int index=WorldUtils.getBlockArrayIndex(relX,y,relZ);
  ChunkSection section=sections[WorldUtils.getSection(y)];
  return new TridentTile(Coordinates.create(this.world,relX + this.getX() * 16,y,relZ + this.getZ() * 16),null,(byte)0);
}
Program: 11864
Project: 11864
Buggy source:
@Override public void handleReceived(ClientConnection connection){
  Window window=TridentServer.getInstance().getWindow(this.windowId);
  PlayerClickItemEvent clickEvent=new PlayerClickItemEvent(window,this.clickedSlot,(int)this.actionNumber);
  TridentServer.getInstance().getEventHandler().call(clickEvent);
  if (clickEvent.isIgnored()) {
  }
}

Fixed version (ground truth):
@Override public void handleReceived(ClientConnection connection){
  Window window=TridentServer.getInstance().windowBy(this.windowId);
  PlayerClickItemEvent clickEvent=new PlayerClickItemEvent(window,this.clickedSlot,(int)this.actionNumber);
  TridentServer.getInstance().eventHandler().call(clickEvent);
  if (clickEvent.isIgnored()) {
  }
}
Program: 11865
Project: 11865
Buggy source:
@Override public void handleReceived(ClientConnection connection){
  PlayerCloseWindowEvent event=new PlayerCloseWindowEvent(TridentServer.getInstance().getWindow(this.id));
  TridentServer.getInstance().getEventHandler().call(event);
  if (event.isIgnored()) {
  }
}

Fixed version (ground truth):
@Override public void handleReceived(ClientConnection connection){
  PlayerCloseWindowEvent event=new PlayerCloseWindowEvent(TridentServer.getInstance().windowBy(this.id));
  TridentServer.getInstance().eventHandler().call(event);
  if (event.isIgnored()) {
  }
}
Program: 11866
Project: 11866
Buggy source:
@Override public void handleReceived(ClientConnection connection){
  TridentPlayer player=((PlayerConnection)connection).getPlayer();
  DigStatus digStatus=DigStatus.getStatus(this.status);
  TileOrientation face=null;
switch (this.blockFace) {
case 0:
    face=TileOrientation.BOTTOM;
  break;
case 1:
face=TileOrientation.TOP;
break;
case 2:
break;
case 3:
break;
case 4:
break;
case 5:
break;
default :
TridentLogger.error(new IllegalArgumentException("String_Node_Str"));
}
Cancellable event=null;
switch (digStatus) {
case DIG_START:
case DIG_CANCEL:
case DIG_FINISH:
event=new PlayerDigEvent(player,face,this.status);
break;
case DROP_ITEMSTACK:
event=new PlayerDropItemEvent(player,null);
break;
case DROP_ITEM:
event=new PlayerDropItemEvent(player,null);
break;
case SHOOT_ARROW:
break;
}
TridentServer.getInstance().getEventHandler().call((Event)event);
if (event == null || event.isIgnored()) return;
this.location.setWorld(player.getWorld());
}

Fixed version (ground truth):
@Override public void handleReceived(ClientConnection connection){
  TridentPlayer player=((PlayerConnection)connection).getPlayer();
  DigStatus digStatus=DigStatus.getStatus(this.status);
  TileOrientation face=null;
switch (this.blockFace) {
case 0:
    face=TileOrientation.BOTTOM;
  break;
case 1:
face=TileOrientation.TOP;
break;
case 2:
break;
case 3:
break;
case 4:
break;
case 5:
break;
default :
TridentLogger.error(new IllegalArgumentException("String_Node_Str"));
}
Cancellable event=null;
switch (digStatus) {
case DIG_START:
case DIG_CANCEL:
case DIG_FINISH:
event=new PlayerDigEvent(player,face,this.status);
break;
case DROP_ITEMSTACK:
event=new PlayerDropItemEvent(player,null);
break;
case DROP_ITEM:
event=new PlayerDropItemEvent(player,null);
break;
case SHOOT_ARROW:
break;
}
TridentServer.getInstance().eventHandler().call((Event)event);
if (event == null || event.isIgnored()) return;
this.location.setWorld(player.getWorld());
}
Program: 11867
Project: 11867
Buggy source:
@Override public void handleReceived(ClientConnection connection){
  TridentPlayer player=((PlayerConnection)connection).getPlayer();
  Coordinates from=player.getLocation();
  Coordinates to=player.getLocation();
  to.setYaw(this.newYaw);
  to.setPitch(this.newPitch);
  PlayerMoveEvent event=new PlayerMoveEvent(player,from,to);
  TridentServer.getInstance().getEventHandler().call(event);
  if (event.isIgnored()) {
    PacketPlayOutEntityTeleport cancel=new PacketPlayOutEntityTeleport();
    cancel.set("String_Node_Str",player.getId()).set("String_Node_Str",from).set("String_Node_Str",player.isOnGround());
    TridentPlayer.sendAll(cancel);
    return;
  }
  player.setLocation(to);
  PacketPlayOutEntityLook headMove=new PacketPlayOutEntityLook();
  headMove.set("String_Node_Str",player.getId()).set("String_Node_Str",to).set("String_Node_Str",player.isOnGround());
  TridentPlayer.sendAll(headMove);
}

Fixed version (ground truth):
@Override public void handleReceived(ClientConnection connection){
  TridentPlayer player=((PlayerConnection)connection).getPlayer();
  Coordinates from=player.getLocation();
  Coordinates to=player.getLocation();
  to.setYaw(this.newYaw);
  to.setPitch(this.newPitch);
  PlayerMoveEvent event=new PlayerMoveEvent(player,from,to);
  TridentServer.getInstance().eventHandler().call(event);
  if (event.isIgnored()) {
    PacketPlayOutEntityTeleport cancel=new PacketPlayOutEntityTeleport();
    cancel.set("String_Node_Str",player.getId()).set("String_Node_Str",from).set("String_Node_Str",player.isOnGround());
    TridentPlayer.sendAll(cancel);
    return;
  }
  player.setLocation(to);
  PacketPlayOutEntityLook headMove=new PacketPlayOutEntityLook();
  headMove.set("String_Node_Str",player.getId()).set("String_Node_Str",to).set("String_Node_Str",player.isOnGround());
  TridentPlayer.sendAll(headMove);
}
Program: 11868
Project: 11868
Buggy source:
@Override public void handleReceived(ClientConnection connection){
  TridentPlayer player=((PlayerConnection)connection).getPlayer();
  this.location.setWorld(player.getWorld());
  Coordinates from=player.getLocation();
  Coordinates to=this.location;
  PlayerMoveEvent event=new PlayerMoveEvent(player,from,to);
  TridentServer.getInstance().getEventHandler().call(event);
  if (event.isIgnored()) {
    PacketPlayOutEntityTeleport cancel=new PacketPlayOutEntityTeleport();
    cancel.set("String_Node_Str",player.getId()).set("String_Node_Str",from).set("String_Node_Str",player.isOnGround());
    TridentPlayer.sendAll(cancel);
    return;
  }
  player.setLocation(to);
  Packet move=new PacketPlayOutEntityCompleteMove();
  TridentPlayer.sendAll(move);
}

Fixed version (ground truth):
@Override public void handleReceived(ClientConnection connection){
  TridentPlayer player=((PlayerConnection)connection).getPlayer();
  this.location.setWorld(player.getWorld());
  Coordinates from=player.getLocation();
  Coordinates to=this.location;
  PlayerMoveEvent event=new PlayerMoveEvent(player,from,to);
  TridentServer.getInstance().eventHandler().call(event);
  if (event.isIgnored()) {
    PacketPlayOutEntityTeleport cancel=new PacketPlayOutEntityTeleport();
    cancel.set("String_Node_Str",player.getId()).set("String_Node_Str",from).set("String_Node_Str",player.isOnGround());
    TridentPlayer.sendAll(cancel);
    return;
  }
  player.setLocation(to);
  Packet move=new PacketPlayOutEntityCompleteMove();
  TridentPlayer.sendAll(move);
}
Program: 11870
Project: 11870
Buggy source:
@Override public Set<World> worlds(){
  Set<World> worlds=Sets.newHashSet();
  worlds.addAll(worldLoader.getWorlds());
  return worlds;
}

Fixed version (ground truth):
@Override public Map<String,World> worlds(){
  Map<String,World> worlds=Maps.newHashMap();
  for (  World world : worldLoader.getWorlds())   worlds.put(world.name(),world);
  return worlds;
}
Program: 11871
Project: 11871
Buggy source:
@Override public World call(){
  for (  World world : Trident.getWorlds()) {
    if (world.name().equals("String_Node_Str"))     return world;
  }
  return null;
}

Fixed version (ground truth):
@Override public World call(){
  for (  World world : Trident.getWorlds().values()) {
    if (world.name().equals("String_Node_Str"))     return world;
  }
  return null;
}
Program: 11873
Project: 11873
Buggy source:
private PlayerConnection(ClientConnection connection,TridentPlayer player){
  ClientConnection.clientData.remove(connection.getAddress());
  ClientConnection.clientData.put(connection.getAddress(),new AtomicReference<ClientConnection>(this));
  super.address=connection.getAddress();
  super.channel=connection.getChannel();
  super.loginKeyPair=connection.getLoginKeyPair();
  super.sharedSecret=connection.getSharedSecret();
  super.stage=Protocol.ClientStage.PLAY;
  super.encryptionEnabled=connection.isEncryptionEnabled();
  super.compressionEnabled=connection.isCompressionEnabled();
  this.player=player;
  this.keepAliveId=-1;
}

Fixed version (ground truth):
private PlayerConnection(ClientConnection connection,TridentPlayer player){
  ClientConnection.clientData.remove(connection.getAddress());
  ClientConnection.clientData.put(connection.getAddress(),new AtomicReference<ClientConnection>(this));
  super.address=connection.getAddress();
  super.channel=connection.getChannel();
  super.loginKeyPair=connection.getLoginKeyPair();
  super.sharedSecret=connection.getSharedSecret();
  super.stage=Protocol.ClientStage.PLAY;
  super.encryptionEnabled=connection.isEncryptionEnabled();
  super.compressionEnabled=connection.isCompressionEnabled();
  this.player=player;
  this.keepAliveId=-1;
  PacketHandler handler=channel.pipeline().get(PacketHandler.class);
  if (handler != null) {
    handler.updateConnection(this);
  }
}
Program: 11874
Project: 11874
Buggy source:
public void doRun(){
  long startTime=System.currentTimeMillis();
  this.ticksElapsed.getAndIncrement();
  if (this.pausedTicking) {
    this.calcAndWait(0);
    return;
  }
  if (this.ticksToWait.get() > 0) {
    this.ticksToWait.getAndDecrement();
    this.calcAndWait(0);
    return;
  }
  this.notLostTicksElapsed.getAndIncrement();
  WorldThreads.notifyTick();
  if (this.redstoneTick) {
    WorldThreads.notifyRedstoneTick();
    this.redstoneTick=false;
  }
 else {
    this.redstoneTick=true;
  }
  this.calcAndWait((int)(System.currentTimeMillis() - startTime));
}

Fixed version (ground truth):
public void doRun(){
  long startTime=System.currentTimeMillis();
  this.ticksElapsed.getAndIncrement();
  if (this.pausedTicking) {
    this.calcAndWait(0);
    return;
  }
  if (this.ticksToWait.get() > 0) {
    this.ticksToWait.getAndDecrement();
    this.calcAndWait(0);
    return;
  }
  this.notLostTicksElapsed.getAndIncrement();
  WorldThreads.notifyTick();
  for (  TridentPlayer player : TridentPlayer.getPlayers()) {
    TaskExecutor executor=ThreadsManager.players.assign(player);
    executor.addTask(new Runnable(){
      @Override public void run(){
        player.tick();
      }
    }
);
  }
  if (this.redstoneTick) {
    WorldThreads.notifyRedstoneTick();
    this.redstoneTick=false;
  }
 else {
    this.redstoneTick=true;
  }
  this.calcAndWait((int)(System.currentTimeMillis() - startTime));
}
Program: 11875
Project: 11875
Buggy source:
private void sendCompressed(ByteBuf msg,ByteBuf out) throws IOException {
  int index=msg.readerIndex();
  int length=msg.readableBytes();
  byte[] decompressed=new byte[length];
  msg.readBytes(decompressed);
  deflater.setInput(decompressed);
  deflater.finish();
  ByteArrayOutputStream compressed=new ByteArrayOutputStream();
  int compressedLength=0;
  int readLength;
  while ((readLength=deflater.deflate(buffer)) > 0) {
    compressedLength+=readLength;
    compressed.write(buffer,0,readLength);
  }
  deflater.end();
  deflater.reset();
  if (compressedLength == 0 || compressedLength > length) {
    msg.readerIndex(index);
    sendDecompressed(msg,out);
    return;
  }
  Codec.writeVarInt32(out,compressedLength + BigInteger.valueOf(length).toByteArray().length);
  Codec.writeVarInt32(out,length);
  out.writeBytes(compressed.toByteArray());
}

Fixed version (ground truth):
private void sendCompressed(ByteBuf msg,ByteBuf out) throws IOException {
  int index=msg.readerIndex();
  int length=msg.readableBytes();
  byte[] decompressed=new byte[length];
  msg.readBytes(decompressed);
  deflater.setInput(decompressed);
  deflater.finish();
  ByteArrayOutputStream compressed=new ByteArrayOutputStream();
  int compressedLength=0;
  int readLength;
  while ((readLength=deflater.deflate(buffer)) > 0) {
    compressedLength+=readLength;
    compressed.write(buffer,0,readLength);
  }
  if (compressedLength == 0 || compressedLength > length) {
    msg.readerIndex(index);
    sendDecompressed(msg,out);
    return;
  }
  Codec.writeVarInt32(out,compressedLength + BigInteger.valueOf(length).toByteArray().length);
  Codec.writeVarInt32(out,length);
  out.writeBytes(compressed.toByteArray());
  deflater.reset();
}
Program: 11876
Project: 11876
Buggy source:
public void doRun(){
  long startTime=System.currentTimeMillis();
  this.ticksElapsed.getAndIncrement();
  if (this.pausedTicking) {
    this.calcAndWait(0);
    return;
  }
  if (this.ticksToWait.get() > 0) {
    this.ticksToWait.getAndDecrement();
    this.calcAndWait(0);
    return;
  }
  this.notLostTicksElapsed.getAndIncrement();
  WorldThreads.notifyTick();
  for (  TridentPlayer player : TridentPlayer.getPlayers()) {
    TaskExecutor executor=ThreadsManager.players.assign(player);
    executor.addTask(new Runnable(){
      @Override public void run(){
        player.tick();
      }
    }
);
  }
  if (this.redstoneTick) {
    WorldThreads.notifyRedstoneTick();
    this.redstoneTick=false;
  }
 else {
    this.redstoneTick=true;
  }
  this.calcAndWait((int)(System.currentTimeMillis() - startTime));
}

Fixed version (ground truth):
public void doRun(){
  long startTime=System.currentTimeMillis();
  this.ticksElapsed.getAndIncrement();
  if (this.pausedTicking) {
    this.calcAndWait(0);
    return;
  }
  if (this.ticksToWait.get() > 0) {
    this.ticksToWait.getAndDecrement();
    this.calcAndWait(0);
    return;
  }
  this.notLostTicksElapsed.getAndIncrement();
  WorldThreads.notifyTick();
  for (  Player player : TridentPlayer.getPlayers()) {
    TaskExecutor executor=ThreadsManager.players.assign(player);
    executor.addTask(new Runnable(){
      @Override public void run(){
        player.tick();
      }
    }
);
  }
  if (this.redstoneTick) {
    WorldThreads.notifyRedstoneTick();
    this.redstoneTick=false;
  }
 else {
    this.redstoneTick=true;
  }
  this.calcAndWait((int)(System.currentTimeMillis() - startTime));
}
Program: 11877
Project: 11877
Buggy source:
@InternalUseOnly protected TridentTile(Coordinates location,boolean createdByServer){
  this.location=location;
}

Fixed version (ground truth):
public TridentTile(Coordinates location,Substance substance,byte meta){
  this.location=location;
  this.material=substance;
  this.data=meta;
}
Program: 11878
Project: 11878
Buggy source:
/** 
 * Begin entity management
 * @return the current entity
 */
public TridentEntity spawn(){
  MANAGER.registerEntity(this);
  return this;
}

Fixed version (ground truth):
/** 
 * Begin entity management
 * @return the current entity
 */
public TridentEntity spawn(){
  if (this instanceof TridentPlayer) {
    return this;
  }
  MANAGER.registerEntity(this);
  return this;
}
Program: 11879
Project: 11879
Buggy source:
@Override public ItemStack getContent(int slot){
  return this.inventory.getContents()[slot];
}

Fixed version (ground truth):
@Override public Item getContent(int slot){
  return this.inventory.getContents()[slot];
}
Program: 11880
Project: 11880
Buggy source:
/** 
 * Inherits UUID and spawnLocation from   {@link TridentEntity}
 * @param source the entity which fired the projectile
 */
public TridentProjectile(UUID uniqueId,Coordinates spawnLocation,ProjectileSource source){
  super(uniqueId,spawnLocation);
  this.source=new WeakReference<>(source);
}

Fixed version (ground truth):
/** 
 * Inherits UUID and spawnLocation from   {@link TridentEntity}
 * @param source the entity which fired the projectile
 */
public TridentProjectile(UUID uniqueId,Coordinates spawnLocation,ProjectileLauncher source){
  super(uniqueId,spawnLocation);
  this.source=new WeakReference<>(source);
}
Program: 11881
Project: 11881
Buggy source:
@Override public void setEquipment(ItemStack[] stack){
}

Fixed version (ground truth):
@Override public void setEquipment(Item[] stack){
}
Program: 11882
Project: 11882
Buggy source:
@Override public ItemStack[] getEquipment(){
  return new ItemStack[0];
}

Fixed version (ground truth):
@Override public Item[] getEquipment(){
  return new Item[0];
}
Program: 11883
Project: 11883
Buggy source:
@Override public void setEquipment(ItemStack[] stack){
  this.equipment=stack;
}

Fixed version (ground truth):
@Override public void setEquipment(Item[] stack){
  this.equipment=stack;
}
Program: 11884
Project: 11884
Buggy source:
public void applyArmorUpdate(){
  for (int i=0; i < equipment.length; i++) {
    ItemStack stack=equipment[i];
    PacketPlayOutEntityEquipment entityEquipment=new PacketPlayOutEntityEquipment();
    entityEquipment.set("String_Node_Str",original().getId()).set("String_Node_Str",(short)i + 5).set(String.valueOf(i + 5),Long.decode(Integer.toHexString(stack.getId()) + "String_Node_Str").longValue());
    TridentPlayer.sendAll(entityEquipment);
  }
}

Fixed version (ground truth):
public void applyArmorUpdate(){
  for (int i=0; i < equipment.length; i++) {
    Item stack=equipment[i];
    PacketPlayOutEntityEquipment entityEquipment=new PacketPlayOutEntityEquipment();
    entityEquipment.set("String_Node_Str",original().getId()).set("String_Node_Str",(short)i + 5).set(String.valueOf(i + 5),Long.decode(Integer.toHexString(stack.getId()) + "String_Node_Str").longValue());
    TridentPlayer.sendAll(entityEquipment);
  }
}
Program: 11885
Project: 11885
Buggy source:
@Override public ItemStack[] getEquipment(){
  return equipment;
}

Fixed version (ground truth):
@Override public Item[] getEquipment(){
  return equipment;
}
Program: 11886
Project: 11886
Buggy source:
@Override public void setSlot(int index,ItemStack value){
  itemStacks[index]=value;
}

Fixed version (ground truth):
@Override public void setSlot(int index,Item value){
  itemStacks[index]=value;
}
Program: 11887
Project: 11887
Buggy source:
protected DecoratedInventoryHolder(Entity entity,final String string,final int size,InventoryType type){
  super(entity);
  inventory=new Inventory(){
    private final int inventoryId=inventoryIds++;
    private final ItemStack[] itemStacks=new ItemStack[size];
    private final String name=string;
    @Override public int getId(){
      return inventoryId;
    }
    @Override public ItemStack[] getContents(){
      return itemStacks;
    }
    @Override public int getLength(){
      return itemStacks.length;
    }
    @Override public void setSlot(    int index,    ItemStack value){
      itemStacks[index]=value;
    }
    @Override public String getName(){
      return name;
    }
  }
;
  this.type=type;
}

Fixed version (ground truth):
protected DecoratedInventoryHolder(Entity entity,final String string,final int size,InventoryType type){
  super(entity);
  inventory=new Inventory(){
    private final int inventoryId=inventoryIds++;
    private final Item[] itemStacks=new Item[size];
    private final String name=string;
    @Override public int getId(){
      return inventoryId;
    }
    @Override public Item[] getContents(){
      return itemStacks;
    }
    @Override public int getLength(){
      return itemStacks.length;
    }
    @Override public void setSlot(    int index,    Item value){
      itemStacks[index]=value;
    }
    @Override public String getName(){
      return name;
    }
  }
;
  this.type=type;
}
Program: 11888
Project: 11888
Buggy source:
@Override public ItemStack getContent(int slot){
  return inventory.getContents()[slot];
}

Fixed version (ground truth):
@Override public Item getContent(int slot){
  return inventory.getContents()[slot];
}
Program: 11889
Project: 11889
Buggy source:
@Override public ItemStack[] getContents(){
  return itemStacks;
}

Fixed version (ground truth):
@Override public Item[] getContents(){
  return itemStacks;
}
Program: 11892
Project: 11892
Buggy source:
/** 
 * Gets the location of the raw offset of the chunk
 * @param c chunk
 * @return offsetLoc in bytes
 */
private int getOffsetLoc(Chunk c){
  return IntMath.mod(c.getX(),32) + IntMath.mod(c.getZ(),32) * 32;
}

Fixed version (ground truth):
/** 
 * Gets the location of the raw offset of the chunk
 * @param c chunk
 * @return offsetLoc in bytes
 */
private int getOffsetLoc(Chunk c){
  return c.getX() + c.getZ() * 32;
}
Program: 11894
Project: 11894
Buggy source:
public void write(PacketPlayOutChunkData packet){
  packet.set("String_Node_Str",location);
  int bitmask;
  int count;
  bitmask=(1 << sections.length) - 1;
  count=sections.length;
  int size=0;
  int sectionSize=ChunkSection.LENGTH * 5 / 2;
  if (world.getDimension() == Dimension.OVERWORLD) {
    sectionSize+=ChunkSection.LENGTH / 2;
  }
  size+=count * sectionSize + 256;
  byte[] data=new byte[size];
  int pos=0;
  for (  ChunkSection section : sections) {
    for (    byte b : section.getTypes()) {
      data[pos++]=(byte)(b & 0xff);
      data[pos++]=(byte)(b >> 8);
    }
  }
  for (  ChunkSection section : sections) {
    System.arraycopy(section.blockLight,0,data,pos,section.blockLight.length);
    pos+=section.blockLight.length;
  }
  for (  ChunkSection section : sections) {
    System.arraycopy(section.skyLight,0,data,pos,section.skyLight.length);
    pos+=section.skyLight.length;
  }
  for (int i=0; i < 256; i+=1) {
    data[pos++]=0;
  }
  if (pos != size) {
    throw new IllegalStateException("String_Node_Str" + pos + "String_Node_Str"+ size+ "String_Node_Str");
  }
  packet.set("String_Node_Str",data);
  packet.set("String_Node_Str",true);
  packet.set("String_Node_Str",bitmask);
}

Fixed version (ground truth):
public void write(PacketPlayOutChunkData packet){
  packet.set("String_Node_Str",location);
  int bitmask;
  int count;
  bitmask=(1 << sections.length) - 1;
  count=sections.length;
  int size=0;
  int sectionSize=ChunkSection.LENGTH * 5 / 2;
  if (world.getDimension() == Dimension.OVERWORLD) {
    sectionSize+=ChunkSection.LENGTH / 2;
  }
  size+=count * sectionSize + 256;
  System.out.println(size);
  byte[] data=new byte[size];
  int pos=0;
  for (  ChunkSection section : sections) {
    for (    byte b : section.getTypes()) {
      data[pos++]=(byte)(b & 0xff);
      data[pos++]=(byte)(b >> 8);
    }
  }
  for (  ChunkSection section : sections) {
    System.arraycopy(section.blockLight,0,data,pos,section.blockLight.length);
    pos+=section.blockLight.length;
  }
  for (int i=0; i < 256; i+=1) {
    data[pos++]=0;
  }
  if (pos != size) {
    throw new IllegalStateException("String_Node_Str" + pos + "String_Node_Str"+ size+ "String_Node_Str");
  }
  packet.set("String_Node_Str",data);
  packet.set("String_Node_Str",true);
  packet.set("String_Node_Str",(short)bitmask);
}
Program: 11895
Project: 11895
Buggy source:
@Override public void handleReceived(ClientConnection connection){
  Window window=TridentServer.getInstance().getWindow(this.windowId);
  PlayerClickItemEvent clickEvent=new PlayerClickItemEvent(window,this.clickedSlot,(int)this.actionNumber);
  TridentServer.getInstance().getEventManager().call(clickEvent);
  if (clickEvent.isCancelled()) {
  }
}

Fixed version (ground truth):
@Override public void handleReceived(ClientConnection connection){
  Window window=TridentServer.getInstance().getWindow(this.windowId);
  PlayerClickItemEvent clickEvent=new PlayerClickItemEvent(window,this.clickedSlot,(int)this.actionNumber);
  TridentServer.getInstance().getEventManager().call(clickEvent);
  if (clickEvent.isIgnored()) {
  }
}
Program: 11896
Project: 11896
Buggy source:
@Override public void handleReceived(ClientConnection connection){
  PlayerCloseWindowEvent event=new PlayerCloseWindowEvent(TridentServer.getInstance().getWindow(this.id));
  TridentServer.getInstance().getEventManager().call(event);
  if (event.isCancelled()) {
  }
}

Fixed version (ground truth):
@Override public void handleReceived(ClientConnection connection){
  PlayerCloseWindowEvent event=new PlayerCloseWindowEvent(TridentServer.getInstance().getWindow(this.id));
  TridentServer.getInstance().getEventManager().call(event);
  if (event.isIgnored()) {
  }
}
Program: 11897
Project: 11897
Buggy source:
@Override public void handleReceived(ClientConnection connection){
  TridentPlayer player=((PlayerConnection)connection).getPlayer();
  Location from=player.getLocation();
  Location to=player.getLocation();
  to.setYaw(this.newYaw);
  to.setPitch(this.newPitch);
  PlayerMoveEvent event=new PlayerMoveEvent(player,from,to);
  TridentServer.getInstance().getEventManager().call(event);
  if (event.isCancelled()) {
    PacketPlayOutEntityTeleport cancel=new PacketPlayOutEntityTeleport();
    cancel.set("String_Node_Str",player.getId()).set("String_Node_Str",from).set("String_Node_Str",player.isOnGround());
    TridentPlayer.sendAll(cancel);
    return;
  }
  player.setLocation(to);
  PacketPlayOutEntityLook headMove=new PacketPlayOutEntityLook();
  headMove.set("String_Node_Str",player.getId()).set("String_Node_Str",to).set("String_Node_Str",player.isOnGround());
  TridentPlayer.sendAll(headMove);
}

Fixed version (ground truth):
@Override public void handleReceived(ClientConnection connection){
  TridentPlayer player=((PlayerConnection)connection).getPlayer();
  Location from=player.getLocation();
  Location to=player.getLocation();
  to.setYaw(this.newYaw);
  to.setPitch(this.newPitch);
  PlayerMoveEvent event=new PlayerMoveEvent(player,from,to);
  TridentServer.getInstance().getEventManager().call(event);
  if (event.isIgnored()) {
    PacketPlayOutEntityTeleport cancel=new PacketPlayOutEntityTeleport();
    cancel.set("String_Node_Str",player.getId()).set("String_Node_Str",from).set("String_Node_Str",player.isOnGround());
    TridentPlayer.sendAll(cancel);
    return;
  }
  player.setLocation(to);
  PacketPlayOutEntityLook headMove=new PacketPlayOutEntityLook();
  headMove.set("String_Node_Str",player.getId()).set("String_Node_Str",to).set("String_Node_Str",player.isOnGround());
  TridentPlayer.sendAll(headMove);
}
Program: 11898
Project: 11898
Buggy source:
@Override public void handleReceived(ClientConnection connection){
  TridentPlayer player=((PlayerConnection)connection).getPlayer();
  this.location.setWorld(player.getWorld());
  Location from=player.getLocation();
  Location to=this.location;
  PlayerMoveEvent event=new PlayerMoveEvent(player,from,to);
  TridentServer.getInstance().getEventManager().call(event);
  if (event.isCancelled()) {
    PacketPlayOutEntityTeleport cancel=new PacketPlayOutEntityTeleport();
    cancel.set("String_Node_Str",player.getId()).set("String_Node_Str",from).set("String_Node_Str",player.isOnGround());
    TridentPlayer.sendAll(cancel);
    return;
  }
  player.setLocation(to);
  Packet move=new PacketPlayOutEntityCompleteMove();
  TridentPlayer.sendAll(move);
}

Fixed version (ground truth):
@Override public void handleReceived(ClientConnection connection){
  TridentPlayer player=((PlayerConnection)connection).getPlayer();
  this.location.setWorld(player.getWorld());
  Location from=player.getLocation();
  Location to=this.location;
  PlayerMoveEvent event=new PlayerMoveEvent(player,from,to);
  TridentServer.getInstance().getEventManager().call(event);
  if (event.isIgnored()) {
    PacketPlayOutEntityTeleport cancel=new PacketPlayOutEntityTeleport();
    cancel.set("String_Node_Str",player.getId()).set("String_Node_Str",from).set("String_Node_Str",player.isOnGround());
    TridentPlayer.sendAll(cancel);
    return;
  }
  player.setLocation(to);
  Packet move=new PacketPlayOutEntityCompleteMove();
  TridentPlayer.sendAll(move);
}
Program: 11900
Project: 11900
Buggy source:
@Override public void handleReceived(ClientConnection connection){
  TridentPlayer player=((PlayerConnection)connection).getPlayer();
  World world=player.getWorld();
  StatusType type=StatusType.getStatus((int)this.actionId);
switch (type) {
case RESPAWN:
    PacketPlayOutPlayerRespawn respawn=new PacketPlayOutPlayerRespawn();
  respawn.set("String_Node_Str",(int)world.getDimesion().toByte()).set("String_Node_Str",(int)world.getDifficulty().toByte()).set("String_Node_Str",(int)world.getDefaultGamemode().toByte());
connection.sendPacket(respawn);
break;
case STATISTICS_REQUEST:
PacketPlayOutStatistics statistics=new PacketPlayOutStatistics();
statistics.set("String_Node_Str",null);
connection.sendPacket(statistics);
break;
case OPEN_INVENTORY_ACHEIVEMENT:
break;
default :
throw new IllegalArgumentException("String_Node_Str");
}
}

Fixed version (ground truth):
@Override public void handleReceived(ClientConnection connection){
  TridentPlayer player=((PlayerConnection)connection).getPlayer();
  World world=player.getWorld();
  StatusType type=StatusType.getStatus((int)this.actionId);
switch (type) {
case RESPAWN:
    PacketPlayOutPlayerRespawn respawn=new PacketPlayOutPlayerRespawn();
  respawn.set("String_Node_Str",(int)((TridentWorld)world).getDimesion().toByte()).set("String_Node_Str",(int)world.getDifficulty().toByte()).set("String_Node_Str",(int)world.getDefaultGamemode().toByte());
connection.sendPacket(respawn);
break;
case STATISTICS_REQUEST:
PacketPlayOutStatistics statistics=new PacketPlayOutStatistics();
statistics.set("String_Node_Str",null);
connection.sendPacket(statistics);
break;
case OPEN_INVENTORY_ACHEIVEMENT:
break;
default :
throw new IllegalArgumentException("String_Node_Str");
}
}
Program: 11901
Project: 11901
Buggy source:
public CompoundTag toNbt(){
  CompoundTag tag=new CompoundTag(getUniqueId().toString());
  tag.addTag(new IntTag("String_Node_Str").setValue(dimesion.toByte()));
  tag.addTag(new IntTag("String_Node_Str").setValue(gameMode.toByte()));
  tag.addTag(new IntTag("String_Node_Str").setValue(score));
  tag.addTag(new IntTag("String_Node_Str").setValue(selectedSlot));
  tag.addTag(NBTSerializer.serialize(new Slot(getItemInHand())));
  tag.addTag(new IntTag("String_Node_Str").setValue((int)spawnLocation.getX()));
  tag.addTag(new IntTag("String_Node_Str").setValue((int)spawnLocation.getY()));
  tag.addTag(new IntTag("String_Node_Str").setValue((int)spawnLocation.getZ()));
  tag.addTag(new ShortTag("String_Node_Str").setValue(hunger));
  tag.addTag(new FloatTag("String_Node_Str").setValue(exhaustion));
  tag.addTag(new FloatTag("String_Node_Str").setValue(saturation));
  tag.addTag(new IntTag("String_Node_Str").setValue(foodTickTimer));
  tag.addTag(new IntTag("String_Node_Str").setValue(xpLevel));
  tag.addTag(new FloatTag("String_Node_Str").setValue(xpPercent));
  tag.addTag(new IntTag("String_Node_Str").setValue(xpTotal));
  tag.addTag(new IntTag("String_Node_Str").setValue(xpSeed));
  ListTag inventoryTag=new ListTag("String_Node_Str",TagType.COMPOUND);
  for (  ItemStack is : inventory.getContents()) {
    inventoryTag.addTag(NBTSerializer.serialize(new Slot(is)));
  }
  tag.addTag(inventoryTag);
  ListTag enderTag=new ListTag("String_Node_Str",TagType.COMPOUND);
  for (  ItemStack is : enderChest.getContents()) {
    enderTag.addTag(NBTSerializer.serialize(new Slot(is)));
  }
  tag.addTag(enderTag);
  tag.addTag(NBTSerializer.serialize(abilities,"String_Node_Str"));
  return tag;
}

Fixed version (ground truth):
public CompoundTag toNbt(){
  CompoundTag tag=new CompoundTag(getUniqueId().toString());
  tag.addTag(new IntTag("String_Node_Str").setValue(dimesion.toByte()));
  tag.addTag(new IntTag("String_Node_Str").setValue(gameMode.toByte()));
  tag.addTag(new IntTag("String_Node_Str").setValue(score));
  tag.addTag(new IntTag("String_Node_Str").setValue(selectedSlot));
  tag.addTag(new IntTag("String_Node_Str").setValue((int)spawnLocation.getX()));
  tag.addTag(new IntTag("String_Node_Str").setValue((int)spawnLocation.getY()));
  tag.addTag(new IntTag("String_Node_Str").setValue((int)spawnLocation.getZ()));
  tag.addTag(new ShortTag("String_Node_Str").setValue(hunger));
  tag.addTag(new FloatTag("String_Node_Str").setValue(exhaustion));
  tag.addTag(new FloatTag("String_Node_Str").setValue(saturation));
  tag.addTag(new IntTag("String_Node_Str").setValue(foodTickTimer));
  tag.addTag(new IntTag("String_Node_Str").setValue(xpLevel));
  tag.addTag(new FloatTag("String_Node_Str").setValue(xpPercent));
  tag.addTag(new IntTag("String_Node_Str").setValue(xpTotal));
  tag.addTag(new IntTag("String_Node_Str").setValue(xpSeed));
  ListTag inventoryTag=new ListTag("String_Node_Str",TagType.COMPOUND);
  tag.addTag(inventoryTag);
  ListTag enderTag=new ListTag("String_Node_Str",TagType.COMPOUND);
  tag.addTag(enderTag);
  tag.addTag(NBTSerializer.serialize(abilities,"String_Node_Str"));
  return tag;
}
Program: 11903
Project: 11903
Buggy source:
public static Player spawnPlayer(ClientConnection connection,UUID id,String name){
  OfflinePlayer offlinePlayer=OfflinePlayer.getOfflinePlayer(id);
  if (offlinePlayer == null) {
    offlinePlayer=OfflinePlayer.generatePlayer(name,id);
  }
  TridentPlayer p=new TridentPlayer(offlinePlayer.toNbt(),(TridentWorld)offlinePlayer.getWorld(),connection);
  p.connection.sendPacket(new PacketPlayOutJoinGame().set("String_Node_Str",p.getId()).set("String_Node_Str",p.getGameMode()).set("String_Node_Str",p.getWorld().getDimesion()).set("String_Node_Str",p.getWorld().getDifficulty()).set("String_Node_Str",(short)10).set("String_Node_Str",LevelType.DEFAULT));
  p.connection.sendPacket(new PacketPlayOutSpawnPosition().set("String_Node_Str",p.getSpawnLocation()));
  p.connection.sendPacket(p.abilities.toPacket());
  p.connection.sendPacket(new PacketPlayOutPlayerCompleteMove().set("String_Node_Str",p.getLocation()).set("String_Node_Str",(byte)0));
  p.sendChunks(7);
  players.add(p);
  return p;
}

Fixed version (ground truth):
public static Player spawnPlayer(ClientConnection connection,UUID id,String name){
  CompoundTag offlinePlayer=(OfflinePlayer.getOfflinePlayer(id) == null) ? null : OfflinePlayer.getOfflinePlayer(id).toNbt();
  if (offlinePlayer == null) {
    offlinePlayer=OfflinePlayer.generatePlayer(name,id);
  }
  TridentPlayer p=new TridentPlayer(offlinePlayer,(TridentWorld)Trident.getWorlds().iterator().next(),connection);
  p.connection.sendPacket(new PacketPlayOutJoinGame().set("String_Node_Str",p.getId()).set("String_Node_Str",p.getGameMode()).set("String_Node_Str",((TridentWorld)p.getWorld()).getDimesion()).set("String_Node_Str",p.getWorld().getDifficulty()).set("String_Node_Str",(short)10).set("String_Node_Str",LevelType.DEFAULT));
  p.connection.sendPacket(new PacketPlayOutSpawnPosition().set("String_Node_Str",p.getSpawnLocation()));
  p.connection.sendPacket(p.abilities.toPacket());
  p.connection.sendPacket(new PacketPlayOutPlayerCompleteMove().set("String_Node_Str",p.getLocation()).set("String_Node_Str",(byte)0));
  p.sendChunks(7);
  players.add(p);
  return p;
}
Program: 11904
Project: 11904
Buggy source:
private void sendChunks(int viewDistance){
  int centX=((int)Math.floor(loc.getX())) >> 4;
  int centZ=((int)Math.floor(loc.getZ())) >> 4;
  for (int x=(centX - viewDistance); x <= (centX + viewDistance); x+=1) {
    for (int z=(centZ - viewDistance); z <= (centZ + viewDistance); z+=1) {
      PacketPlayOutChunkData packet=new PacketPlayOutChunkData();
      ((TridentChunk)getWorld().getChunkAt(x,z,false)).write(packet);
      connection.sendPacket(packet);
    }
  }
}

Fixed version (ground truth):
private void sendChunks(int viewDistance){
  int centX=((int)Math.floor(loc.getX())) >> 4;
  int centZ=((int)Math.floor(loc.getZ())) >> 4;
  for (int x=(centX - viewDistance); x <= (centX + viewDistance); x+=1) {
    for (int z=(centZ - viewDistance); z <= (centZ + viewDistance); z+=1) {
      PacketPlayOutChunkData packet=new PacketPlayOutChunkData();
      ((TridentChunk)getWorld().getChunkAt(x,z,true)).write(packet);
      connection.sendPacket(packet);
    }
  }
}
Program: 11905
Project: 11905
Buggy source:
/** 
 * Gets the location of the raw offset of the chunk
 * @param c chunk
 * @return offsetLoc in bytes
 */
private int getOffsetLoc(Chunk c){
  return IntMath.mod(c.getX(),32) + IntMath.mod(c.getX(),32) * 32;
}

Fixed version (ground truth):
/** 
 * Gets the location of the raw offset of the chunk
 * @param c chunk
 * @return offsetLoc in bytes
 */
private int getOffsetLoc(Chunk c){
  return IntMath.mod(c.getX(),32) + IntMath.mod(c.getZ(),32) * 32;
}
Program: 11906
Project: 11906
Buggy source:
@Override public Dimension getDimesion(){
  return dimension;
}

Fixed version (ground truth):
public Dimension getDimesion(){
  return dimension;
}
Program: 11907
Project: 11907
Buggy source:
@Override public boolean accept(File file,String s){
  String[] strings=s.split("String_Node_Str");
  return s.endsWith("String_Node_Str") && s.length() == 3 && strings[0].equals("String_Node_Str") && StringUtil.isNumeric(strings[1]) && StringUtil.isNumeric(strings[2]);
}

Fixed version (ground truth):
@Override public boolean accept(File file,String s){
  String[] strings=s.split("String_Node_Str");
  return s.endsWith("String_Node_Str") && strings.length == 4 && strings[0].equals("String_Node_Str");
}
Program: 11910
Project: 11910
Buggy source:
@Override public void handleReceived(ClientConnection connection){
  LoginManager.getInstance().initLogin(connection.getAddress(),this.getName());
  PacketLoginOutEncryptionRequest p=new PacketLoginOutEncryptionRequest();
  connection.generateToken();
  p.set("String_Node_Str",connection.getVerificationToken());
  try {
    KeyPair pair=RSA.generate(1024);
    p.set("String_Node_Str",pair.getPublic().getEncoded());
    connection.setLoginKeyPair(pair);
  }
 catch (  NoSuchAlgorithmException ignored) {
  }
  connection.enableCompression();
  connection.sendPacket(p);
}

Fixed version (ground truth):
@Override public void handleReceived(ClientConnection connection){
  LoginManager.getInstance().initLogin(connection.getAddress(),this.getName());
  PacketLoginOutEncryptionRequest p=new PacketLoginOutEncryptionRequest();
  connection.generateToken();
  p.set("String_Node_Str",connection.getVerificationToken());
  try {
    KeyPair pair=RSA.generate(1024);
    p.set("String_Node_Str",pair.getPublic().getEncoded());
    connection.setLoginKeyPair(pair);
  }
 catch (  NoSuchAlgorithmException ignored) {
  }
  connection.sendPacket(p);
}
Program: 11911
Project: 11911
Buggy source:
private void sendChunks(int viewDistance){
  int centX=((int)Math.floor(loc.getX())) >> 4;
  int centZ=((int)Math.floor(loc.getZ())) >> 4;
  System.out.println("String_Node_Str" + centX + "String_Node_Str"+ centZ);
  for (int x=(centX - viewDistance); x <= (centX + viewDistance); x+=1) {
    for (int z=(centZ - viewDistance); z <= (centZ + viewDistance); z+=1) {
      System.out.println(x + "String_Node_Str" + z);
      connection.sendPacket(((TridentChunk)getWorld().getChunkAt(x,z,true)).toPacket());
    }
  }
}

Fixed version (ground truth):
private void sendChunks(int viewDistance){
  int centX=((int)Math.floor(loc.getX())) >> 4;
  int centZ=((int)Math.floor(loc.getZ())) >> 4;
  for (int x=(centX - viewDistance); x <= (centX + viewDistance); x+=1) {
    for (int z=(centZ - viewDistance); z <= (centZ + viewDistance); z+=1) {
      connection.sendPacket(((TridentChunk)getWorld().getChunkAt(x,z,true)).toPacket());
    }
  }
}
Program: 11912
Project: 11912
Buggy source:
@Override protected void decode(ChannelHandlerContext context,ByteBuf buf,List<Object> objects) throws Exception {
  boolean compressed=connection.isCompressionEnabled();
  if (compressed)   Codec.readVarInt32(buf);
  this.rawLength=Codec.readVarInt32(buf);
  if (!(compressed) || rawLength < TridentServer.getInstance().getCompressionThreshold()) {
    ByteBuf data=buf.readBytes(this.rawLength);
    objects.add(new PacketData(data));
    return;
  }
  byte[] compressedData=new byte[buf.readableBytes()];
  byte[] decompressed=new byte[rawLength];
  buf.readBytes(compressedData);
  inflater.setInput(compressedData);
  inflater.inflate(decompressed);
  objects.add(new PacketData(Unpooled.wrappedBuffer(decompressed)));
  inflater.reset();
}

Fixed version (ground truth):
@Override protected void decode(ChannelHandlerContext context,ByteBuf buf,List<Object> objects) throws Exception {
  boolean compressed=connection.isCompressionEnabled();
  this.rawLength=Codec.readVarInt32(buf);
  if (!(compressed) || rawLength < TridentServer.getInstance().getCompressionThreshold()) {
    ByteBuf data=buf.readBytes(this.rawLength);
    objects.add(new PacketData(data));
    return;
  }
  byte[] compressedData=new byte[buf.readableBytes()];
  byte[] decompressed=new byte[rawLength];
  buf.readBytes(compressedData);
  inflater.setInput(compressedData);
  inflater.inflate(decompressed);
  objects.add(new PacketData(Unpooled.wrappedBuffer(decompressed)));
  inflater.reset();
}
Program: 11913
Project: 11913
Buggy source:
@Override protected void encode(ChannelHandlerContext channelHandlerContext,ByteBuf msg,ByteBuf out) throws Exception {
  boolean underThreshold=msg.readableBytes() < TridentServer.getInstance().getCompressionThreshold();
  if (underThreshold && connection.isCompressionEnabled()) {
    sendUncompressed(msg,out);
  }
 else   if (!(underThreshold) && connection.isCompressionEnabled()) {
    sendCompressed(msg,out);
  }
 else {
    Codec.writeVarInt32(out,msg.readableBytes());
    out.writeBytes(msg);
  }
}

Fixed version (ground truth):
@Override protected void encode(ChannelHandlerContext channelHandlerContext,ByteBuf msg,ByteBuf out) throws Exception {
  boolean underThreshold=msg.readableBytes() < TridentServer.getInstance().getCompressionThreshold();
  if (underThreshold && connection.isCompressionEnabled()) {
    sendDecompressed(msg,out);
  }
 else   if (!(underThreshold) && connection.isCompressionEnabled()) {
    sendCompressed(msg,out);
  }
 else {
    Codec.writeVarInt32(out,msg.readableBytes());
    out.writeBytes(msg);
  }
}
Program: 11914
Project: 11914
Buggy source:
private void sendCompressed(ByteBuf msg,ByteBuf out){
  int index=msg.readerIndex();
  int length=msg.readableBytes();
  byte[] decompressed=new byte[length];
  msg.readBytes(decompressed);
  deflater.setInput(decompressed);
  deflater.finish();
  ByteBuf compressed=Unpooled.buffer();
  int compressedLength=0;
  while (!(deflater.finished())) {
    int readLength=deflater.deflate(buffer);
    compressedLength+=readLength;
    compressed.writeBytes(buffer);
  }
  if (compressedLength == 0 || compressedLength >= length) {
    Codec.writeVarInt32(out,0);
    msg.readerIndex(index);
    out.writeBytes(msg);
    return;
  }
  Codec.writeVarInt32(out,compressedLength + BigInteger.valueOf(length).toByteArray().length);
  Codec.writeVarInt32(out,length);
  msg.writeBytes(compressed);
}

Fixed version (ground truth):
private void sendCompressed(ByteBuf msg,ByteBuf out){
  int index=msg.readerIndex();
  int length=msg.readableBytes();
  byte[] decompressed=new byte[length];
  msg.readBytes(decompressed);
  deflater.setInput(decompressed);
  deflater.finish();
  ByteBuf compressed=Unpooled.buffer();
  int compressedLength=0;
  int readLength;
  while ((readLength=deflater.deflate(buffer)) > 0) {
    compressedLength+=readLength;
    compressed.writeBytes(buffer,0,readLength);
  }
  deflater.reset();
  System.out.println("String_Node_Str" + compressedLength + "String_Node_Str"+ length);
  if (compressedLength == 0 || compressedLength > length) {
    msg.readerIndex(index);
    sendDecompressed(msg,out);
    return;
  }
  Codec.writeVarInt32(out,compressedLength + BigInteger.valueOf(length).toByteArray().length);
  Codec.writeVarInt32(out,length);
  out.writeBytes(compressed);
}
Program: 11916
Project: 11916
Buggy source:
public TridentWorldLoader(){
  for (  File file : new File("String_Node_Str").listFiles()) {
    if (!(file.isDirectory()) || file.getName().contains("String_Node_Str")) {
      continue;
    }
    boolean isWorld=false;
    for (    File f : file.listFiles()) {
      if (f.getName().equals("String_Node_Str")) {
        isWorld=true;
      }
    }
    if (!(isWorld)) {
      continue;
    }
    load(file.getName());
  }
}

Fixed version (ground truth):
public TridentWorldLoader(){
  for (  File file : getWorldContainer().listFiles()) {
    if (!(file.isDirectory()) || file.getName().contains("String_Node_Str")) {
      continue;
    }
    boolean isWorld=false;
    for (    File f : file.listFiles()) {
      if (f.getName().equals("String_Node_Str")) {
        isWorld=true;
      }
    }
    if (!(isWorld)) {
      continue;
    }
    load(file.getName());
  }
}
Program: 11917
Project: 11917
Buggy source:
@Override public void handleReceived(ClientConnection connection){
  TridentPlayer player=((PlayerConnection)connection).getPlayer();
  player.setLocale(this.locale);
}

Fixed version (ground truth):
@Override public void handleReceived(ClientConnection connection){
  TridentPlayer player=((PlayerConnection)connection).getPlayer();
  player.setLocale(locale);
}
Program: 11918
Project: 11918
Buggy source:
public void load(CompoundTag tag){
  IntTag x=tag.getTagAs("String_Node_Str");
  IntTag z=tag.getTagAs("String_Node_Str");
  LongTag lastModifed=tag.getTagAs("String_Node_Str");
  ByteTag lightPopulated=tag.getTagAs("String_Node_Str");
  ByteTag terrainPopulated=tag.getTagAs("String_Node_Str");
  LongTag inhabitedTime=tag.getTagAs("String_Node_Str");
  ByteArrayTag biomes=tag.getTagAs("String_Node_Str");
  ListTag sections=tag.getTagAs("String_Node_Str");
  ListTag entities=tag.getTagAs("String_Node_Str");
  ListTag tileEntities=tag.getTagAs("String_Node_Str");
  ListTag tileTicks=tag.getTagAs("String_Node_Str");
  List<NBTTag> sectionsList=sections.listTags();
  this.sections=new ChunkSection[sectionsList.size()];
  for (int i=0; i <= sectionsList.size(); i+=1) {
    NBTTag t=sections.getTag(i);
    if (t instanceof CompoundTag) {
      CompoundTag ct=(CompoundTag)t;
      this.sections[i]=NBTSerializer.deserialize(ChunkSection.class,ct);
      this.sections[i].loadBlocks();
    }
  }
  FastClass entityClass=FastClass.get(TridentEntity.class);
  for (  NBTTag t : entities.listTags()) {
    TridentEntity entity=entityClass.getConstructor().newInstance();
    entity.load((CompoundTag)t);
    this.entities.add(entity);
  }
  this.lightPopulated=lightPopulated.getValue();
  this.terrainPopulated=terrainPopulated.getValue();
  this.lastModified=lastModifed.getValue();
  this.inhabitedTime=inhabitedTime.getValue();
}

Fixed version (ground truth):
public void load(CompoundTag tag){
  TridentLogger logger=Trident.getLogger();
  logger.info("String_Node_Str");
  IntTag x=tag.getTagAs("String_Node_Str");
  IntTag z=tag.getTagAs("String_Node_Str");
  LongTag lastModifed=tag.getTagAs("String_Node_Str");
  ByteTag lightPopulated=tag.getTagAs("String_Node_Str");
  ByteTag terrainPopulated=tag.getTagAs("String_Node_Str");
  LongTag inhabitedTime=tag.getTagAs("String_Node_Str");
  ByteArrayTag biomes=tag.getTagAs("String_Node_Str");
  ListTag sections=tag.getTagAs("String_Node_Str");
  ListTag entities=tag.getTagAs("String_Node_Str");
  ListTag tileEntities=tag.getTagAs("String_Node_Str");
  ListTag tileTicks=tag.getTagAs("String_Node_Str");
  logger.info("String_Node_Str");
  logger.info("String_Node_Str");
  List<NBTTag> sectionsList=sections.listTags();
  this.sections=new ChunkSection[sectionsList.size()];
  for (int i=0; i <= sectionsList.size(); i+=1) {
    NBTTag t=sections.getTag(i);
    if (t instanceof CompoundTag) {
      CompoundTag ct=(CompoundTag)t;
      this.sections[i]=NBTSerializer.deserialize(ChunkSection.class,ct);
      this.sections[i].loadBlocks();
    }
  }
  logger.info("String_Node_Str");
  FastClass entityClass=FastClass.get(TridentEntity.class);
  for (  NBTTag t : entities.listTags()) {
    TridentEntity entity=entityClass.getConstructor().newInstance();
    entity.load((CompoundTag)t);
    this.entities.add(entity);
  }
  logger.info("String_Node_Str");
  this.lightPopulated=lightPopulated.getValue();
  this.terrainPopulated=terrainPopulated.getValue();
  this.lastModified=lastModifed.getValue();
  this.inhabitedTime=inhabitedTime.getValue();
  logger.info("String_Node_Str");
}