nus-yam/ex-repair huggingface dataset:
Program: 80817
Project: 80817
Buggy source:
/** 
 * @return the events custom context
 */
public List<SelfDescribingJson> getContext(){
  return this.context;
}

Fixed version (ground truth):
/** 
 * @return the events custom context
 */
public List<SelfDescribingJson> getContext(){
  return new ArrayList<>(this.context);
}
Program: 80818
Project: 80818
Buggy source:
protected HttpResponse sendPostData(Payload payload){
  HttpResponse httpResponse=null;
  AsyncHttpPost asyncHttpPost=new AsyncHttpPost(payload);
  asyncHttpPost.execute();
  try {
    httpResponse=asyncHttpPost.get();
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
catch (  ExecutionException e) {
    e.printStackTrace();
  }
  return httpResponse;
}

Fixed version (ground truth):
protected HttpResponse sendPostData(Payload payload){
  HttpResponse httpResponse=null;
  AsyncHttpPost asyncHttpPost=new AsyncHttpPost(payload,indexArray);
  asyncHttpPost.execute();
  try {
    httpResponse=asyncHttpPost.get();
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
catch (  ExecutionException e) {
    e.printStackTrace();
  }
  return httpResponse;
}
Program: 80819
Project: 80819
Buggy source:
AsyncHttpGet(Payload payload){
  this.payload=payload;
}

Fixed version (ground truth):
AsyncHttpGet(Payload payload,LinkedList<Long> pendingEventIds){
  this.payload=payload;
  this.pendingEventIds=pendingEventIds;
}
Program: 80820
Project: 80820
Buggy source:
protected HttpResponse sendGetData(Payload payload){
  HttpResponse httpResponse=null;
  AsyncHttpGet asyncHttpGet=new AsyncHttpGet(payload);
  asyncHttpGet.execute();
  try {
    httpResponse=asyncHttpGet.get();
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
catch (  ExecutionException e) {
    e.printStackTrace();
  }
  return httpResponse;
}

Fixed version (ground truth):
protected HttpResponse sendGetData(Payload payload){
  HttpResponse httpResponse=null;
  AsyncHttpGet asyncHttpGet=new AsyncHttpGet(payload,indexArray);
  asyncHttpGet.execute();
  try {
    httpResponse=asyncHttpGet.get();
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
catch (  ExecutionException e) {
    e.printStackTrace();
  }
  return httpResponse;
}
Program: 80821
Project: 80821
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public void flushBuffer(){
  indexArray=new LinkedList<Long>();
  if (httpMethod == HttpMethod.GET) {
    for (    Map<String,Object> eventMetadata : eventStore.getAllNonPendingEvents()) {
      TrackerPayload payload=new TrackerPayload();
      payload.addMap((Map<String,Object>)eventMetadata.get(EventStoreHelper.METADATA_EVENT_DATA));
      indexArray.add((Long)eventMetadata.get(EventStoreHelper.METADATA_ID));
      eventStore.setPending((Long)eventMetadata.get(EventStoreHelper.METADATA_ID));
      this.sendGetData(payload);
    }
  }
 else   if (httpMethod == HttpMethod.POST) {
    SchemaPayload postPayload=new SchemaPayload();
    postPayload.setSchema(Constants.SCHEMA_PAYLOAD_DATA);
    ArrayList<Map> eventMaps=new ArrayList<Map>();
    for (    Map<String,Object> eventMetadata : eventStore.getAllNonPendingEvents()) {
      TrackerPayload payload=new TrackerPayload();
      payload.addMap((Map<String,Object>)eventMetadata.get(EventStoreHelper.METADATA_EVENT_DATA));
      indexArray.add((Long)eventMetadata.get(EventStoreHelper.METADATA_ID));
      eventStore.setPending((Long)eventMetadata.get(EventStoreHelper.METADATA_ID));
      eventMaps.add(payload.getMap());
    }
    Log.d(TAG,"String_Node_Str" + indexArray);
    postPayload.setData(eventMaps);
    this.sendPostData(postPayload);
  }
}

Fixed version (ground truth):
/** 
 * Empties the cached events manually. This shouldn't be used unless you're aware of it works. If you need events send instantly, use set the <code>Emitter</code> buffer to <code>BufferOption.Instant</code>
 */
@SuppressWarnings("String_Node_Str") @Override public void flushBuffer(){
  indexArray=new LinkedList<Long>();
  if (httpMethod == HttpMethod.GET) {
    for (    Map<String,Object> eventMetadata : eventStore.getAllNonPendingEvents()) {
      TrackerPayload payload=new TrackerPayload();
      payload.addMap((Map<String,Object>)eventMetadata.get(EventStoreHelper.METADATA_EVENT_DATA));
      indexArray.add((Long)eventMetadata.get(EventStoreHelper.METADATA_ID));
      eventStore.setPending((Long)eventMetadata.get(EventStoreHelper.METADATA_ID));
      this.sendGetData(payload);
    }
  }
 else   if (httpMethod == HttpMethod.POST) {
    SchemaPayload postPayload=new SchemaPayload();
    postPayload.setSchema(Constants.SCHEMA_PAYLOAD_DATA);
    ArrayList<Map> eventMaps=new ArrayList<Map>();
    for (    Map<String,Object> eventMetadata : eventStore.getAllNonPendingEvents()) {
      TrackerPayload payload=new TrackerPayload();
      payload.addMap((Map<String,Object>)eventMetadata.get(EventStoreHelper.METADATA_EVENT_DATA));
      indexArray.add((Long)eventMetadata.get(EventStoreHelper.METADATA_ID));
      eventStore.setPending((Long)eventMetadata.get(EventStoreHelper.METADATA_ID));
      eventMaps.add(payload.getMap());
    }
    Log.d(TAG,"String_Node_Str" + indexArray);
    postPayload.setData(eventMaps);
    this.sendPostData(postPayload);
  }
}
Program: 80822
Project: 80822
Buggy source:
@Override protected void onPostExecute(HttpResponse response){
  unsentPayloads=new LinkedList<Payload>();
  int success_count=0;
  int status_code=response.getStatusLine().getStatusCode();
  Log.d(TAG,"String_Node_Str" + status_code);
  if (status_code == 200) {
    success_count++;
    for (int i=0; i < indexArray.size(); i++) {
      eventStore.removeEvent(indexArray.get(i));
      Log.d(TAG,"String_Node_Str" + indexArray.get(i));
    }
  }
 else {
    unsentPayloads.add(payload);
    for (int i=0; i < indexArray.size(); i++) {
      Log.d(TAG,"String_Node_Str" + indexArray.get(i));
      eventStore.removePending(indexArray.get(i));
    }
  }
  if (unsentPayloads.size() == 0) {
    if (requestCallback != null)     requestCallback.onSuccess(success_count);
  }
 else   if (requestCallback != null)   requestCallback.onFailure(success_count,unsentPayloads);
}

Fixed version (ground truth):
@Override protected void onPostExecute(HttpResponse response){
  unsentPayloads=new LinkedList<Payload>();
  int success_count=0;
  int status_code=response.getStatusLine().getStatusCode();
  Log.d(TAG,"String_Node_Str" + status_code);
  if (status_code == 200) {
    success_count++;
    for (int i=0; i < this.pendingEventIds.size(); i++) {
      eventStore.removeEvent(this.pendingEventIds.get(i));
      Log.d(TAG,"String_Node_Str" + this.pendingEventIds.get(i));
    }
  }
 else {
    unsentPayloads.add(payload);
    for (int i=0; i < this.pendingEventIds.size(); i++) {
      Log.d(TAG,"String_Node_Str" + this.pendingEventIds.get(i));
      eventStore.removePending(this.pendingEventIds.get(i));
    }
  }
  if (unsentPayloads.size() == 0) {
    if (requestCallback != null)     requestCallback.onSuccess(success_count);
  }
 else   if (requestCallback != null) {
    requestCallback.onFailure(success_count,unsentPayloads);
  }
}
Program: 80823
Project: 80823
Buggy source:
AsyncHttpPost(Payload payload){
  this.payload=payload;
}

Fixed version (ground truth):
AsyncHttpPost(Payload payload,LinkedList<Long> pendingEventIds){
  this.payload=payload;
  this.pendingEventIds=pendingEventIds;
}
Program: 80824
Project: 80824
Buggy source:
private void output(File intermediate) throws IOException {
  if (fArguments.size() >= 3) {
    File output=new File(fArguments.get(2));
    intermediate.renameTo(output);
  }
  try (FileInputStream iStream=new FileInputStream(intermediate)){
    IOUtils.copy(iStream,System.out);
  }
  finally {
    intermediate.delete();
  }
}

Fixed version (ground truth):
private void output(File intermediate) throws IOException {
  if (fArguments.size() >= 3) {
    File output=new File(fArguments.get(2));
    intermediate.renameTo(output);
  }
 else {
    try (FileInputStream iStream=new FileInputStream(intermediate)){
      IOUtils.copy(iStream,System.out);
    }
  finally {
      intermediate.delete();
    }
  }
}
Program: 80825
Project: 80825
Buggy source:
@Override public void handleGET(CoapExchange exchange){
  Collection<Resource> resources=rdResource.getChildren();
  TreeSet<String> availableDomains=new TreeSet<String>();
  String domainQuery="String_Node_Str";
  Iterator<Resource> resIt=resources.iterator();
  String result="String_Node_Str";
  List<String> queries=exchange.getRequestOptions().getUriQuery();
  for (  String query : queries) {
    LinkAttribute attr=LinkAttribute.parse(query);
    if (attr.getName().equals(LinkFormat.DOMAIN))     domainQuery=attr.getValue();
  }
  while (resIt.hasNext()) {
    Resource res=resIt.next();
    if (res.getClass() == RDNodeResource.class) {
      RDNodeResource node=(RDNodeResource)res;
      if ((domainQuery.isEmpty() || domainQuery.equals(node.getDomain()))) {
        availableDomains.add(node.getDomain());
      }
    }
  }
  if (availableDomains.isEmpty()) {
    exchange.respond(ResponseCode.NOT_FOUND);
  }
 else {
    Iterator<String> domIt=availableDomains.iterator();
    while (domIt.hasNext()) {
      String dom=domIt.next();
      result+="String_Node_Str" + LinkFormat.DOMAIN + "String_Node_Str"+ dom+ "String_Node_Str";
    }
    exchange.respond(ResponseCode.CONTENT,result.substring(0,result.length() - 1),MediaTypeRegistry.APPLICATION_LINK_FORMAT);
  }
}

Fixed version (ground truth):
@Override public void handleGET(CoapExchange exchange){
  Collection<Resource> resources=rdResource.getChildren();
  TreeSet<String> availableDomains=new TreeSet<String>();
  String domainQuery=null;
  Iterator<Resource> resIt=resources.iterator();
  String result="String_Node_Str";
  List<String> query=exchange.getRequestOptions().getUriQuery();
  for (  String q : query) {
    KeyValuePair kvp=KeyValuePair.parse(q);
    if (LinkFormat.DOMAIN.equals(kvp.getName())) {
      domainQuery=kvp.getValue();
    }
  }
  while (resIt.hasNext()) {
    Resource res=resIt.next();
    if (res.getClass() == RDNodeResource.class) {
      RDNodeResource node=(RDNodeResource)res;
      if (domainQuery == null || domainQuery.equals(node.getDomain())) {
        availableDomains.add(node.getDomain());
      }
    }
  }
  if (availableDomains.isEmpty()) {
    exchange.respond(ResponseCode.NOT_FOUND);
  }
 else {
    Iterator<String> domIt=availableDomains.iterator();
    while (domIt.hasNext()) {
      String dom=domIt.next();
      result+="String_Node_Str" + LinkFormat.DOMAIN + "String_Node_Str"+ dom+ "String_Node_Str";
    }
    exchange.respond(ResponseCode.CONTENT,result.substring(0,result.length() - 1),MediaTypeRegistry.APPLICATION_LINK_FORMAT);
  }
}
Program: 80828
Project: 80828
Buggy source:
@Override public void delete(){
  LOGGER.info("String_Node_Str" + getContext());
  if (lifetimeTimer != null) {
    lifetimeTimer.cancel();
  }
  super.delete();
}

Fixed version (ground truth):
@Override public void delete(){
  LOGGER.info("String_Node_Str" + getContext());
  if (ltExpiryFuture != null) {
    ltExpiryFuture.cancel(false);
  }
  super.delete();
}
Program: 80829
Project: 80829
Buggy source:
public void setLifeTime(int newLifeTime){
  lifeTime=newLifeTime;
  if (lifetimeTimer != null) {
    lifetimeTimer.cancel();
  }
  lifetimeTimer=new Timer();
  lifetimeTimer.schedule(new ExpiryTask(this),lifeTime * 1000 + 2000);
}

Fixed version (ground truth):
public void setLifeTime(int newLifeTime){
  lifeTime=newLifeTime;
  if (ltExpiryFuture != null) {
    ltExpiryFuture.cancel(true);
  }
  ltExpiryFuture=scheduler.schedule(new Runnable(){
    @Override public void run(){
      delete();
    }
  }
,lifeTime + 2,TimeUnit.SECONDS);
}
Program: 80831
Project: 80831
Buggy source:
public RDNodeResource(String ep,String domain){
  super(ep);
  int epLength=ep.getBytes(CoAP.UTF8_CHARSET).length;
  if (epLength > 63)   LOGGER.warning("String_Node_Str" + ep + "String_Node_Str"+ epLength+ "String_Node_Str");
  this.endpointName=ep;
  this.domain=domain;
}

Fixed version (ground truth):
public RDNodeResource(String ep,String domain){
  super(ep);
  int epLength=ep.getBytes(CoAP.UTF8_CHARSET).length;
  if (epLength > 63) {
    LOGGER.log(Level.WARNING,"String_Node_Str",new Object[]{ep,epLength});
  }
  this.endpointName=ep;
  this.domain=domain;
}
Program: 80832
Project: 80832
Buggy source:
@Override public void handlePOST(CoapExchange exchange){
  if (lifetimeTimer != null) {
    lifetimeTimer.cancel();
  }
  LOGGER.info("String_Node_Str" + getContext());
  setParameters(exchange.advanced().getRequest());
  setLifeTime(this.lifeTime);
  exchange.respond(ResponseCode.CHANGED);
}

Fixed version (ground truth):
@Override public void handlePOST(CoapExchange exchange){
  if (ltExpiryFuture != null) {
    ltExpiryFuture.cancel(true);
  }
  LOGGER.info("String_Node_Str" + getContext());
  setParameters(exchange.advanced().getRequest());
  setLifeTime(this.lifeTime);
  exchange.respond(ResponseCode.CHANGED);
}
Program: 80834
Project: 80834
Buggy source:
public void run(){
  try {
    CordovaActivity ca=(CordovaActivity)cordova.getActivity();
    SystemWebView view=(SystemWebView)webView.getView();
    CertificatesCordovaWebViewClient cWebClient=new CertificatesCordovaWebViewClient((SystemWebViewEngine)webView.getEngine());
    cWebClient.setAllowUntrusted(allowUntrusted);
    webView.clearCache();
    view.setWebViewClient(cWebClient);
  }
 catch (  Exception e) {
    Log.e(LOG_TAG,"String_Node_Str",e);
  }
}

Fixed version (ground truth):
public void run(){
  try {
    CordovaActivity ca=(CordovaActivity)cordova.getActivity();
    SystemWebView view=(SystemWebView)webView.getView();
    CertificatesCordovaWebViewClient cWebClient=new CertificatesCordovaWebViewClient((SystemWebViewEngine)webView.getEngine());
    cWebClient.setAllowUntrusted(allowUntrusted);
    webView.clearCache();
    webView.stopLoading();
    view.setWebViewClient(cWebClient);
  }
 catch (  Exception e) {
    Log.e(LOG_TAG,"String_Node_Str",e);
  }
}
Program: 80836
Project: 80836
Buggy source:
/** 
 * Executes the request. This method is called from the WebView thread. To do a non-trivial amount of work, use: cordova.getThreadPool().execute(runnable); To run on the UI thread, use: cordova.getActivity().runOnUiThread(runnable);
 * @param action The action to execute. (Currently "setUntrusted only")
 * @param args The exec() arguments.
 * @param callbackContext The callback context used when calling back into JavaScript.
 * @return Whether the action was valid.
 */
@Override public boolean execute(String action,JSONArray args,CallbackContext callbackContext) throws JSONException {
  if (action.equals("String_Node_Str")) {
    boolean allowUntrusted=args.getBoolean(0);
    Log.d(LOG_TAG,"String_Node_Str" + allowUntrusted);
    CordovaActivity ca=(CordovaActivity)this.cordova.getActivity();
    CertificatesCordovaWebViewClient cWebClient=new CertificatesCordovaWebViewClient(this.cordova);
    cWebClient.setAllowUntrusted(allowUntrusted);
    webView.setWebViewClient(cWebClient);
    ca.clearCache();
    callbackContext.success();
    return true;
  }
  callbackContext.error("String_Node_Str");
  return false;
}

Fixed version (ground truth):
/** 
 * Executes the request. This method is called from the WebView thread. To do a non-trivial amount of work, use: cordova.getThreadPool().execute(runnable); To run on the UI thread, use: cordova.getActivity().runOnUiThread(runnable);
 * @param action The action to execute. (Currently "setUntrusted only")
 * @param args The exec() arguments.
 * @param callbackContext The callback context used when calling back into JavaScript.
 * @return Whether the action was valid.
 */
@Override public boolean execute(String action,JSONArray args,CallbackContext callbackContext) throws JSONException {
  if (action.equals("String_Node_Str")) {
    allowUntrusted=args.getBoolean(0);
    Log.d(LOG_TAG,"String_Node_Str" + allowUntrusted);
    cordova.getActivity().runOnUiThread(new Runnable(){
      public void run(){
        CertificatesCordovaWebViewClient cWebClient=new CertificatesCordovaWebViewClient(cordova);
        cWebClient.setAllowUntrusted(allowUntrusted);
        webView.setWebViewClient(cWebClient);
        CordovaActivity ca=(CordovaActivity)cordova.getActivity();
        ca.clearCache();
      }
    }
);
    callbackContext.success();
    return true;
  }
  callbackContext.error("String_Node_Str");
  return false;
}
Program: 80837
Project: 80837
Buggy source:
@Override public void onReceivedSslError(WebView view,SslErrorHandler handler,SslError error){
  Log.d("String_Node_Str" + isAllowUntrusted());
  if (isAllowUntrusted()) {
    handler.proceed();
  }
 else {
    handler.cancel();
  }
}

Fixed version (ground truth):
@Override public void onReceivedSslError(WebView view,SslErrorHandler handler,SslError error){
  Log.d(TAG,"String_Node_Str" + isAllowUntrusted());
  if (isAllowUntrusted()) {
    handler.proceed();
  }
 else {
    handler.cancel();
  }
}
Program: 80838
Project: 80838
Buggy source:
public List<OutPair> getProperties(String filePath) throws EditorConfigException {
  final Map<String,String> options=new LinkedHashMap<String,String>();
  try {
    boolean root=false;
    String dir=new File(filePath).getParent();
    while (dir != null && !root) {
      String configPath=dir + "String_Node_Str" + configFilename;
      if (new File(configPath).exists()) {
        FileReader reader=new FileReader(configPath);
        BufferedReader bufferedReader=new BufferedReader(reader);
        try {
          root=parseFile(bufferedReader,dir + "String_Node_Str",filePath,options);
        }
  finally {
          bufferedReader.close();
          reader.close();
        }
      }
      dir=new File(dir).getParent();
    }
  }
 catch (  IOException e) {
    throw new EditorConfigException(null,e);
  }
  preprocessOptions(options);
  final List<OutPair> result=new ArrayList<OutPair>();
  for (  Map.Entry<String,String> keyValue : options.entrySet()) {
    result.add(new OutPair(keyValue.getKey(),keyValue.getValue()));
  }
  return result;
}

Fixed version (ground truth):
public List<OutPair> getProperties(String filePath) throws EditorConfigException {
  final Map<String,String> options=new LinkedHashMap<String,String>();
  try {
    boolean root=false;
    String dir=new File(filePath).getParent();
    while (dir != null && !root) {
      String configPath=dir + "String_Node_Str" + configFilename;
      if (new File(configPath).exists()) {
        FileInputStream stream=new FileInputStream(configPath);
        InputStreamReader reader=new InputStreamReader(stream,"String_Node_Str");
        BufferedReader bufferedReader=new BufferedReader(reader);
        try {
          root=parseFile(bufferedReader,dir + "String_Node_Str",filePath,options);
        }
  finally {
          bufferedReader.close();
          reader.close();
          stream.close();
        }
      }
      dir=new File(dir).getParent();
    }
  }
 catch (  IOException e) {
    throw new EditorConfigException(null,e);
  }
  preprocessOptions(options);
  final List<OutPair> result=new ArrayList<OutPair>();
  for (  Map.Entry<String,String> keyValue : options.entrySet()) {
    result.add(new OutPair(keyValue.getKey(),keyValue.getValue()));
  }
  return result;
}
Program: 80840
Project: 80840
Buggy source:
@Synchronized public void onPlayerDisconnected(ConnectedPlayer player){
  if (!players.remove(player)) {
    return;
  }
  byName.remove(player.getName(),player);
  byUUID.remove(player.getUniqueID(),player);
  playerList=ImmutableList.copyOf((Iterable<? extends ConnectedPlayer>)players);
  BungeeTabListPlus.getInstance().runInMainThread(() -> {
    player.getPlayerTablistHandler().onDisconnect();
  }
);
  PacketHandler packetHandler=player.getPacketHandler();
  if (packetHandler instanceof TabListHandler) {
    ((TabListHandler)packetHandler).onDisconnected();
  }
}

Fixed version (ground truth):
@Synchronized public void onPlayerDisconnected(ConnectedPlayer player){
  if (!players.remove(player)) {
    return;
  }
  byName.remove(player.getName(),player);
  byUUID.remove(player.getUniqueID(),player);
  playerList=ImmutableList.copyOf((Iterable<? extends ConnectedPlayer>)players);
  BungeeTabListPlus.getInstance().runInMainThread(() -> {
    PlayerTablistHandler tablistHandler=player.getPlayerTablistHandler();
    if (tablistHandler != null) {
      tablistHandler.onDisconnect();
    }
  }
);
  PacketHandler packetHandler=player.getPacketHandler();
  if (packetHandler instanceof TabListHandler) {
    ((TabListHandler)packetHandler).onDisconnected();
  }
}
Program: 80841
Project: 80841
Buggy source:
@Synchronized public PlayerTablistHandler getPlayerTablistHandler(){
  if (playerTablistHandler == null) {
    createTabListHandler();
  }
  return playerTablistHandler;
}

Fixed version (ground truth):
@Nullable public PlayerTablistHandler getPlayerTablistHandler(){
  return playerTablistHandler;
}
Program: 80845
Project: 80845
Buggy source:
@Test public void testSelfGamemode3Size0(){
  assertEquals(0,clientTabList.getSize());
  tabListHandler.setResizePolicy(PlayerTablistHandler.ResizePolicy.DYNAMIC);
  tabListHandler.setPassThrough(false);
  assertEquals(0,clientTabList.getSize());
  PlayerListItem packet=new PlayerListItem();
  packet.setAction(PlayerListItem.Action.ADD_PLAYER);
  PlayerListItem.Item item=new PlayerListItem.Item();
  item.setUsername(usernames[47]);
  item.setUuid(clientUUID);
  item.setPing(47);
  item.setProperties(new String[0][]);
  item.setGamemode(3);
  packet.setItems(new PlayerListItem.Item[]{item});
  tabListHandler.onPlayerListPacket(packet);
  packet.setAction(PlayerListItem.Action.UPDATE_GAMEMODE);
  assertEquals(1,clientTabList.getSize());
  assertEquals(clientUUID,clientTabList.getVisibleEntries().get(0).getUuid());
}

Fixed version (ground truth):
@Test public void testSelfGamemode3Size0(){
  assertEquals(0,clientTabList.getSize());
  tabListHandler.setResizePolicy(PlayerTablistHandler.ResizePolicy.DYNAMIC);
  tabListHandler.setPassThrough(false);
  assertEquals(0,clientTabList.getSize());
  PlayerListItem packet=new PlayerListItem();
  packet.setAction(PlayerListItem.Action.ADD_PLAYER);
  PlayerListItem.Item item=new PlayerListItem.Item();
  item.setUsername(usernames[47]);
  item.setUuid(clientUUID);
  item.setPing(47);
  item.setProperties(new String[0][]);
  item.setGamemode(3);
  packet.setItems(new PlayerListItem.Item[]{item});
  tabListHandler.onPlayerListPacket(packet);
  assertEquals(1,clientTabList.getSize());
  assertEquals(clientUUID,clientTabList.getVisibleEntries().get(0).getUuid());
}
Program: 80846
Project: 80846
Buggy source:
public void setSize(int size){
  resize(size);
  clientSize=size;
}

Fixed version (ground truth):
public void setSize(int size){
  if (!passThrough) {
    resize(size);
  }
  clientSize=size;
}
Program: 80847
Project: 80847
Buggy source:
private void resize(int size){
  Preconditions.checkArgument(size >= 0 && size <= this.maxSize,"String_Node_Str");
  if (!passThrough) {
    if (size > usedSlots) {
      for (int i=usedSlots; i < size; i++) {
        createSlot(i);
      }
    }
 else     if (size < usedSlots) {
      for (int i=size; i < usedSlots; i++) {
        removeSlot(i);
      }
    }
    usedSlots=size;
  }
}

Fixed version (ground truth):
private void resize(int size){
  Preconditions.checkArgument(size >= 0 && size <= this.maxSize,"String_Node_Str");
  if (size > usedSlots) {
    for (int i=usedSlots; i < size; i++) {
      createSlot(i);
    }
  }
 else   if (size < usedSlots) {
    for (int i=size; i < usedSlots; i++) {
      removeSlot(i);
    }
  }
  usedSlots=size;
}
Program: 80848
Project: 80848
Buggy source:
@Override public void run(){
  if (activeComponent != -1) {
synchronized (context.get(Context.KEY_TAB_LIST)) {
      frames.get(activeComponent).deactivate();
      activeComponent++;
      if (activeComponent >= frames.size()) {
        activeComponent=0;
      }
      Component.Instance component=frames.get(activeComponent);
      component.activate();
      component.update1stStep();
      component.setPosition(leftMostColumn,row,column,size);
      component.update2ndStep();
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  if (activeComponent != -1) {
synchronized (context.get(Context.KEY_TAB_LIST)) {
      if (activeComponent != -1) {
        frames.get(activeComponent).deactivate();
        activeComponent++;
        if (activeComponent >= frames.size()) {
          activeComponent=0;
        }
        Component.Instance component=frames.get(activeComponent);
        component.activate();
        component.update1stStep();
        component.setPosition(leftMostColumn,row,column,size);
        component.update2ndStep();
      }
    }
  }
}
Program: 80849
Project: 80849
Buggy source:
@Override public void run(){
  if (activeComponent != -1) {
synchronized (context.get(Context.KEY_TAB_LIST)) {
      frames.get(activeComponent).deactivate();
      activeComponent++;
      if (activeComponent >= frames.size()) {
        activeComponent=0;
      }
      Component.Instance component=frames.get(activeComponent);
      component.activate();
      component.update1stStep();
      component.setPosition(row,column,size);
      component.update2ndStep();
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  if (activeComponent != -1) {
synchronized (context.get(Context.KEY_TAB_LIST)) {
      frames.get(activeComponent).deactivate();
      activeComponent++;
      if (activeComponent >= frames.size()) {
        activeComponent=0;
      }
      Component.Instance component=frames.get(activeComponent);
      component.activate();
      component.update1stStep();
      component.setPosition(leftMostColumn,row,column,size);
      component.update2ndStep();
    }
  }
}
Program: 80850
Project: 80850
Buggy source:
@Override public void update2ndStep(){
  super.update2ndStep();
synchronized (context.get(Context.KEY_TAB_LIST)) {
    if (activeComponent == -1) {
      activeComponent=0;
      Component.Instance component=frames.get(0);
      component.activate();
      component.update1stStep();
      component.setPosition(row,column,size);
      component.update2ndStep();
    }
 else {
      Component.Instance component=frames.get(activeComponent);
      component.update1stStep();
      component.setPosition(row,column,size);
      component.update2ndStep();
    }
  }
}

Fixed version (ground truth):
@Override public void update2ndStep(){
  super.update2ndStep();
synchronized (context.get(Context.KEY_TAB_LIST)) {
    if (activeComponent == -1) {
      activeComponent=0;
      Component.Instance component=frames.get(0);
      component.activate();
      component.update1stStep();
      component.setPosition(leftMostColumn,row,column,size);
      component.update2ndStep();
    }
 else {
      Component.Instance component=frames.get(activeComponent);
      component.update1stStep();
      component.setPosition(leftMostColumn,row,column,size);
      component.update2ndStep();
    }
  }
}
Program: 80851
Project: 80851
Buggy source:
public final void setPosition(int row,int column,int size){
  hasValidPosition=true;
  this.row=row;
  this.column=column;
  this.size=size;
}

Fixed version (ground truth):
public final void setPosition(int leftMostColumn,int row,int column,int size){
  hasValidPosition=true;
  this.leftMostColumn=leftMostColumn;
  this.row=row;
  this.column=column;
  this.size=size;
}
Program: 80852
Project: 80852
Buggy source:
protected void setSlot(int n,Icon icon,String text,int ping){
  if (active && hasValidPosition && n < size) {
    context.get(Context.KEY_TAB_LIST).setSlot(row + n / context.get(Context.KEY_COLUMNS),column + n % context.get(Context.KEY_COLUMNS),icon,text,ping);
  }
}

Fixed version (ground truth):
protected void setSlot(int row,int column,Icon icon,String text,int ping){
  if (active && hasValidPosition && row * context.get(Context.KEY_COLUMNS) + column < size) {
    context.get(Context.KEY_TAB_LIST).setSlot(this.row + row,this.column + column,icon,text,ping);
  }
}
Program: 80853
Project: 80853
Buggy source:
@Override public void update2ndStep(){
  super.update2ndStep();
  component.setPosition(row,column,size);
  component.update2ndStep();
}

Fixed version (ground truth):
@Override public void update2ndStep(){
  super.update2ndStep();
  component.setPosition(leftMostColumn,row,column,size);
  component.update2ndStep();
}
Program: 80856
Project: 80856
Buggy source:
@Override public void update2ndStep(){
  activeComponents.forEach(Component.Instance::deactivate);
  activeComponents.clear();
  super.update2ndStep();
  boolean allFit=super.size >= players.size() * playerComponent.getSize();
  int pos=0;
  int i;
  for (i=0; (allFit || pos + playerComponent.getSize() + morePlayersComponent.getSize() <= super.size) && i < players.size(); i++) {
    Player player=players.get(i);
    Component.Instance component=playerComponent.toInstance(context.derived().put(Context.KEY_PLAYER,player));
    component.activate();
    component.update1stStep();
    component.setPosition(row + (pos / context.get(Context.KEY_COLUMNS)),column + (pos % context.get(Context.KEY_COLUMNS)),playerComponent.getSize());
    component.update2ndStep();
    activeComponents.add(component);
    pos+=playerComponent.getSize();
  }
  if (!allFit) {
    Component.Instance component=morePlayersComponent.toInstance(context.derived().put(Context.KEY_OTHER_PLAYERS_COUNT,players.size() - i));
    component.activate();
    component.update1stStep();
    component.setPosition(row + (pos / context.get(Context.KEY_COLUMNS)),column + (pos % context.get(Context.KEY_COLUMNS)),morePlayersComponent.getSize());
    component.update2ndStep();
    activeComponents.add(component);
  }
}

Fixed version (ground truth):
@Override public void update2ndStep(){
  activeComponents.forEach(Component.Instance::deactivate);
  activeComponents.clear();
  super.update2ndStep();
  boolean allFit=super.size >= players.size() * playerComponent.getSize();
  int offset=column - leftMostColumn;
  int pos=offset;
  int i;
  for (i=0; (allFit || pos + playerComponent.getSize() + morePlayersComponent.getSize() - offset <= super.size) && i < players.size(); i++) {
    Player player=players.get(i);
    Component.Instance component=playerComponent.toInstance(context.derived().put(Context.KEY_PLAYER,player));
    component.activate();
    component.update1stStep();
    component.setPosition(leftMostColumn,row + (pos / context.get(Context.KEY_COLUMNS)),leftMostColumn + (pos % context.get(Context.KEY_COLUMNS)),playerComponent.getSize());
    component.update2ndStep();
    activeComponents.add(component);
    pos+=playerComponent.getSize();
  }
  if (!allFit) {
    Component.Instance component=morePlayersComponent.toInstance(context.derived().put(Context.KEY_OTHER_PLAYERS_COUNT,players.size() - i));
    component.activate();
    component.update1stStep();
    component.setPosition(leftMostColumn,row + (pos / context.get(Context.KEY_COLUMNS)),leftMostColumn + (pos % context.get(Context.KEY_COLUMNS)),morePlayersComponent.getSize());
    component.update2ndStep();
    activeComponents.add(component);
  }
}
Program: 80857
Project: 80857
Buggy source:
@Override public void update2ndStep(){
  super.update2ndStep();
  for (int i=0; i < columns.length; i++) {
    if (start[i] < context.get(Context.KEY_COLUMNS)) {
      Component.Instance component=columns[i];
      component.setPosition(row,column + start[i],size / context.get(Context.KEY_COLUMNS) * width[i]);
      component.update2ndStep();
    }
  }
}

Fixed version (ground truth):
@Override public void update2ndStep(){
  super.update2ndStep();
  for (int i=0; i < columns.length; i++) {
    if (start[i] < context.get(Context.KEY_COLUMNS)) {
      Component.Instance component=columns[i];
      component.setPosition(column + start[i],row,column + start[i],size / context.get(Context.KEY_COLUMNS) * width[i]);
      component.update2ndStep();
    }
  }
}
Program: 80858
Project: 80858
Buggy source:
@Override public synchronized void update(){
  super.update();
  List<Player> players=context.get(Context.KEY_PLAYER_SETS).get(config.getPlayerSet());
  config.getPlayerOrder().sort(context,players);
  activeComponents.forEach(Component.Instance::deactivate);
  activeComponents.clear();
  int size=min(80,players.size() * config.getPlayerComponent().getSize());
  setSize(1,size);
  int pos=0;
  int i;
  for (i=0; pos < size; i++) {
    Player player=players.get(i);
    Component.Instance component=config.getPlayerComponent().toInstance(context.derived().put(Context.KEY_PLAYER,player));
    component.activate();
    component.update1stStep();
    component.setPosition(pos,0,config.getPlayerComponent().getSize());
    component.update2ndStep();
    activeComponents.add(component);
    pos+=config.getPlayerComponent().getSize();
  }
}

Fixed version (ground truth):
@Override public synchronized void update(){
  super.update();
  List<Player> players=context.get(Context.KEY_PLAYER_SETS).get(config.getPlayerSet());
  config.getPlayerOrder().sort(context,players);
  activeComponents.forEach(Component.Instance::deactivate);
  activeComponents.clear();
  int size=min(80,players.size() * config.getPlayerComponent().getSize());
  setSize(1,size);
  int pos=0;
  int i;
  for (i=0; pos < size; i++) {
    Player player=players.get(i);
    Component.Instance component=config.getPlayerComponent().toInstance(context.derived().put(Context.KEY_PLAYER,player));
    component.activate();
    component.update1stStep();
    component.setPosition(0,pos,0,config.getPlayerComponent().getSize());
    component.update2ndStep();
    activeComponents.add(component);
    pos+=config.getPlayerComponent().getSize();
  }
}
Program: 80859
Project: 80859
Buggy source:
@Override public synchronized void update(){
  super.update();
  Arrays.fill(marks,false);
  content.setPosition(0,0,getSize());
  content.update1stStep();
  content.update2ndStep();
  for (int i=0; i < marks.length; i++) {
    boolean mark=marks[i];
    if (!mark) {
      setSlot(i / getColumns(),i % getColumns(),config.getDefaultIcon().evaluate(context),"String_Node_Str",config.getDefaultPing());
    }
  }
}

Fixed version (ground truth):
@Override public synchronized void update(){
  super.update();
  Arrays.fill(marks,false);
  content.setPosition(0,0,0,getSize());
  content.update1stStep();
  content.update2ndStep();
  for (int i=0; i < marks.length; i++) {
    boolean mark=marks[i];
    if (!mark) {
      setSlot(i / getColumns(),i % getColumns(),config.getDefaultIcon().evaluate(context),"String_Node_Str",config.getDefaultPing());
    }
  }
}
Program: 80860
Project: 80860
Buggy source:
@Override public int getMaxSize(){
  return min(maxSize,players.size() * playerComponent.getSize());
}

Fixed version (ground truth):
@Override public int getMaxSize(){
  return max(minSize,min(maxSize,players.size() * playerComponent.getSize()));
}
Program: 80861
Project: 80861
Buggy source:
@Override public void update2ndStep(){
  activeComponents.forEach(Component.Instance::deactivate);
  activeComponents.clear();
  super.update2ndStep();
  boolean allFit=super.size >= getMaxSize();
  int pos=0;
  int i;
  for (i=0; (allFit || pos + morePlayersComponent.getSize() < super.size) && i < players.size(); i++) {
    Player player=players.get(i);
    Component.Instance component=playerComponent.toInstance(context.derived().setPlayer(player));
    component.activate();
    component.update1stStep();
    component.setPosition(row + (pos / context.getColumns()),column + (pos % context.getColumns()),playerComponent.getSize());
    component.update2ndStep();
    activeComponents.add(component);
    pos+=playerComponent.getSize();
  }
  if (!allFit) {
    Component.Instance component=morePlayersComponent.toInstance(context.derived().setOtherPlayersCount(players.size() - i));
    component.activate();
    component.update1stStep();
    component.setPosition(row + (pos / context.getColumns()),column + (pos % context.getColumns()),morePlayersComponent.getSize());
    component.update2ndStep();
    activeComponents.add(component);
  }
}

Fixed version (ground truth):
@Override public void update2ndStep(){
  activeComponents.forEach(Component.Instance::deactivate);
  activeComponents.clear();
  super.update2ndStep();
  boolean allFit=super.size >= players.size() * playerComponent.getSize();
  int pos=0;
  int i;
  for (i=0; (allFit || pos + playerComponent.getSize() + morePlayersComponent.getSize() <= super.size) && i < players.size(); i++) {
    Player player=players.get(i);
    Component.Instance component=playerComponent.toInstance(context.derived().setPlayer(player));
    component.activate();
    component.update1stStep();
    component.setPosition(row + (pos / context.getColumns()),column + (pos % context.getColumns()),playerComponent.getSize());
    component.update2ndStep();
    activeComponents.add(component);
    pos+=playerComponent.getSize();
  }
  if (!allFit) {
    Component.Instance component=morePlayersComponent.toInstance(context.derived().setOtherPlayersCount(players.size() - i));
    component.activate();
    component.update1stStep();
    component.setPosition(row + (pos / context.getColumns()),column + (pos % context.getColumns()),morePlayersComponent.getSize());
    component.update2ndStep();
    activeComponents.add(component);
  }
}
Program: 80862
Project: 80862
Buggy source:
@Override public void update1stStep(){
  super.update1stStep();
  minSize=0;
  maxSize=Integer.MAX_VALUE;
  for (  Component.Instance component : columns) {
    component.update1stStep();
    minSize=max(minSize,component.getMinSize() / component.context.getColumns() * context.getColumns());
    maxSize=min(minSize,component.getMaxSize() / component.context.getColumns() * context.getColumns());
  }
}

Fixed version (ground truth):
@Override public void update1stStep(){
  super.update1stStep();
  minSize=0;
  maxSize=Integer.MAX_VALUE;
  for (  Component.Instance component : columns) {
    component.update1stStep();
    minSize=max(minSize,(component.getMinSize() + component.context.getColumns() - 1) / component.context.getColumns() * context.getColumns());
    maxSize=max(maxSize,(component.getMaxSize() + component.context.getColumns() - 1) / component.context.getColumns() * context.getColumns());
  }
}
Program: 80863
Project: 80863
Buggy source:
private void removePlayerFromTeam(int slot,UUID uuid,String player){
  if (uuid.version() == 2)   return;
  if (nameToSlotMap.remove(player,slot)) {
    sendPacket(removePlayer(slot,player));
  }
  if (playerToTeamMap.containsKey(player)) {
    Team team=new Team();
    team.setName(playerToTeamMap.get(player));
    team.setMode((byte)3);
    team.setPlayers(new String[]{player});
    sendPacket(team);
    team=new Team();
    team.setMode((byte)2);
    team.setName(fakePlayerUsernames[slot]);
    team.setDisplayName(fakePlayerUsernames[slot]);
    team.setPrefix("String_Node_Str");
    team.setSuffix("String_Node_Str");
    team.setFriendlyFire((byte)1);
    team.setNameTagVisibility("String_Node_Str");
    if (teamCollisionRuleSupported) {
      team.setCollisionRule("String_Node_Str");
    }
    team.setColor((byte)0);
    sendPacket(team);
  }
}

Fixed version (ground truth):
private void removePlayerFromTeam(int slot,UUID uuid,String player){
  if (uuid.version() == 2)   return;
  if (nameToSlotMap.getInt(player) == slot) {
    nameToSlotMap.remove(player);
    sendPacket(removePlayer(slot,player));
    if (playerToTeamMap.containsKey(player)) {
      Team team=new Team();
      team.setName(playerToTeamMap.get(player));
      team.setMode((byte)3);
      team.setPlayers(new String[]{player});
      sendPacket(team);
      team=new Team();
      team.setMode((byte)2);
      team.setName(fakePlayerUsernames[slot]);
      team.setDisplayName(fakePlayerUsernames[slot]);
      team.setPrefix("String_Node_Str");
      team.setSuffix("String_Node_Str");
      team.setFriendlyFire((byte)1);
      team.setNameTagVisibility("String_Node_Str");
      if (teamCollisionRuleSupported) {
        team.setCollisionRule("String_Node_Str");
      }
      team.setColor((byte)0);
      sendPacket(team);
    }
  }
}
Program: 80866
Project: 80866
Buggy source:
/** 
 * The property associated with the skin. See http://wiki.vg/Mojang_API#UUID_-.3E_Profile_.2B_Skin.2FCape This is only the "textures" property. <p> If this returns null   {@link Skin#getOwner()} must also return null. In that case this is arandom Alex/ Steve skin.
 * @return the properties associated with this skincan be null
 */
String[] toProperty();

Fixed version (ground truth):
/** 
 * The property associated with the skin. See http://wiki.vg/Mojang_API#UUID_-.3E_Profile_.2B_Skin.2FCape <p> If this returns null   {@link Skin#getOwner()} must also return null. In that case this is arandom Alex/ Steve skin.
 * @return the properties associated with this skin
 */
String[][] toProperty();
Program: 80867
Project: 80867
Buggy source:
@Override public void onEnable(){
  if (Float.parseFloat(System.getProperty("String_Node_Str")) < 52.0) {
    getLogger().severe("String_Node_Str");
    getLogger().severe("String_Node_Str");
    return;
  }
  if (!getProxy().getPlayers().isEmpty() && getProxy().getPluginManager().getPlugin("String_Node_Str") != null) {
    getLogger().severe("String_Node_Str");
    getLogger().severe("String_Node_Str");
    throw new RuntimeException("String_Node_Str");
  }
  BungeeTabListPlus.getInstance(this).onEnable();
}

Fixed version (ground truth):
@Override public void onEnable(){
  if (Float.parseFloat(System.getProperty("String_Node_Str")) < 52.0) {
    getLogger().severe("String_Node_Str");
    getLogger().severe("String_Node_Str");
    return;
  }
  if (!getProxy().getPlayers().isEmpty()) {
    for (    ProxiedPlayer proxiedPlayer : getProxy().getPlayers()) {
      proxiedPlayer.disconnect("String_Node_Str");
    }
  }
  BungeeTabListPlus.getInstance(this).onEnable();
  if (!getProxy().getPlayers().isEmpty()) {
    for (    ProxiedPlayer proxiedPlayer : getProxy().getPlayers()) {
      proxiedPlayer.disconnect("String_Node_Str");
    }
  }
}
Program: 80868
Project: 80868
Buggy source:
@Override public void onDisable(){
  if (BungeeCord.getInstance().isRunning && getProxy().getPluginManager().getPlugin("String_Node_Str") != null) {
    getLogger().severe("String_Node_Str");
    for (    ProxiedPlayer proxiedPlayer : getProxy().getPlayers()) {
      try {
        final TabList tablistHandler=ReflectionUtil.getTablistHandler(proxiedPlayer);
        if (tablistHandler instanceof PlayerTablistHandler) {
          ChannelWrapper channelWrapper=ReflectionUtil.getChannelWrapper(proxiedPlayer);
          channelWrapper.getHandle().eventLoop().submit(new Runnable(){
            @Override public void run(){
              ((PlayerTablistHandler)tablistHandler).exclude();
            }
          }
).await();
        }
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
    }
    throw new RuntimeException("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void onDisable(){
  if (BungeeCord.getInstance().isRunning) {
    getLogger().severe("String_Node_Str");
    if (!getProxy().getPlayers().isEmpty()) {
      for (      ProxiedPlayer proxiedPlayer : getProxy().getPlayers()) {
        proxiedPlayer.disconnect("String_Node_Str");
      }
    }
  }
}
Program: 80871
Project: 80871
Buggy source:
private boolean reloadTablists(){
  failIfNotMainThread();
  TabListManager tabListManager=new TabListManager(this);
  if (!tabListManager.loadTabLists()) {
    return true;
  }
  tabLists=tabListManager;
  return false;
}

Fixed version (ground truth):
private boolean reloadTablists(){
  failIfNotMainThread();
  TabListManager tabListManager=new TabListManager(this);
  if (!tabListManager.loadTabLists()) {
    return true;
  }
  tabListManager.customTabLists=tabLists.customTabLists;
  tabLists=tabListManager;
  return false;
}
Program: 80872
Project: 80872
Buggy source:
/** 
 * Reloads most settings of the plugin
 */
public boolean reload(){
  if (!resendThread.isInMainThread()) {
    AtomicReference<Boolean> ref=new AtomicReference<>(null);
    resendThread.execute(() -> {
      ref.set(reload());
    }
);
    while (ref.get() == null) {
      try {
        Thread.sleep(10);
      }
 catch (      InterruptedException ignored) {
        return false;
      }
    }
    return ref.get();
  }
  failIfNotMainThread();
  try {
    requestedUpdateInterval=null;
    config=new ConfigManager(plugin);
    placeholderManager.reload();
    if (reloadTablists())     return false;
    fakePlayerManager.reload();
    resendTabLists();
    restartRefreshThread();
    placeholderAPIHook.onLoad();
    skins.onReload();
  }
 catch (  IOException ex) {
    plugin.getLogger().log(Level.WARNING,"String_Node_Str",ex);
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Reloads most settings of the plugin
 */
public boolean reload(){
  if (!resendThread.isInMainThread()) {
    AtomicReference<Boolean> ref=new AtomicReference<>(null);
    resendThread.execute(() -> {
      ref.set(reload());
    }
);
    while (ref.get() == null) {
      try {
        Thread.sleep(10);
      }
 catch (      InterruptedException ignored) {
        return false;
      }
    }
    return ref.get();
  }
  failIfNotMainThread();
  try {
    config=new ConfigManager(plugin);
    placeholderManager.reload();
    if (reloadTablists())     return false;
    fakePlayerManager.reload();
    resendTabLists();
    restartRefreshThread();
    placeholderAPIHook.onLoad();
    skins.onReload();
  }
 catch (  IOException ex) {
    plugin.getLogger().log(Level.WARNING,"String_Node_Str",ex);
  }
  return true;
}
Program: 80873
Project: 80873
Buggy source:
@Override public void onDisconnect(){
  failIfNotInEventLoop();
  if (connectedPlayer != null) {
    BungeeTabListPlus.getInstance().getConnectedPlayerManager().onPlayerDisconnected(connectedPlayer);
    Server server=getPlayer().getServer();
    if (server != null) {
      server.disconnect("String_Node_Str");
    }
    ((UserConnection)getPlayer()).setServer(null);
  }
}

Fixed version (ground truth):
@Override public void onDisconnect(){
  failIfNotInEventLoop();
  if (connectedPlayer != null) {
    BungeeTabListPlus.getInstance().getConnectedPlayerManager().onPlayerDisconnected(connectedPlayer);
    if (getPlayer() != ProxyServer.getInstance().getPlayer(getPlayer().getName())) {
      Server server=getPlayer().getServer();
      if (server != null) {
        server.disconnect("String_Node_Str");
      }
      ((UserConnection)getPlayer()).setServer(null);
    }
  }
}
Program: 80875
Project: 80875
Buggy source:
private void checkForThirdPartyVariables(){
  for (  ServerInfo serverInfo : plugin.getProxy().getServers().values()) {
    get(serverInfo,BTLPDataKeys.REGISTERED_THIRD_PARTY_VARIABLES).ifPresent(variables -> {
      thirdPartyVariablesLock.lock();
      try {
        for (        String variable : variables) {
          if (!registeredThirdPartyVariables.contains(variable)) {
            plugin.registerPlaceholderProvider0(new PlaceholderProvider(){
              @Override public void setup(){
                bind(variable).to(context -> ((Player)context.getPlayer()).get(BTLPDataKeys.createThirdPartyVariableDataKey(variable)).orElse("String_Node_Str"));
              }
            }
);
            registeredThirdPartyVariables.add(variable);
          }
        }
      }
  finally {
        thirdPartyVariablesLock.unlock();
      }
    }
);
  }
}

Fixed version (ground truth):
private void checkForThirdPartyVariables(){
  try {
    for (    ServerInfo serverInfo : plugin.getProxy().getServers().values()) {
      get(serverInfo,BTLPDataKeys.REGISTERED_THIRD_PARTY_VARIABLES).ifPresent(variables -> {
        thirdPartyVariablesLock.lock();
        try {
          for (          String variable : variables) {
            if (!registeredThirdPartyVariables.contains(variable)) {
              plugin.registerPlaceholderProvider0(new PlaceholderProvider(){
                @Override public void setup(){
                  bind(variable).to(context -> ((Player)context.getPlayer()).get(BTLPDataKeys.createThirdPartyVariableDataKey(variable)).orElse("String_Node_Str"));
                }
              }
);
              registeredThirdPartyVariables.add(variable);
            }
          }
        }
 catch (        Throwable th) {
          plugin.getLogger().log(Level.SEVERE,"String_Node_Str",th);
        }
 finally {
          thirdPartyVariablesLock.unlock();
        }
      }
);
    }
  }
 catch (  ConcurrentModificationException ignored) {
  }
}