nus-yam/ex-repair huggingface dataset:
Program: 11616
Project: 11616
Buggy source:
@Override public void setTabList(TabList tabList){
  TabList old=this.tabList;
  if (old != null) {
    old.unsubscribe(this);
  }
  if (tabList != null) {
    this.tabList=tabList;
    tabList.subscribe(this);
    ((TridentTabList)tabList).forceSend(this);
  }
}

Fixed version (ground truth):
@Override public void setTabList(TabList tabList){
synchronized (this.featuredTabLists) {
    TridentTabList old=this.tabList;
    if (old != null) {
      old.unsubscribe(this);
      this.featuredTabLists.remove(old);
    }
    if (tabList != null) {
      this.tabList=(TridentTabList)tabList;
      this.tabList.subscribe(this);
      this.featuredTabLists.add(tabList);
    }
  }
}
Program: 11617
Project: 11617
Buggy source:
/** 
 * Sets the texture of this player to a different skin data.
 * @param skinTextures the skin textures
 */
public void setTextures(TabListElement.PlayerProperty skinTextures){
  this.skinTextures=skinTextures;
  this.featuredTabLists.forEach(TabList::update);
}

Fixed version (ground truth):
/** 
 * Sets the texture of this player to a different skin data.
 * @param skinTextures the skin textures
 */
public void setTextures(TabListElement.PlayerProperty skinTextures){
  this.skinTextures=skinTextures;
synchronized (this.featuredTabLists) {
    this.featuredTabLists.forEach(TabList::update);
  }
}
Program: 11619
Project: 11619
Buggy source:
@Override public void update(){
synchronized (this.lock) {
    this.elements.clear();
    List<TridentPlayer> players=new ArrayList<>(TridentPlayer.getPlayers().values());
    players.sort(Comparator.comparing(p -> p.getDisplayName().getText()));
    players.forEach(p -> {
      p.featuredTabLists.add(this);
      this.elements.add(new TabListElement(p));
    }
);
  }
  super.update();
}

Fixed version (ground truth):
@Override public void update(){
synchronized (this.lock) {
    this.elements.clear();
    TridentPlayer.getPlayers().values().stream().sorted(Comparator.comparing(p -> p.getDisplayName().getText())).forEach(p -> this.elements.add(new TabListElement(p)));
  }
  super.update();
}
Program: 11620
Project: 11620
Buggy source:
@Override public void subscribe(Player player){
  this.users.add(player);
}

Fixed version (ground truth):
public void subscribe(Player player){
  this.users.add(player);
  PlayOutTabListItem.AddPlayer addPacket=PlayOutTabListItem.addPlayerPacket();
  PlayOutPlayerListHeaderAndFooter headerAndFooterPacket=new PlayOutPlayerListHeaderAndFooter(this.header,this.footer);
synchronized (this.lock) {
    this.elements.forEach(addPacket::addPlayer);
  }
  NetClient net=((TridentPlayer)player).net();
  net.sendPacket(addPacket);
  net.sendPacket(headerAndFooterPacket);
}
Program: 11621
Project: 11621
Buggy source:
@Override public void unsubscribe(Player player){
  this.users.remove(player);
  PlayOutTabListItem.PlayOutTabListItemRemovePlayer packet=PlayOutTabListItem.removePlayerPacket();
  List<TabListElement> elements;
synchronized (this.lock) {
    elements=this.elements;
  }
  for (  TabListElement element : elements) {
    packet.removePlayer(element.getUuid());
  }
  NetClient net=((TridentPlayer)player).net();
  net.sendPacket(packet);
  net.sendPacket(new PlayOutPlayerListHeaderAndFooter(ChatComponent.empty(),ChatComponent.empty()));
}

Fixed version (ground truth):
public void unsubscribe(Player player){
  this.users.remove(player);
  PlayOutTabListItem.RemovePlayer packet=PlayOutTabListItem.removePlayerPacket();
  List<TabListElement> elements;
synchronized (this.lock) {
    elements=this.elements;
  }
  for (  TabListElement element : elements) {
    packet.removePlayer(element.getUuid());
  }
  NetClient net=((TridentPlayer)player).net();
  net.sendPacket(packet);
  net.sendPacket(new PlayOutPlayerListHeaderAndFooter(ChatComponent.empty(),ChatComponent.empty()));
}
Program: 11623
Project: 11623
Buggy source:
@Override public void runCommand(String command){
  this.logger.log("String_Node_Str" + command);
  try {
    if (!ServerThreadPool.forSpec(PoolSpec.PLUGINS).submit(() -> this.commandHandler.dispatch(command,this)).get()) {
      this.logger.log("String_Node_Str" + command.split("String_Node_Str")[0] + "String_Node_Str");
    }
  }
 catch (  InterruptedException|ExecutionException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
@Override public void runCommand(String command){
  this.logger.log("String_Node_Str" + command);
  try {
    if (!ServerThreadPool.forSpec(PoolSpec.PLUGINS).submit(() -> this.commandHandler.dispatch(command,this)).get()) {
      this.logger.log("String_Node_Str" + command.split("String_Node_Str")[0] + "String_Node_Str");
    }
  }
 catch (  InterruptedException|ExecutionException e) {
    throw new RuntimeException(e);
  }
}
Program: 11624
Project: 11624
Buggy source:
@Override @Policy("String_Node_Str") public void shutdown(){
  Debug.tryCheckThread();
  this.logger.warn("String_Node_Str");
  this.shutdownState=true;
  try {
    this.logger.log("String_Node_Str");
    TridentPlayer.getPlayers().values().forEach(p -> p.kick(ChatComponent.text("String_Node_Str")));
    this.tick.interrupt();
    this.logger.log("String_Node_Str");
    if (!this.pluginLoader.unloadAll()) {
      this.logger.error("String_Node_Str");
    }
    for (    World world : TridentWorldLoader.getInstance().getWorlds().values()) {
      this.logger.log("String_Node_Str" + world.getName() + "String_Node_Str");
      world.save();
    }
    this.logger.log("String_Node_Str");
    this.config.save();
    this.logger.log("String_Node_Str");
    ServerThreadPool.shutdownAll();
    this.logger.log("String_Node_Str");
    this.server.shutdown();
  }
 catch (  IOException|InterruptedException e) {
    JiraExceptionCatcher.serverException(e);
    return;
  }
  this.logger.success("String_Node_Str");
  System.exit(0);
}

Fixed version (ground truth):
@Override @Policy("String_Node_Str") public void shutdown(){
  Debug.tryCheckThread();
  this.logger.warn("String_Node_Str");
  this.shutdownState=true;
  try {
    this.logger.log("String_Node_Str");
    if (!this.pluginLoader.unloadAll()) {
      this.logger.error("String_Node_Str");
    }
    this.tick.interrupt();
    this.logger.log("String_Node_Str");
    int removed=0;
    Semaphore sem=new Semaphore(0);
    for (    TridentPlayer player : TridentPlayer.getPlayers().values()) {
      removed++;
      player.net().disconnect(ChatComponent.text("String_Node_Str")).addListener(future -> sem.release());
    }
    sem.tryAcquire(removed,10,TimeUnit.SECONDS);
    this.logger.log("String_Node_Str");
    this.server.shutdown();
    for (    World world : TridentWorldLoader.getInstance().getWorlds().values()) {
      this.logger.log("String_Node_Str" + world.getName() + "String_Node_Str");
      world.save();
    }
    this.logger.log("String_Node_Str");
    this.config.save();
    this.logger.log("String_Node_Str");
    ServerThreadPool.shutdownAll();
  }
 catch (  IOException|InterruptedException e) {
    JiraExceptionCatcher.serverException(e);
    return;
  }
  this.logger.success("String_Node_Str");
  System.exit(0);
}
Program: 11626
Project: 11626
Buggy source:
@Override public ForkJoinWorkerThread newThread(ForkJoinPool pool){
  ForkJoinWorkerThread worker=ForkJoinPool.defaultForkJoinWorkerThreadFactory.newThread(pool);
  worker.setName(this.name + "String_Node_Str" + worker.getPoolIndex());
  return worker;
}

Fixed version (ground truth):
@Override public ForkJoinWorkerThread newThread(ForkJoinPool pool){
  ForkJoinWorkerThread worker=ForkJoinPool.defaultForkJoinWorkerThreadFactory.newThread(pool);
  worker.setName(this.name + "String_Node_Str" + worker.getPoolIndex());
  worker.setUncaughtExceptionHandler(this);
  return worker;
}
Program: 11627
Project: 11627
Buggy source:
/** 
 * Exports the given resource and copies it into the given destination path.
 * @param dest the destination
 * @param resource the resource to copy
 */
public static void exportResource(Path dest,String resource){
  InputStream stream=ConfigIo.class.getResourceAsStream(resource);
  try {
    Files.copy(stream,dest);
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * Exports the given resource and copies it into the given destination path.
 * @param dest the destination
 * @param resource the resource to copy
 */
public static void exportResource(Path dest,String resource){
  InputStream stream=ConfigIo.class.getResourceAsStream(resource);
  try {
    Files.copy(stream,dest);
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}
Program: 11629
Project: 11629
Buggy source:
/** 
 * Disconnects this client from the server.
 * @param reason the reason for disconnecting
 */
public void disconnect(ChatComponent reason){
  TridentPlayer player=this.player.get();
  if (this.player.compareAndSet(player,null)) {
    this.channel.closeFuture().removeListener(this.futureListener);
    NetClient.NetState state=this.state;
    if (state == NetClient.NetState.LOGIN) {
      this.sendPacket(new LoginOutDisconnect(reason)).addListener(future -> {
        this.channel.close();
        TridentServer.getInstance().getLogger().log("String_Node_Str" + this.name + "String_Node_Str"+ reason.getText());
      }
);
    }
 else     if (state == NetClient.NetState.PLAY) {
      if (player != null) {
        this.sendPacket(new PlayOutDisconnect(reason)).addListener(future -> {
          this.channel.close();
          player.remove();
          TridentServer.getInstance().getLogger().log("String_Node_Str" + this.name + "String_Node_Str"+ player.getUuid()+ "String_Node_Str"+ reason.getText());
        }
);
      }
    }
 else     if (state == NetState.STATUS) {
      this.channel.close();
    }
    CLIENTS.remove(this.channel.remoteAddress());
  }
}

Fixed version (ground truth):
/** 
 * Disconnects this client from the server.
 * @param reason the reason for disconnecting
 */
public Future<Void> disconnect(ChatComponent reason){
  String name=this.name.get();
  if (name == null) {
    this.channel.close();
    CLIENTS.remove(this.channel.remoteAddress());
    return null;
  }
  if (name.equals("String_Node_Str")) {
    return null;
  }
  Future<Void> waiter=null;
  if (this.name.compareAndSet(name,"String_Node_Str")) {
    NetClient.NetState state=this.state;
    if (state == NetClient.NetState.LOGIN) {
      waiter=this.sendPacket(new LoginOutDisconnect(reason)).addListener(future -> {
        this.channel.close();
        TridentServer.getInstance().getLogger().log("String_Node_Str" + name + "String_Node_Str"+ reason.getText());
      }
);
    }
 else     if (state == NetClient.NetState.PLAY) {
      TridentPlayer player=this.player;
      if (player != null) {
        waiter=this.sendPacket(new PlayOutDisconnect(reason)).addListener(future -> {
          this.channel.close();
          player.remove();
          TridentServer.getInstance().getLogger().log("String_Node_Str" + name + "String_Node_Str"+ player.getUuid()+ "String_Node_Str"+ reason.getText());
        }
);
      }
    }
 else     if (state == NetState.STATUS) {
      waiter=this.channel.close();
    }
    CLIENTS.remove(this.channel.remoteAddress());
  }
  return waiter;
}
Program: 11630
Project: 11630
Buggy source:
/** 
 * Decrypts the given byte buffer with the information provided by this crypto module.
 * @param buf the buffer
 * @param dest the destination
 */
public void decrypt(ByteBuf buf,ByteBuf dest){
  Function<Integer,Cipher> init=this.cipherInit;
  if (init == null) {
    dest.writeBytes(buf);
    return;
  }
  byte[] bytes=arr(buf);
  Cipher cipher=init.apply(Cipher.DECRYPT_MODE);
  dest.writeBytes(cipher.update(bytes));
}

Fixed version (ground truth):
/** 
 * Decrypts the given byte buffer with the information provided by this crypto module.
 * @param buf the buffer
 * @param dest the destination
 */
public void decrypt(ByteBuf buf,ByteBuf dest,int len){
  Function<Integer,Cipher> init=this.cipherInit;
  if (init == null) {
    dest.writeBytes(buf,len);
    return;
  }
  byte[] bytes=arr(buf,len);
  Cipher cipher=init.apply(Cipher.DECRYPT_MODE);
  dest.writeBytes(cipher.update(bytes));
}
Program: 11632
Project: 11632
Buggy source:
@Override @Policy("String_Node_Str") public boolean unregister(Class<? extends SimpleChannelListener> cls){
  Debug.tryCheckThread();
  return TridentPluginChannel.unregister(cls);
}

Fixed version (ground truth):
@Override @Policy("String_Node_Str") public boolean unregister(Class<? extends SimpleChannelListener> cls){
  return TridentPluginChannel.unregister(cls);
}
Program: 11633
Project: 11633
Buggy source:
@Override @Policy("String_Node_Str") public void register(SimpleChannelListener listener){
  Debug.tryCheckThread();
  TridentPluginChannel.register(listener);
}

Fixed version (ground truth):
@Override @Policy("String_Node_Str") public void register(SimpleChannelListener listener){
  TridentPluginChannel.register(listener);
}
Program: 11634
Project: 11634
Buggy source:
@Override @Policy("String_Node_Str") public void reload(){
  Debug.tryCheckThread();
  this.logger.warn("String_Node_Str");
  try {
    this.logger.log("String_Node_Str");
    this.config.save();
    this.opsList.save();
    this.config.load();
    this.opsList.load();
    this.logger.log("String_Node_Str");
    this.pluginLoader.reload();
  }
 catch (  IOException e) {
    JiraExceptionCatcher.serverException(e);
    return;
  }
  this.logger.success("String_Node_Str");
}

Fixed version (ground truth):
@Override @Policy("String_Node_Str") public void reload(){
  this.logger.warn("String_Node_Str");
  try {
    this.logger.log("String_Node_Str");
    this.config.load();
    this.opsList.load();
    this.logger.log("String_Node_Str");
    this.pluginLoader.reload();
  }
 catch (  IOException e) {
    JiraExceptionCatcher.serverException(e);
    return;
  }
  this.logger.success("String_Node_Str");
}
Program: 11635
Project: 11635
Buggy source:
@Override public Collection<TridentPlayer> getPlayersFuzzyMatching(String filter){
  Objects.requireNonNull(filter,"String_Node_Str");
  return getPlayers().stream().filter(p -> {
    String f=filter;
    String n=p.getName();
    while (n.length() >= f.length()) {
      if (f.length() == 0 || n.length() == 0)       return true;
      int index=n.indexOf(f.charAt(0));
      if (index < 0)       break;
      n=n.substring(index + 1);
      f=f.substring(1);
    }
    return false;
  }
).collect(Collectors.toList());
}

Fixed version (ground truth):
@Override public Collection<TridentPlayer> getPlayersFuzzyMatching(String filter){
  Objects.requireNonNull(filter,"String_Node_Str");
  return getPlayers().stream().filter(p -> {
    String f=filter;
    String n=p.getName();
    while (n.length() >= f.length()) {
      if (f.isEmpty() || n.isEmpty())       return true;
      int index=n.indexOf(f.charAt(0));
      if (index < 0)       break;
      n=n.substring(index + 1);
      f=f.substring(1);
    }
    return false;
  }
).collect(Collectors.toList());
}
Program: 11636
Project: 11636
Buggy source:
@Override @Policy("String_Node_Str") public void shutdown(){
  Debug.tryCheckThread();
  this.logger.warn("String_Node_Str");
  this.shutdownState=true;
  try {
    this.logger.log("String_Node_Str");
    if (!this.pluginLoader.unloadAll()) {
      this.logger.error("String_Node_Str");
    }
    this.tick.interrupt();
    this.logger.log("String_Node_Str");
    int removed=0;
    Semaphore sem=new Semaphore(0);
    for (    TridentPlayer player : TridentPlayer.getPlayers().values()) {
      removed++;
      player.net().disconnect(ChatComponent.text("String_Node_Str")).addListener(future -> sem.release());
    }
    sem.tryAcquire(removed,10,TimeUnit.SECONDS);
    this.logger.log("String_Node_Str");
    this.server.shutdown();
    for (    World world : TridentWorldLoader.getInstance().getWorlds().values()) {
      this.logger.log("String_Node_Str" + world.getName() + "String_Node_Str");
      world.save();
    }
    this.logger.log("String_Node_Str");
    this.config.save();
    this.logger.log("String_Node_Str");
    ServerThreadPool.shutdownAll();
  }
 catch (  IOException|InterruptedException e) {
    JiraExceptionCatcher.serverException(e);
    return;
  }
  this.logger.success("String_Node_Str");
  System.exit(0);
}

Fixed version (ground truth):
@Override @Policy("String_Node_Str") public void shutdown(){
  this.logger.warn("String_Node_Str");
  this.shutdownState=true;
  try {
    this.logger.log("String_Node_Str");
    if (!this.pluginLoader.unloadAll()) {
      this.logger.error("String_Node_Str");
    }
    this.tick.interrupt();
    this.logger.log("String_Node_Str");
    int removed=0;
    Semaphore sem=new Semaphore(0);
    for (    TridentPlayer player : TridentPlayer.getPlayers().values()) {
      removed++;
      player.net().disconnect(ChatComponent.text("String_Node_Str")).addListener(future -> sem.release());
    }
    sem.tryAcquire(removed,10,TimeUnit.SECONDS);
    this.logger.log("String_Node_Str");
    this.server.shutdown();
    for (    World world : TridentWorldLoader.getInstance().getWorlds().values()) {
      this.logger.log("String_Node_Str" + world.getName() + "String_Node_Str");
      world.save();
    }
    this.logger.log("String_Node_Str");
    this.config.save();
    this.logger.log("String_Node_Str");
    ServerThreadPool.shutdownAll();
  }
 catch (  IOException|InterruptedException e) {
    JiraExceptionCatcher.serverException(e);
    return;
  }
  this.logger.success("String_Node_Str");
  System.exit(0);
}
Program: 11637
Project: 11637
Buggy source:
@Command(name="String_Node_Str",help="String_Node_Str",desc="String_Node_Str") @PermissionRequired("String_Node_Str") public void kick(CommandSource source,String[] args,@PlayerExactMatch Player player,String... reason){
  if (player != null) {
    String reasonString=reason.length == 0 ? "String_Node_Str" : String.join("String_Node_Str",reason);
    player.kick(ChatComponent.text(reasonString));
    TridentServer.getInstance().getLogger().log("String_Node_Str" + player.getName() + "String_Node_Str"+ reason);
  }
 else {
    source.sendMessage(ChatComponent.text("String_Node_Str" + args[1] + "String_Node_Str"));
  }
}

Fixed version (ground truth):
@Command(name="String_Node_Str",help="String_Node_Str",desc="String_Node_Str") @PermissionRequired("String_Node_Str") public void kick(CommandSource source,String[] args,@PlayerExactMatch Player player,String... reason){
  if (player != null) {
    String reasonString=reason.length == 0 ? "String_Node_Str" : String.join("String_Node_Str",reason);
    player.kick(ChatComponent.text(reasonString));
    TridentServer.getInstance().getLogger().log("String_Node_Str" + player.getName() + "String_Node_Str"+ reasonString);
  }
 else {
    source.sendMessage(ChatComponent.text("String_Node_Str" + args[1] + "String_Node_Str"));
  }
}
Program: 11638
Project: 11638
Buggy source:
@Override public int hashCode(){
  return id().hashCode();
}

Fixed version (ground truth):
@Override public int hashCode(){
  return this.id().hashCode();
}
Program: 11639
Project: 11639
Buggy source:
@Override public String toString(){
  return id();
}

Fixed version (ground truth):
@Override public String toString(){
  return this.id();
}
Program: 11640
Project: 11640
Buggy source:
private TridentDummyCommandPlugin(String id,String display){
  if (!Arrays.asList("String_Node_Str","String_Node_Str").contains(id))   throw new IllegalArgumentException("String_Node_Str");
  if (!used0.compareAndSet(0,1) && !used1.compareAndSet(0,1)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  PluginDesc pluginDesc=new PluginDesc(){
    @Override public boolean equals(    Object obj){
      return obj == this;
    }
    @Override public int hashCode(){
      return id().hashCode();
    }
    @Override public String toString(){
      return id();
    }
    @Override public Class<? extends Annotation> annotationType(){
      return PluginDesc.class;
    }
    @Override public String id(){
      return id;
    }
    @Override public String name(){
      return display;
    }
    @Override public String version(){
      return "String_Node_Str";
    }
    @Override public String author(){
      return "String_Node_Str";
    }
    @Override public String[] depends(){
      return new String[0];
    }
  }
;
  try {
    Field f=Plugin.class.getDeclaredField("String_Node_Str");
    f.setAccessible(true);
    f.set(this,pluginDesc);
  }
 catch (  ReflectiveOperationException ex) {
    ex.printStackTrace();
  }
}

Fixed version (ground truth):
private TridentDummyCommandPlugin(String id,String display){
  if (!Arrays.asList("String_Node_Str","String_Node_Str").contains(id))   throw new IllegalArgumentException("String_Node_Str");
  if (!used0.compareAndSet(0,1) && !used1.compareAndSet(0,1)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  PluginDesc pluginDesc=new PluginDesc(){
    @Override public boolean equals(    Object obj){
      return obj == this;
    }
    @Override public int hashCode(){
      return this.id().hashCode();
    }
    @Override public String toString(){
      return this.id();
    }
    @Override public Class<? extends Annotation> annotationType(){
      return PluginDesc.class;
    }
    @Override public String id(){
      return id;
    }
    @Override public String name(){
      return display;
    }
    @Override public String version(){
      return "String_Node_Str";
    }
    @Override public String author(){
      return "String_Node_Str";
    }
    @Override public String[] depends(){
      return new String[0];
    }
  }
;
  try {
    Field f=Plugin.class.getDeclaredField("String_Node_Str");
    f.setAccessible(true);
    f.set(this,pluginDesc);
  }
 catch (  ReflectiveOperationException ex) {
    ex.printStackTrace();
  }
}
Program: 11641
Project: 11641
Buggy source:
/** 
 * Creates a new netclient that represents a client's connection to the server.
 * @param ctx the context
 */
public NetClient(ChannelHandlerContext ctx){
  this.channel=ctx.channel();
  this.state=NetClient.NetState.HANDSHAKE;
  this.channel.closeFuture().addListener(this.futureListener);
}

Fixed version (ground truth):
/** 
 * Creates a new netclient that represents a client's connection to the server.
 * @param ctx the context
 */
public NetClient(ChannelHandlerContext ctx){
  this.channel=ctx.channel();
  this.state=NetClient.NetState.HANDSHAKE;
  this.channel.closeFuture().addListener(future -> new GenericFutureListener<Future<Void>>(){
    @Override public void operationComplete(    Future<Void> f) throws Exception {
      f.removeListener(this);
      NetClient.this.disconnect("String_Node_Str");
    }
  }
);
}
Program: 11642
Project: 11642
Buggy source:
@Override public void read(ByteBuf buf,NetClient client){
  long endStamp=System.currentTimeMillis();
  long time=buf.readLong();
  client.setPing(endStamp - time);
  client.sendPacket(new StatusOutPong(time));
}

Fixed version (ground truth):
@Override public void read(ByteBuf buf,NetClient client){
  long endStamp=System.currentTimeMillis();
  long time=buf.readLong();
  client.getPing().set(endStamp - time);
  client.sendPacket(new StatusOutPong(time));
}
Program: 11644
Project: 11644
Buggy source:
public void chat(String msg){
  ChatComponent chat=ChatComponent.create().setTranslate("String_Node_Str").addWith(ChatComponent.create().setText(getName()).setClickEvent(ClickEvent.of(ClickAction.SUGGEST_COMMAND,"String_Node_Str" + getName() + "String_Node_Str"))).addWith(msg);
  Collection<Player> recipients=new ArrayList<>(TridentPlayer.getPlayers().values());
  PlayerChatEvent _event=new PlayerChatEvent(this,chat,recipients);
  ServerThreadPool.forSpec(PoolSpec.PLUGINS).submit(() -> {
    TridentServer.getInstance().getEventController().dispatch(_event,event -> {
      if (!event.isCancelled()) {
        ChatComponent chatComponent=event.getChatComponent();
        event.getRecipients().forEach(p -> p.sendMessage(chatComponent,ChatType.CHAT));
      }
      TridentServer.getInstance().getLogger().log(getName() + "String_Node_Str" + getUuid()+ "String_Node_Str"+ msg);
    }
);
  }
);
}

Fixed version (ground truth):
@Override public void chat(String msg){
  ChatComponent chat=ChatComponent.create().setTranslate("String_Node_Str").addWith(ChatComponent.create().setText(this.getName()).setClickEvent(ClickEvent.of(ClickAction.SUGGEST_COMMAND,"String_Node_Str" + this.getName() + "String_Node_Str"))).addWith(msg);
  Collection<Player> recipients=new ArrayList<>(TridentPlayer.getPlayers().values());
  PlayerChatEvent _event=new PlayerChatEvent(this,chat,recipients);
  ServerThreadPool.forSpec(PoolSpec.PLUGINS).submit(() -> TridentServer.getInstance().getEventController().dispatch(_event,event -> {
    if (!event.isCancelled()) {
      ChatComponent chatComponent=event.getChatComponent();
      event.getRecipients().forEach(p -> p.sendMessage(chatComponent,ChatType.CHAT));
    }
    TridentServer.getInstance().getLogger().log(getName() + "String_Node_Str" + getUuid()+ "String_Node_Str"+ msg);
  }
));
}
Program: 11645
Project: 11645
Buggy source:
@Override public void sendMessage(ChatComponent text){
  StringBuilder builder=new StringBuilder();
  builder.append(text.getColor()).append(text.getText());
  for (  ChatComponent e : text.getExtra()) {
    if (e.getColor() != null) {
      builder.append(e.getColor());
    }
    builder.append(e.getText());
  }
  this.logger.log(builder.toString());
}

Fixed version (ground truth):
@Override public void sendMessage(ChatComponent text){
  StringBuilder builder=new StringBuilder();
  if (text.getColor() != null)   builder.append(text.getColor());
  builder.append(text.getText());
  for (  ChatComponent e : text.getExtra()) {
    if (e.getColor() != null) {
      builder.append(e.getColor());
    }
    builder.append(e.getText());
  }
  this.logger.log(builder.toString());
}
Program: 11646
Project: 11646
Buggy source:
@Command(name="String_Node_Str",help="String_Node_Str",desc="String_Node_Str") @ParamsAnnotations.PermissionRequired("String_Node_Str") @ParamsAnnotations.AllowedSourceTypes({CommandSourceType.PLAYER,CommandSourceType.CONSOLE}) public void deop(CommandSource source,String[] args,@ParamsAnnotations.PlayerExactMatch Player player){
  if (player == null) {
    source.sendMessage(ChatComponent.create().setColor(ChatColor.RED).setText("String_Node_Str"));
  }
 else {
    player.setOp(false);
  }
}

Fixed version (ground truth):
@Command(name="String_Node_Str",help="String_Node_Str",desc="String_Node_Str") @ParamsAnnotations.PermissionRequired("String_Node_Str") @ParamsAnnotations.AllowedSourceTypes({CommandSourceType.PLAYER,CommandSourceType.CONSOLE}) public void deop(CommandSource source,String[] args,@ParamsAnnotations.PlayerExactMatch Player player){
  if (player == null) {
    source.sendMessage(ChatComponent.create().setColor(ChatColor.RED).setText("String_Node_Str" + args[1] + "String_Node_Str"));
  }
 else {
    player.setOp(false);
  }
}
Program: 11647
Project: 11647
Buggy source:
@Command(name="String_Node_Str",help="String_Node_Str",desc="String_Node_Str") @ParamsAnnotations.PermissionRequired("String_Node_Str") public void kick(CommandSource source,String[] args,@ParamsAnnotations.PlayerExactMatch Player player,String... reason){
  if (player != null) {
    String reasonString=reason.length == 0 ? "String_Node_Str" : String.join("String_Node_Str",reason);
    player.kick(ChatComponent.text(reasonString));
    TridentServer.getInstance().getLogger().log("String_Node_Str" + player.getName() + "String_Node_Str"+ reason);
  }
 else {
    source.sendMessage(ChatComponent.text("String_Node_Str"));
  }
}

Fixed version (ground truth):
@Command(name="String_Node_Str",help="String_Node_Str",desc="String_Node_Str") @ParamsAnnotations.PermissionRequired("String_Node_Str") public void kick(CommandSource source,String[] args,@ParamsAnnotations.PlayerExactMatch Player player,String... reason){
  if (player != null) {
    String reasonString=reason.length == 0 ? "String_Node_Str" : String.join("String_Node_Str",reason);
    player.kick(ChatComponent.text(reasonString));
    TridentServer.getInstance().getLogger().log("String_Node_Str" + player.getName() + "String_Node_Str"+ reason);
  }
 else {
    source.sendMessage(ChatComponent.text("String_Node_Str" + args[1] + "String_Node_Str"));
  }
}
Program: 11648
Project: 11648
Buggy source:
@Command(name="String_Node_Str",help="String_Node_Str",desc="String_Node_Str") @ParamsAnnotations.PermissionRequired("String_Node_Str") @ParamsAnnotations.AllowedSourceTypes({CommandSourceType.PLAYER,CommandSourceType.CONSOLE}) public void op(CommandSource source,String[] args,@ParamsAnnotations.PlayerExactMatch Player player){
  if (player == null) {
    source.sendMessage(ChatComponent.create().setColor(ChatColor.RED).setText("String_Node_Str"));
  }
 else {
    player.setOp(true);
  }
}

Fixed version (ground truth):
@Command(name="String_Node_Str",help="String_Node_Str",desc="String_Node_Str") @ParamsAnnotations.PermissionRequired("String_Node_Str") @ParamsAnnotations.AllowedSourceTypes({CommandSourceType.PLAYER,CommandSourceType.CONSOLE}) public void op(CommandSource source,String[] args,@ParamsAnnotations.PlayerExactMatch Player player){
  if (player == null) {
    source.sendMessage(ChatComponent.create().setColor(ChatColor.RED).setText("String_Node_Str" + args[1] + "String_Node_Str"));
  }
 else {
    player.setOp(true);
  }
}
Program: 11649
Project: 11649
Buggy source:
@Command(name="String_Node_Str",aliases="String_Node_Str",help="String_Node_Str",desc="String_Node_Str") @ParamsAnnotations.PermissionRequired("String_Node_Str") @ParamsAnnotations.AllowedSourceTypes(CommandSourceType.PLAYER) public void teleport(CommandSource source,String[] args,@ParamsAnnotations.PlayerExactMatch Player player,double x,double y,double z,@ParamsAnnotations.MaxCount(2) float... direction){
  if (player == null) {
    source.sendMessage(ChatComponent.create().setColor(ChatColor.RED).setText("String_Node_Str"));
  }
 else {
    float pitch=direction.length > 0 ? direction[0] : 0;
    float yaw=direction.length > 1 ? direction[1] : 0;
    player.setPosition(new Position(player.getWorld(),x,y,z,pitch,yaw));
  }
}

Fixed version (ground truth):
@Command(name="String_Node_Str",aliases="String_Node_Str",help="String_Node_Str",desc="String_Node_Str") @ParamsAnnotations.PermissionRequired("String_Node_Str") @ParamsAnnotations.AllowedSourceTypes(CommandSourceType.PLAYER) public void teleport(CommandSource source,String[] args,@ParamsAnnotations.PlayerExactMatch Player player,double x,double y,double z,@ParamsAnnotations.MaxCount(2) float... direction){
  if (player == null) {
    source.sendMessage(ChatComponent.create().setColor(ChatColor.RED).setText("String_Node_Str" + args[1] + "String_Node_Str"));
  }
 else {
    float pitch=direction.length > 0 ? direction[0] : 0;
    float yaw=direction.length > 1 ? direction[1] : 0;
    player.setPosition(new Position(player.getWorld(),x,y,z,pitch,yaw));
  }
}
Program: 11650
Project: 11650
Buggy source:
@Override public Collection<TridentPlayer> getPlayers(){
  return TridentPlayer.getPlayers().values().stream().filter(p -> p.net().getState() == NetClient.NetState.PLAY).collect(Collectors.toSet());
}

Fixed version (ground truth):
@Override public Collection<TridentPlayer> getPlayers(){
  return Collections.unmodifiableCollection(TridentPlayer.getPlayers().values());
}
Program: 11652
Project: 11652
Buggy source:
@Command(name="String_Node_Str",help="String_Node_Str",desc="String_Node_Str") @PermissionRequired("String_Node_Str") public void kick(CommandSource source,String[] args,@PlayerExactMatch Player player,String... reason){
  if (player != null) {
    String reasonString=reason.length == 0 ? "String_Node_Str" : String.join("String_Node_Str",reason);
    player.kick(ChatComponent.text(reasonString));
    TridentServer.getInstance().getLogger().log("String_Node_Str" + player.getName() + "String_Node_Str"+ reasonString);
  }
 else {
    source.sendMessage(ChatComponent.text("String_Node_Str" + args[1] + "String_Node_Str"));
  }
}

Fixed version (ground truth):
@Command(name="String_Node_Str",help="String_Node_Str",desc="String_Node_Str") @PermissionRequired("String_Node_Str") public void kick(CommandSource source,String[] args,Player player,String... reason){
  if (player != null) {
    String reasonString=reason.length == 0 ? "String_Node_Str" : String.join("String_Node_Str",reason);
    player.kick(ChatComponent.text(reasonString));
    TridentServer.getInstance().getLogger().log("String_Node_Str" + player.getName() + "String_Node_Str"+ reasonString);
  }
 else {
    source.sendMessage(ChatComponent.text("String_Node_Str" + args[1] + "String_Node_Str"));
  }
}
Program: 11653
Project: 11653
Buggy source:
/** 
 * Creates a new netclient that represents a client's connection to the server.
 * @param ctx the context
 */
public NetClient(ChannelHandlerContext ctx){
  this.channel=ctx.channel();
  this.state=NetClient.NetState.HANDSHAKE;
  this.channel.closeFuture().addListener(future -> new GenericFutureListener<Future<Void>>(){
    @Override public void operationComplete(    Future<Void> f) throws Exception {
      f.removeListener(this);
      NetClient.this.disconnect("String_Node_Str");
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Creates a new netclient that represents a client's connection to the server.
 * @param ctx the context
 */
public NetClient(ChannelHandlerContext ctx){
  this.channel=ctx.channel();
  this.state=NetClient.NetState.HANDSHAKE;
  this.channel.closeFuture().addListener(new ChannelFutureListener(){
    @Override public void operationComplete(    ChannelFuture channelFuture) throws Exception {
      channelFuture.removeListener(this);
      NetClient.this.disconnect("String_Node_Str");
    }
  }
);
}
Program: 11654
Project: 11654
Buggy source:
@Override public void operationComplete(Future<Void> f) throws Exception {
  f.removeListener(this);
  NetClient.this.disconnect("String_Node_Str");
}

Fixed version (ground truth):
@Override public void operationComplete(ChannelFuture channelFuture) throws Exception {
  channelFuture.removeListener(this);
  NetClient.this.disconnect("String_Node_Str");
}
Program: 11656
Project: 11656
Buggy source:
@Override public void doRemove(){
  if (TridentPlayer.players.remove(this.uuid) == null) {
    Login.finish();
  }
  TridentPluginChannel.autoRemove(this);
  playerNames.remove(this.name);
  this.setTabList(null);
  TridentGlobalTabList.getInstance().update();
  TridentInventory.clean();
  for (  TridentChunk chunk : this.heldChunks.values()) {
    chunk.getHolders().remove(this);
  }
  this.heldChunks.clear();
  ServerThreadPool.forSpec(PoolSpec.PLUGINS).execute(() -> {
    ChatComponent chat=ChatComponent.create().setColor(ChatColor.YELLOW).setTranslate("String_Node_Str").addWith(this.name);
    PlayerQuitEvent event=new PlayerQuitEvent(this,chat);
    TridentServer.getInstance().getEventController().dispatch(event);
    ChatComponent message=event.getMessage();
    if (message != null)     TridentServer.getInstance().getPlayers().forEach(p -> p.sendMessage(message,ChatType.CHAT));
  }
);
  this.client.disconnect(ChatComponent.empty());
}

Fixed version (ground truth):
@Override public void doRemove(){
  if (TridentPlayer.players.remove(this.uuid) == null) {
    Login.finish();
  }
  TridentPluginChannel.autoRemove(this);
  playerNames.remove(this.name);
  this.setTabList(null);
  TridentGlobalTabList.getInstance().update();
  TridentInventory.clean();
  for (  TridentChunk chunk : this.heldChunks.values()) {
    chunk.getHolders().remove(this);
  }
  this.heldChunks.clear();
  ServerThreadPool.forSpec(PoolSpec.PLUGINS).execute(() -> {
    ChatComponent chat=ChatComponent.create().setColor(ChatColor.YELLOW).setTranslate("String_Node_Str").addWith(this.name);
    PlayerQuitEvent event=new PlayerQuitEvent(this,chat);
    TridentServer.getInstance().getEventController().dispatch(event);
    ChatComponent message=event.getMessage();
    if (message != null)     players.values().forEach(p -> p.sendMessage(message,ChatType.CHAT));
  }
);
  this.client.disconnect(ChatComponent.empty());
}
Program: 11657
Project: 11657
Buggy source:
@Override public ChatComponent getElement(int slot){
  return null;
}

Fixed version (ground truth):
@Override public ChatComponent getElement(int slot){
  throw new RuntimeException("String_Node_Str");
}
Program: 11658
Project: 11658
Buggy source:
@Override @Policy("String_Node_Str") public void shutdown(){
  Debug.tryCheckThread();
  this.logger.warn("String_Node_Str");
  this.shutdownState=true;
  try {
    this.logger.log("String_Node_Str");
    TridentPlayer.getPlayers().values().forEach(p -> p.kick(ChatComponent.text("String_Node_Str")));
    this.logger.log("String_Node_Str");
    if (!this.pluginLoader.unloadAll()) {
      this.logger.error("String_Node_Str");
    }
    for (    World world : TridentWorldLoader.getInstance().getWorlds().values()) {
      this.logger.log("String_Node_Str" + world.getName() + "String_Node_Str");
      world.save();
    }
    this.logger.log("String_Node_Str");
    this.config.save();
    this.logger.log("String_Node_Str");
    this.tick.interrupt();
    ServerThreadPool.shutdownAll();
    this.logger.log("String_Node_Str");
    this.server.shutdown();
  }
 catch (  IOException|InterruptedException e) {
    JiraExceptionCatcher.serverException(e);
    return;
  }
  this.logger.success("String_Node_Str");
  System.exit(0);
}

Fixed version (ground truth):
@Override @Policy("String_Node_Str") public void shutdown(){
  Debug.tryCheckThread();
  this.logger.warn("String_Node_Str");
  this.shutdownState=true;
  try {
    this.logger.log("String_Node_Str");
    TridentPlayer.getPlayers().values().forEach(p -> p.kick(ChatComponent.text("String_Node_Str")));
    this.tick.interrupt();
    this.logger.log("String_Node_Str");
    if (!this.pluginLoader.unloadAll()) {
      this.logger.error("String_Node_Str");
    }
    for (    World world : TridentWorldLoader.getInstance().getWorlds().values()) {
      this.logger.log("String_Node_Str" + world.getName() + "String_Node_Str");
      world.save();
    }
    this.logger.log("String_Node_Str");
    this.config.save();
    this.logger.log("String_Node_Str");
    ServerThreadPool.shutdownAll();
    this.logger.log("String_Node_Str");
    this.server.shutdown();
  }
 catch (  IOException|InterruptedException e) {
    JiraExceptionCatcher.serverException(e);
    return;
  }
  this.logger.success("String_Node_Str");
  System.exit(0);
}
Program: 11659
Project: 11659
Buggy source:
/** 
 * Entity superconstructor.
 * @param world the world which the entity is located
 */
public TridentEntity(World world,PoolSpec spec){
  this.id=EID_COUNTER.incrementAndGet();
  this.position=new Position(world);
  this.pool=ServerThreadPool.forSpec(spec);
  EntityMetaType metaType=this.getClass().getAnnotation(EntityMetaType.class);
  if (metaType == null) {
    throw new RuntimeException(this.getClass() + "String_Node_Str");
  }
  try {
    this.metadata=metaType.value().getConstructor(EntityMetadata.class).newInstance(new EntityMetadata());
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
/** 
 * Entity superconstructor.
 * @param world the world which the entity is located
 */
public TridentEntity(World world,PoolSpec spec){
  this.id=EID_COUNTER.incrementAndGet();
  this.position=world.getWorldOptions().getSpawn().toPosition(world);
  this.pool=ServerThreadPool.forSpec(spec);
  EntityMetaType metaType=this.getClass().getAnnotation(EntityMetaType.class);
  if (metaType == null) {
    throw new RuntimeException(this.getClass() + "String_Node_Str");
  }
  try {
    this.metadata=metaType.value().getConstructor(EntityMetadata.class).newInstance(new EntityMetadata());
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}
Program: 11660
Project: 11660
Buggy source:
/** 
 * Spawns a new player.
 * @param client the client representing the player
 * @param name the player name
 * @param uuid the player UUID
 * @param skinTextures the player textures
 */
public static TridentPlayer spawn(NetClient client,String name,UUID uuid,TabListElement.PlayerProperty skinTextures){
  TridentWorld world=TridentServer.getInstance().getWorldLoader().getDefaultWorld();
  TridentPlayer player=new TridentPlayer(client,world,name,uuid,skinTextures);
  client.setPlayer(player);
  TridentPlayer.players.put(uuid,player);
  Login.finish();
  TridentPlayer.playerNames.put(name,player);
  player.position=world.getWorldOptions().getSpawn().toPosition(world);
  player.updateChunks();
  player.resumeLogin();
  return player;
}

Fixed version (ground truth):
/** 
 * Spawns a new player.
 * @param client the client representing the player
 * @param name the player name
 * @param uuid the player UUID
 * @param skinTextures the player textures
 */
public static TridentPlayer spawn(NetClient client,String name,UUID uuid,TabListElement.PlayerProperty skinTextures){
  TridentWorld world=TridentServer.getInstance().getWorldLoader().getDefaultWorld();
  TridentPlayer player=new TridentPlayer(client,world,name,uuid,skinTextures);
  client.setPlayer(player);
  TridentPlayer.players.put(uuid,player);
  Login.finish();
  TridentPlayer.playerNames.put(name,player);
  player.updateChunks();
  player.resumeLogin();
  return player;
}
Program: 11661
Project: 11661
Buggy source:
/** 
 * Send an update to the client with the chunks If direction is null, chunks around the player will be sent
 */
public void updateChunks(){
  TridentWorld world=(TridentWorld)this.getPosition().getWorld();
  int centerX=this.getPosition().getChunkX();
  int centerZ=this.getPosition().getChunkZ();
  int radius=this.renderDistance;
  this.pool.execute(() -> {
    for (int x=centerX - radius; x < centerX + radius; x++) {
      for (int z=centerZ - radius; z < centerZ + radius; z++) {
        TridentChunk chunk=world.getChunkAt(x,z);
        if (!this.heldChunks.contains(chunk)) {
          this.heldChunks.add(chunk);
          chunk.getHolders().add(this);
          this.net().sendPacket(new PlayOutChunk(chunk));
          chunk.getEntities().forEach(e -> this.net().sendPacket(((TridentEntity)e).getSpawnPacket()));
        }
      }
    }
  }
);
  this.pool.execute(() -> {
    for (    TridentChunk chunk : this.heldChunks) {
      if (Math.abs(chunk.getX() - centerX) > radius || Math.abs(chunk.getZ() - centerZ) > radius) {
        this.heldChunks.remove(chunk);
        chunk.getHolders().remove(this);
        this.net().sendPacket(new PlayOutUnloadChunk(chunk.getX(),chunk.getZ()));
        if (!chunk.getEntitySet().isEmpty() || !chunk.getOccupants().isEmpty()) {
          this.net().sendPacket(new PlayOutDestroyEntities(chunk.getEntities().collect(Collectors.toList())));
        }
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Send an update to the client with the chunks If direction is null, chunks around the player will be sent
 */
public void updateChunks(){
  TridentWorld world=(TridentWorld)this.getPosition().getWorld();
  int centerX=this.getPosition().getChunkX();
  int centerZ=this.getPosition().getChunkZ();
  int radius=this.renderDistance;
  this.pool.execute(() -> {
    for (int x=centerX - radius; x < centerX + radius; x++) {
      for (int z=centerZ - radius; z < centerZ + radius; z++) {
        TridentChunk chunk=world.getChunkAt(x,z);
        if (!this.heldChunks.contains(chunk)) {
          this.heldChunks.add(chunk);
          chunk.getEntities().forEach(e -> this.net().sendPacket(((TridentEntity)e).getSpawnPacket()));
          chunk.getHolders().add(this);
          this.net().sendPacket(new PlayOutChunk(chunk));
        }
      }
    }
  }
);
  this.pool.execute(() -> {
    for (    TridentChunk chunk : this.heldChunks) {
      if (Math.abs(chunk.getX() - centerX) > radius || Math.abs(chunk.getZ() - centerZ) > radius) {
        this.heldChunks.remove(chunk);
        chunk.getHolders().remove(this);
        this.net().sendPacket(new PlayOutUnloadChunk(chunk.getX(),chunk.getZ()));
        if (!chunk.getEntitySet().isEmpty() || !chunk.getOccupants().isEmpty()) {
          this.net().sendPacket(new PlayOutDestroyEntities(chunk.getEntities().collect(Collectors.toList())));
        }
        chunk.checkValidForGc();
      }
    }
  }
);
}
Program: 11662
Project: 11662
Buggy source:
@Override public Iterator<TridentChunk> iterator(){
  return this.values().iterator();
}

Fixed version (ground truth):
@Nonnull @Override public Iterator<TridentChunk> iterator(){
  return this.values().iterator();
}
Program: 11663
Project: 11663
Buggy source:
/** 
 * Obtains the chunk at the given location and determines whether a chunk will be generated if it does not exist yet.
 * @param x the x coordinate
 * @param z the z coordinate
 * @param gen {@code true} to generate if non-existant
 * @return the chunk, or {@code null}
 */
public TridentChunk get(int x,int z,boolean gen){
  long key=(long)x << 32 | z & 0xFFFFFFFFL;
synchronized (this.lock) {
    TridentChunk chunk=this.chunks.get(key);
    if (chunk == null && gen) {
      chunk=new TridentChunk(this.world,x,z);
      chunk.generate();
      this.chunks.put(key,chunk);
    }
    return chunk;
  }
}

Fixed version (ground truth):
/** 
 * Obtains the chunk at the given location and determines whether a chunk will be generated if it does not exist yet.
 * @param x the x coordinate
 * @param z the z coordinate
 * @param gen {@code true} to generate if non-existant
 * @return the chunk, or {@code null}
 */
public TridentChunk get(int x,int z,boolean gen){
  long key=(long)x << 32 | z & 0xFFFFFFFFL;
  boolean doGenerate=false;
  TridentChunk chunk;
synchronized (this.lock) {
    chunk=this.chunks.get(key);
    if ((chunk == null || !chunk.canUse()) && gen) {
      chunk=new TridentChunk(this.world,x,z);
      this.chunks.put(key,chunk);
      doGenerate=true;
    }
  }
  if (doGenerate) {
    chunk.generate();
  }
  if (chunk != null) {
    return chunk.waitReady();
  }
 else {
    return null;
  }
}
Program: 11664
Project: 11664
Buggy source:
/** 
 * Reads the chunk data from the region file compound.
 * @param compound the compound to read
 */
public void read(Tag.Compound compound){
  this.inhabited.add(compound.getLong("String_Node_Str"));
  Tag.List<Tag.Compound> sectionList=compound.getList("String_Node_Str");
  for (  Tag.Compound c : sectionList) {
    ChunkSection section=new ChunkSection(this.world.getWorldOptions().getDimension() == Dimension.OVERWORLD);
    section.read(c);
    byte y=c.getByte("String_Node_Str");
    this.sections.set(y,section);
  }
  int[] heightMap=compound.getIntArray("String_Node_Str");
  for (int i=0; i < heightMap.length; i++) {
    this.heights.set(i,heightMap[i]);
  }
  if (compound.getByte("String_Node_Str") == 1) {
    this.ready.countDown();
  }
}

Fixed version (ground truth):
/** 
 * Reads the chunk data from the region file compound.
 * @param compound the compound to read
 */
public void read(Tag.Compound compound){
  this.inhabited.add(compound.getLong("String_Node_Str"));
  Tag.List<Tag.Compound> sectionList=compound.getList("String_Node_Str");
  for (  Tag.Compound c : sectionList) {
    ChunkSection section=new ChunkSection(this.world.getWorldOptions().getDimension() == Dimension.OVERWORLD);
    section.read(c);
    byte y=c.getByte("String_Node_Str");
    this.sections.set(y,section);
  }
  int[] heightMap=compound.getIntArray("String_Node_Str");
  for (int i=0; i < heightMap.length; i++) {
    this.heights.set(i,heightMap[i]);
  }
  if (compound.getByte("String_Node_Str") == 1) {
    this.generationInProgress.set(true);
    this.ready.countDown();
  }
}
Program: 11665
Project: 11665
Buggy source:
/** 
 * Ticks the chunk, updating the inhabited time, tile entities, stateful blocks, and entities.
 */
public void tick(){
  this.inhabited.add(this.occupants.size());
}

Fixed version (ground truth):
/** 
 * Ticks the chunk, updating the inhabited time, tile entities, stateful blocks, and entities.
 */
public void tick(){
  ARBITRARY_POOL.execute(() -> {
    this.inhabited.add(this.occupants.size());
    if (this.world.getTime() == 0) {
      this.checkValidForGc();
    }
  }
);
}