Program: 24358
Project: 24358
Buggy source:
private void show_add_dialog(){
  LayoutInflater inflater=LayoutInflater.from(this);
  final View add_rss_dialog=inflater.inflate(R.layout.add_rss_dialog,null);
  check_for_no_groups();
  Spinner group_spinner=(Spinner)add_rss_dialog.findViewById(R.id.group_spinner);
  ArrayAdapter adapter=new ArrayAdapter(this,R.layout.group_spinner_text,current_groups);
  adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
  group_spinner.setAdapter(adapter);
  final AlertDialog alertDialog=new AlertDialog.Builder(this,2).setTitle("String_Node_Str").setView(add_rss_dialog).setCancelable(true).setPositiveButton("String_Node_Str",new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int id){
    }
  }
).setNegativeButton("String_Node_Str",new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int id){
    }
  }
).create();
  alertDialog.setOnShowListener(new DialogInterface.OnShowListener(){
    @Override public void onShow(    DialogInterface dialog){
      Button b=alertDialog.getButton(AlertDialog.BUTTON_POSITIVE);
      b.setOnClickListener(new View.OnClickListener(){
        @Override public void onClick(        View view){
          String new_group=((EditText)add_rss_dialog.findViewById(R.id.group_edit)).getText().toString().trim().toLowerCase();
          boolean found=false;
          boolean new_group_mode=false;
          if (new_group.length() > 0) {
            new_group_mode=true;
            for (int i=0; i < current_groups.length; i++) {
              if ((current_groups[i].toLowerCase()).equals(new_group))               found=true;
            }
            String[] words=new_group.split("String_Node_Str");
            new_group="String_Node_Str";
            if (words.length == 1) {
              char cap=Character.toUpperCase(words[0].charAt(0));
              new_group+=cap + words[0].substring(1,words[0].length());
            }
 else {
              for (int i=0; i < words.length - 1; i++) {
                char cap=Character.toUpperCase(words[i].charAt(0));
                new_group+=cap + words[i].substring(1,words[i].length()) + "String_Node_Str";
              }
              char cap=Character.toUpperCase(words[words.length - 1].charAt(0));
              new_group+=cap + words[words.length - 1].substring(1,words[words.length - 1].length());
            }
          }
 else           new_group=((Spinner)add_rss_dialog.findViewById(R.id.group_spinner)).getSelectedItem().toString();
          Boolean rss=false;
          String URL_check=((EditText)add_rss_dialog.findViewById(R.id.URL_edit)).getText().toString().trim();
          String feed_name=((EditText)add_rss_dialog.findViewById(R.id.name_edit)).getText().toString().trim();
          File in=new File(get_filepath("String_Node_Str"));
          download_finished=0;
          new adownload_file().execute(URL_check,"String_Node_Str");
          while (download_finished == 0) {
            try {
              Thread.sleep(20);
            }
 catch (            Exception e) {
            }
          }
          if (Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())) {
            try {
              BufferedReader reader=new BufferedReader(new FileReader(in));
              try {
                for (int i=0; i < 3; i++) {
                  String line=reader.readLine();
                  if (line.contains("String_Node_Str")) {
                    rss=true;
                    break;
                  }
 else                   if ((line.contains("String_Node_Str")) || (line.contains("String_Node_Str"))) {
                    rss=true;
                    break;
                  }
                }
              }
 catch (              Exception e) {
                rss=false;
              }
            }
 catch (            Exception e) {
              rss=false;
            }
          }
          if (rss != null && !rss)           toast_message("String_Node_Str",0);
 else {
            if ((!found) && (new_group_mode))             add_group(new_group);
            if (feed_name.equals("String_Node_Str")) {
              new parsered(get_filepath("String_Node_Str"));
              String[] title=read_csv_to_array("String_Node_Str",get_filepath("String_Node_Str"));
              feed_name=title[0];
              File temp=new File(get_filepath("String_Node_Str"));
              temp.delete();
            }
            add_feed(feed_name,URL_check,new_group);
            alertDialog.dismiss();
          }
          in.delete();
        }
      }
);
    }
  }
);
  alertDialog.show();
}

Fixed version (ground truth):
private void show_add_dialog(){
  LayoutInflater inflater=LayoutInflater.from(this);
  final View add_rss_dialog=inflater.inflate(R.layout.add_rss_dialog,null);
  check_for_no_groups();
  Spinner group_spinner=(Spinner)add_rss_dialog.findViewById(R.id.group_spinner);
  ArrayAdapter adapter=new ArrayAdapter(this,R.layout.group_spinner_text,current_groups);
  adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
  group_spinner.setAdapter(adapter);
  final AlertDialog alertDialog=new AlertDialog.Builder(this,2).setTitle("String_Node_Str").setView(add_rss_dialog).setCancelable(true).setPositiveButton("String_Node_Str",new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int id){
    }
  }
).setNegativeButton("String_Node_Str",new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int id){
    }
  }
).create();
  alertDialog.setOnShowListener(new DialogInterface.OnShowListener(){
    @Override public void onShow(    DialogInterface dialog){
      Button b=alertDialog.getButton(AlertDialog.BUTTON_POSITIVE);
      b.setOnClickListener(new View.OnClickListener(){
        @Override public void onClick(        View view){
          String new_group=((EditText)add_rss_dialog.findViewById(R.id.group_edit)).getText().toString().trim().toLowerCase();
          boolean found=false;
          boolean new_group_mode=false;
          if (new_group.length() > 0) {
            new_group_mode=true;
            for (int i=0; i < current_groups.length; i++) {
              if ((current_groups[i].toLowerCase()).equals(new_group))               found=true;
            }
            String[] words=new_group.split("String_Node_Str");
            new_group="String_Node_Str";
            if (words.length == 1) {
              char cap=Character.toUpperCase(words[0].charAt(0));
              new_group+=cap + words[0].substring(1,words[0].length());
            }
 else {
              for (int i=0; i < words.length - 1; i++) {
                char cap=Character.toUpperCase(words[i].charAt(0));
                new_group+=cap + words[i].substring(1,words[i].length()) + "String_Node_Str";
              }
              char cap=Character.toUpperCase(words[words.length - 1].charAt(0));
              new_group+=cap + words[words.length - 1].substring(1,words[words.length - 1].length());
            }
          }
 else           new_group=((Spinner)add_rss_dialog.findViewById(R.id.group_spinner)).getSelectedItem().toString();
          Boolean rss=false;
          String URL_check=((EditText)add_rss_dialog.findViewById(R.id.URL_edit)).getText().toString().trim();
          String feed_name=((EditText)add_rss_dialog.findViewById(R.id.name_edit)).getText().toString().trim();
          File in=new File(get_filepath("String_Node_Str"));
          download_finished=0;
          new adownload_file().execute(URL_check,"String_Node_Str");
          while (download_finished == 0) {
            try {
              Thread.sleep(20);
            }
 catch (            Exception e) {
            }
          }
          if (Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())) {
            try {
              BufferedReader reader=new BufferedReader(new FileReader(in));
              try {
                for (int i=0; i < 3; i++) {
                  String line=reader.readLine();
                  if (line.contains("String_Node_Str")) {
                    rss=true;
                    break;
                  }
 else                   if ((line.contains("String_Node_Str")) || (line.contains("String_Node_Str"))) {
                    rss=true;
                    break;
                  }
                }
              }
 catch (              Exception e) {
                rss=false;
              }
            }
 catch (            Exception e) {
              rss=false;
            }
          }
          if (rss != null && !rss)           toast_message("String_Node_Str",0);
 else {
            if ((!found) && (new_group_mode))             add_group(new_group);
            if (feed_name.equals("String_Node_Str")) {
              try {
                String file_path=get_filepath("String_Node_Str");
                File temp=new File(file_path + "String_Node_Str");
                new parsered(file_path);
                String line=(new BufferedReader(new FileReader(temp))).readLine();
                int content_start=line.indexOf("String_Node_Str") + 6;
                feed_name=line.substring(content_start,line.indexOf('|',content_start));
                temp.delete();
                (new File(file_path)).delete();
              }
 catch (              Exception e) {
                toast_message("String_Node_Str",1);
              }
            }
            add_feed(feed_name,URL_check,new_group);
            alertDialog.dismiss();
          }
          in.delete();
        }
      }
);
    }
  }
);
  alertDialog.show();
}