Program: 76746
Project: 76746
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);
  FilesAdapter filesAdapter=new FilesAdapter(SendFileActivity.this);
  rvSendingFilesList.setAdapter(filesAdapter);
  Log.d("String_Node_Str","String_Node_Str" + (serverSocket == null));
  rvReceivingFilesList=findViewById(R.id.rvReceivingFilesList);
  initNav();
  try {
    serverSocket=new ServerSocket(8888);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  Log.d("String_Node_Str","String_Node_Str");
  fileServerAsyncTask=new FileServerAsyncTask((SendFileActivity.this),(serverSocket),(filesAdapter));
  fileServerAsyncTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
  Log.d("String_Node_Str","String_Node_Str");
  peerListListener=peers -> {
    peerList.clear();
    peerList.addAll(peers.getDeviceList());
    peersAdapter.updateList(peerList);
    peersAdapter.notifyDataSetChanged();
  }
;
  infoListener=info -> {
    serverAddress=info.groupOwnerAddress;
    if (serverAddress == null)     return;
    Toast.makeText(getApplicationContext(),"String_Node_Str" + String.valueOf(info.isGroupOwner),Toast.LENGTH_LONG).show();
    Toast.makeText(SendFileActivity.this,"String_Node_Str" + serverAddress.toString(),Toast.LENGTH_LONG).show();
    Log.d("String_Node_Str",info.toString());
    Toast.makeText(getApplicationContext(),"String_Node_Str" + info.groupFormed,Toast.LENGTH_LONG).show();
    ChooseFile.fileChooser(SendFileActivity.this);
  }
;
  p2pManager=(WifiP2pManager)getSystemService(WIFI_P2P_SERVICE);
  channel=p2pManager.initialize(this,getMainLooper(),null);
  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,new WifiP2pManager.ActionListener(){
    @Override public void onSuccess(){
      Toast.makeText(getApplicationContext(),"String_Node_Str",Toast.LENGTH_SHORT).show();
    }
    @Override public void onFailure(    int reason){
      Toast.makeText(getApplicationContext(),"String_Node_Str",Toast.LENGTH_SHORT).show();
      Log.d("String_Node_Str",reason + "String_Node_Str");
    }
  }
);
  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);
  peersAdapter=new PeersAdapter(peerList,this,p2pManager,channel,this,infoListener);
  rvDevicesList=findViewById(R.id.rvDevicesList);
  rvDevicesList.setAdapter(peersAdapter);
  RecyclerView.LayoutManager mLayoutManager=new LinearLayoutManager(this,LinearLayoutManager.VERTICAL,false);
  rvDevicesList.setLayoutManager(mLayoutManager);
  p2pManager.discoverPeers(channel,new WifiP2pManager.ActionListener(){
    @Override public void onSuccess(){
      Toast.makeText(getApplicationContext(),"String_Node_Str",Toast.LENGTH_SHORT).show();
    }
    @Override public void onFailure(    int reason){
      Toast.makeText(getApplicationContext(),"String_Node_Str",Toast.LENGTH_SHORT).show();
    }
  }
);
}

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);
  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);
  initNav();
  try {
    serverSocket=new ServerSocket(8888);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  fileServerAsyncTask=new FileServerAsyncTask((SendFileActivity.this),(serverSocket),(receiveFilesAdapter));
  fileServerAsyncTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
  peerListListener=peers -> {
    peerList.clear();
    peerList.addAll(peers.getDeviceList());
    peersAdapter.updateList(peerList);
    peersAdapter.notifyDataSetChanged();
  }
;
  infoListener=info -> {
    serverAddress=info.groupOwnerAddress;
    if (serverAddress == null)     return;
    Toast.makeText(getApplicationContext(),"String_Node_Str" + String.valueOf(info.isGroupOwner),Toast.LENGTH_LONG).show();
    Toast.makeText(SendFileActivity.this,"String_Node_Str" + serverAddress.toString(),Toast.LENGTH_LONG).show();
    Log.d("String_Node_Str",info.toString());
    Toast.makeText(getApplicationContext(),"String_Node_Str" + info.groupFormed,Toast.LENGTH_LONG).show();
    ChooseFile.fileChooser(SendFileActivity.this);
  }
;
  p2pManager=(WifiP2pManager)getSystemService(WIFI_P2P_SERVICE);
  channel=p2pManager.initialize(this,getMainLooper(),null);
  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);
  peersAdapter=new PeersAdapter(peerList,this,p2pManager,channel,this,infoListener);
  rvDevicesList=findViewById(R.id.rvDevicesList);
  rvDevicesList.setAdapter(peersAdapter);
  RecyclerView.LayoutManager mLayoutManager=new LinearLayoutManager(this,LinearLayoutManager.VERTICAL,false);
  rvDevicesList.setLayoutManager(mLayoutManager);
  p2pManager.discoverPeers(channel,null);
}