Program: 46669
Project: 46669
Buggy source:
@Override public void onActivityResult(int requestCode,int resultCode,Intent intent){
  int erAP=0;
  SharedPreferences ConnectActionPrefs;
  WifiConfiguration wc;
  if ((requestCode == 0) && ((resultCode == RESULT_OK))) {
    qrcontents=new String(intent.getStringExtra("String_Node_Str"));
    qrformat=new String(intent.getStringExtra("String_Node_Str"));
    Log.i("String_Node_Str","String_Node_Str" + qrcontents + "String_Node_Str"+ qrformat);
    final WifiManager wm=(WifiManager)getSystemService(Context.WIFI_SERVICE);
    wc=new WifiConfiguration();
    List<ScanResult> sl=wm.getScanResults();
    Iterator isl=sl.iterator();
    ScanResult sr=null;
    while (isl.hasNext()) {
      sr=(ScanResult)isl.next();
      if (sr.SSID == "String_Node_Str") {
        erAP=1;
        break;
      }
    }
    if (erAP == 1) {
      wc.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.IEEE8021X);
      wc.BSSID=new String(sr.BSSID);
    }
 else {
      if (qrcontents.contains("String_Node_Str")) {
        wc=ParseForZXingEncoding(qrcontents);
        Log.i("String_Node_Str","String_Node_Str" + wc.SSID);
      }
      if (qrcontents.endsWith("String_Node_Str")) {
        wc=ParseForNyalaEncoding(qrcontents);
        Log.i("String_Node_Str","String_Node_Str" + wc.SSID);
      }
 else {
        AlertDialog.Builder ad=new AlertDialog.Builder(this);
        ad.setMessage("String_Node_Str").setCancelable(false).setPositiveButton("String_Node_Str",new DialogInterface.OnClickListener(){
          public void onClick(          DialogInterface dialog,          int id){
            dialog.cancel();
            finish();
          }
        }
);
      }
      String ssid_str=wc.SSID;
      String bssid_str=wc.BSSID;
      String psk_str=wc.preSharedKey;
      Log.i("String_Node_Str","String_Node_Str" + ssid_str + "String_Node_Str"+ bssid_str+ "String_Node_Str"+ psk_str);
      Toast.makeText(Nyala.this,"String_Node_Str",Toast.LENGTH_SHORT).show();
      if (ssid_str.equals("String_Node_Str")) {
        AlertDialog.Builder ad=new AlertDialog.Builder(this);
        ad.setMessage("String_Node_Str").setCancelable(false).setPositiveButton("String_Node_Str",new DialogInterface.OnClickListener(){
          public void onClick(          DialogInterface dialog,          int id){
            dialog.cancel();
          }
        }
);
      }
 else {
        ConnectFromScan(wc,wm);
      }
    }
  }
 else   if (resultCode == RESULT_CANCELED) {
    AlertDialog.Builder ad=new AlertDialog.Builder(this);
    ad.setMessage("String_Node_Str").setCancelable(false).setPositiveButton("String_Node_Str",new DialogInterface.OnClickListener(){
      public void onClick(      DialogInterface dialog,      int id){
        Toast.makeText(Nyala.this,"String_Node_Str",Toast.LENGTH_SHORT).show();
      }
    }
);
    AlertDialog AD=ad.create();
    AD.show();
  }
}

Fixed version (ground truth):
@Override public void onActivityResult(int requestCode,int resultCode,Intent intent){
  int erAP=0;
  SharedPreferences ConnectActionPrefs;
  WifiConfiguration wc;
  if ((requestCode == 0) && ((resultCode == RESULT_OK))) {
    qrcontents=new String(intent.getStringExtra("String_Node_Str"));
    qrformat=new String(intent.getStringExtra("String_Node_Str"));
    Log.i("String_Node_Str","String_Node_Str" + qrcontents + "String_Node_Str"+ qrformat);
    final WifiManager wm=(WifiManager)getSystemService(Context.WIFI_SERVICE);
    wc=new WifiConfiguration();
    if (qrcontents.contains("String_Node_Str")) {
      wc=ParseForZXingEncoding(qrcontents);
      Log.i("String_Node_Str","String_Node_Str" + wc.SSID);
    }
    if (qrcontents.endsWith("String_Node_Str")) {
      wc=ParseForNyalaEncoding(qrcontents);
      Log.i("String_Node_Str","String_Node_Str" + wc.SSID);
    }
 else {
      AlertDialog.Builder ad=new AlertDialog.Builder(this);
      ad.setMessage("String_Node_Str").setCancelable(false).setPositiveButton("String_Node_Str",new DialogInterface.OnClickListener(){
        public void onClick(        DialogInterface dialog,        int id){
          dialog.cancel();
          finish();
        }
      }
);
    }
    String ssid_str=new String(wc.SSID);
    String bssid_str=new String(wc.BSSID);
    String psk_str=new String(wc.preSharedKey);
    Log.i("String_Node_Str","String_Node_Str" + ssid_str + "String_Node_Str"+ bssid_str+ "String_Node_Str"+ psk_str);
    Toast.makeText(Nyala.this,"String_Node_Str",Toast.LENGTH_SHORT).show();
    if (ssid_str.equals("String_Node_Str")) {
      AlertDialog.Builder ad=new AlertDialog.Builder(this);
      ad.setMessage("String_Node_Str").setCancelable(false).setPositiveButton("String_Node_Str",new DialogInterface.OnClickListener(){
        public void onClick(        DialogInterface dialog,        int id){
          dialog.cancel();
        }
      }
);
    }
 else {
      ConnectFromScan(wc,wm);
    }
  }
 else   if (resultCode == RESULT_CANCELED) {
    AlertDialog.Builder ad=new AlertDialog.Builder(this);
    ad.setMessage("String_Node_Str").setCancelable(false).setPositiveButton("String_Node_Str",new DialogInterface.OnClickListener(){
      public void onClick(      DialogInterface dialog,      int id){
        Toast.makeText(Nyala.this,"String_Node_Str",Toast.LENGTH_SHORT).show();
      }
    }
);
    AlertDialog AD=ad.create();
    AD.show();
  }
}