Program: 76736
Project: 76736
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_send_file);
  rvSendingFilesList=findViewById(R.id.rvSendingFilesList);
  LinearLayoutManager filesListLayoutManager=new LinearLayoutManager(this,LinearLayoutManager.VERTICAL,false);
  rvSendingFilesList.setLayoutManager(filesListLayoutManager);
  sendFilesAdapter=new FilesSendAdapter();
  rvSendingFilesList.setAdapter(sendFilesAdapter);
  rvReceivingFilesList=findViewById(R.id.rvReceivingFilesList);
  LinearLayoutManager receiveFilesListLayoutManager=new LinearLayoutManager(this,LinearLayoutManager.VERTICAL,false);
  rvReceivingFilesList.setLayoutManager(receiveFilesListLayoutManager);
  FilesAdapter receiveFilesAdapter=new FilesAdapter(SendFileActivity.this);
  rvReceivingFilesList.setAdapter(receiveFilesAdapter);
  this.initNav();
  this.initSockets();
  callbackReInitServers=() -> SendFileActivity.this.initServers(receiveFilesAdapter);
  peerListListener=peers -> {
    peerList.clear();
    peerList.addAll(peers.getDeviceList());
    peersAdapter.updateList(peerList);
    peersAdapter.notifyDataSetChanged();
  }
;
  callbackSendThisDeviceName=() -> {
    TransferNameDevice transferNameDevice=new TransferNameDevice(serverAddress);
    transferNameDevice.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
  }
;
  infoListener=info -> {
    serverAddress=info.groupOwnerAddress;
    if (serverAddress == null)     return;
    SendFileActivity.this.callbackSendThisDeviceName.call();
    ChooseFile.fileChooser(SendFileActivity.this);
  }
;
  p2pManager=(WifiP2pManager)getSystemService(WIFI_P2P_SERVICE);
  channel=p2pManager.initialize(this,getMainLooper(),null);
  peersAdapter=new PeersAdapter(peerList,this,p2pManager,channel,this,infoListener);
  this.initServers(receiveFilesAdapter);
  try {
    Class<?> wifiManager=Class.forName("String_Node_Str");
    Method method=wifiManager.getMethod("String_Node_Str",WifiP2pManager.Channel.class);
    method.invoke(p2pManager,channel);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  p2pManager.removeGroup(channel,null);
  myBroadcastReciever=new MyBroadcastReciever(p2pManager,channel,this,infoListener);
  myBroadcastReciever.setPeerListListener(peerListListener);
  intentFilter=new IntentFilter();
  intentFilter.addAction(WifiP2pManager.WIFI_P2P_THIS_DEVICE_CHANGED_ACTION);
  intentFilter.addAction(WifiP2pManager.WIFI_P2P_PEERS_CHANGED_ACTION);
  intentFilter.addAction(WifiP2pManager.WIFI_P2P_STATE_CHANGED_ACTION);
  intentFilter.addAction(WifiP2pManager.WIFI_P2P_CONNECTION_CHANGED_ACTION);
  registerReceiver(myBroadcastReciever,intentFilter);
  rvDevicesList=findViewById(R.id.rvDevicesList);
  rvDevicesList.setAdapter(peersAdapter);
  RecyclerView.LayoutManager mLayoutManager=new LinearLayoutManager(this,LinearLayoutManager.VERTICAL,false);
  rvDevicesList.setLayoutManager(mLayoutManager);
  p2pManager.discoverPeers(channel,null);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_send_file);
  rvSendingFilesList=findViewById(R.id.rvSendingFilesList);
  LinearLayoutManager filesListLayoutManager=new LinearLayoutManager(this,LinearLayoutManager.VERTICAL,false);
  rvSendingFilesList.setLayoutManager(filesListLayoutManager);
  sendFilesAdapter=new FilesSendAdapter();
  rvSendingFilesList.setAdapter(sendFilesAdapter);
  rvReceivingFilesList=findViewById(R.id.rvReceivingFilesList);
  LinearLayoutManager receiveFilesListLayoutManager=new LinearLayoutManager(this,LinearLayoutManager.VERTICAL,false);
  rvReceivingFilesList.setLayoutManager(receiveFilesListLayoutManager);
  FilesAdapter receiveFilesAdapter=new FilesAdapter(SendFileActivity.this);
  rvReceivingFilesList.setAdapter(receiveFilesAdapter);
  this.initNav();
  this.initSockets();
  callbackReInitFileServer=() -> SendFileActivity.this.initFileServer(receiveFilesAdapter);
  callbackReInitDeviceServer=SendFileActivity.this::initDeviceInfoServers;
  peerListListener=peers -> {
    peerList.clear();
    peerList.addAll(peers.getDeviceList());
    peersAdapter.updateList(peerList);
    peersAdapter.notifyDataSetChanged();
  }
;
  callbackSendThisDeviceName=() -> {
    TransferNameDevice transferNameDevice=new TransferNameDevice(serverAddress);
    transferNameDevice.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
  }
;
  infoListener=info -> {
    serverAddress=info.groupOwnerAddress;
    if (serverAddress == null)     return;
    SendFileActivity.this.callbackSendThisDeviceName.call();
    ChooseFile.fileChooser(SendFileActivity.this);
  }
;
  p2pManager=(WifiP2pManager)getSystemService(WIFI_P2P_SERVICE);
  channel=p2pManager.initialize(this,getMainLooper(),null);
  peersAdapter=new PeersAdapter(peerList,this,p2pManager,channel,this,infoListener);
  this.initFileServer(receiveFilesAdapter);
  this.initDeviceInfoServers();
  try {
    Class<?> wifiManager=Class.forName("String_Node_Str");
    Method method=wifiManager.getMethod("String_Node_Str",WifiP2pManager.Channel.class);
    method.invoke(p2pManager,channel);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  p2pManager.removeGroup(channel,null);
  myBroadcastReciever=new MyBroadcastReciever(p2pManager,channel,this,infoListener);
  myBroadcastReciever.setPeerListListener(peerListListener);
  intentFilter=new IntentFilter();
  intentFilter.addAction(WifiP2pManager.WIFI_P2P_THIS_DEVICE_CHANGED_ACTION);
  intentFilter.addAction(WifiP2pManager.WIFI_P2P_PEERS_CHANGED_ACTION);
  intentFilter.addAction(WifiP2pManager.WIFI_P2P_STATE_CHANGED_ACTION);
  intentFilter.addAction(WifiP2pManager.WIFI_P2P_CONNECTION_CHANGED_ACTION);
  registerReceiver(myBroadcastReciever,intentFilter);
  rvDevicesList=findViewById(R.id.rvDevicesList);
  rvDevicesList.setAdapter(peersAdapter);
  RecyclerView.LayoutManager mLayoutManager=new LinearLayoutManager(this,LinearLayoutManager.VERTICAL,false);
  rvDevicesList.setLayoutManager(mLayoutManager);
  p2pManager.discoverPeers(channel,null);
}