Program: 24348
Project: 24348
Buggy source:
private static void show_edit_dialog(int position){
  LayoutInflater inflater=LayoutInflater.from(activity_context);
  final View edit_rss_dialog=inflater.inflate(R.layout.add_rss_dialog,null);
  final String current_group=feed_groups.get(position);
  final String current_title=feed_titles.get(position);
  Spinner group_spinner=(Spinner)edit_rss_dialog.findViewById(R.id.group_spinner);
  ArrayAdapter adapter=new ArrayAdapter(activity_context,R.layout.group_spinner_text,current_groups);
  adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
  group_spinner.setAdapter(adapter);
  int i;
  for (i=0; i < current_groups.length; i++) {
    if (current_groups[i].equals(current_group))     break;
  }
  ((EditText)edit_rss_dialog.findViewById(R.id.name_edit)).setText(current_title);
  ((EditText)edit_rss_dialog.findViewById(R.id.URL_edit)).setText(feed_urls.get(position));
  group_spinner.setSelection(i);
  final AlertDialog edit_dialog=new AlertDialog.Builder(activity_context,2).setTitle("String_Node_Str").setView(edit_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();
  edit_dialog.setOnShowListener(new DialogInterface.OnShowListener(){
    @Override public void onShow(    DialogInterface dialog){
      Button b=edit_dialog.getButton(AlertDialog.BUTTON_POSITIVE);
      b.setOnClickListener(new View.OnClickListener(){
        @Override public void onClick(        View view){
          String new_group=((EditText)edit_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 (            String group : current_groups) {
              if ((group.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)edit_rss_dialog.findViewById(R.id.group_spinner)).getSelectedItem().toString();
          Boolean rss=false;
          String URL_check=((EditText)edit_rss_dialog.findViewById(R.id.URL_edit)).getText().toString().trim();
          String feed_name=((EditText)edit_rss_dialog.findViewById(R.id.name_edit)).getText().toString().trim();
          check_finished=-1;
          if ((!URL_check.contains("String_Node_Str")) && (!URL_check.contains("String_Node_Str"))) {
            new check_feed_exists().execute("String_Node_Str" + URL_check);
            while (check_finished == -1) {
            }
            if (check_finished == 0) {
              check_finished=-1;
              new check_feed_exists().execute("String_Node_Str" + URL_check);
              while (check_finished == -1) {
              }
              if (check_finished == 1)               URL_check="String_Node_Str" + URL_check;
            }
 else             if (check_finished == 1)             URL_check="String_Node_Str" + URL_check;
          }
 else {
            new check_feed_exists().execute(URL_check);
            while (check_finished == -1) {
            }
          }
          if (check_finished == 1)           rss=true;
          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"))             feed_name=feed_title;
            edit_feed(current_title,feed_name,URL_check,current_group,new_group);
            edit_dialog.dismiss();
          }
        }
      }
);
    }
  }
);
  edit_dialog.show();
}

Fixed version (ground truth):
private static void show_edit_dialog(int position){
  poser=position;
  LayoutInflater inflater=LayoutInflater.from(activity_context);
  final View edit_rss_dialog=inflater.inflate(R.layout.add_rss_dialog,null);
  final String current_group=feed_groups.get(position);
  final String current_title=feed_titles.get(position);
  Spinner group_spinner=(Spinner)edit_rss_dialog.findViewById(R.id.group_spinner);
  ArrayAdapter adapter=new ArrayAdapter(activity_context,R.layout.group_spinner_text,current_groups);
  adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
  group_spinner.setAdapter(adapter);
  int i;
  for (i=0; i < current_groups.length; i++) {
    if (current_groups[i].equals(current_group))     break;
  }
  ((EditText)edit_rss_dialog.findViewById(R.id.name_edit)).setText(current_title);
  ((EditText)edit_rss_dialog.findViewById(R.id.URL_edit)).setText(feed_urls.get(position));
  group_spinner.setSelection(i);
  final AlertDialog edit_dialog=new AlertDialog.Builder(activity_context,2).setTitle("String_Node_Str").setView(edit_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();
  edit_dialog.setOnShowListener(new DialogInterface.OnShowListener(){
    @Override public void onShow(    DialogInterface dialog){
      Button b=edit_dialog.getButton(AlertDialog.BUTTON_POSITIVE);
      b.setOnClickListener(new View.OnClickListener(){
        @Override public void onClick(        View view){
          String new_group=((EditText)edit_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 (            String group : current_groups) {
              if ((group.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)edit_rss_dialog.findViewById(R.id.group_spinner)).getSelectedItem().toString();
          Boolean rss=false;
          String URL_check=((EditText)edit_rss_dialog.findViewById(R.id.URL_edit)).getText().toString().trim();
          String feed_name=((EditText)edit_rss_dialog.findViewById(R.id.name_edit)).getText().toString().trim();
          check_finished=-1;
          if ((!URL_check.contains("String_Node_Str")) && (!URL_check.contains("String_Node_Str"))) {
            new check_feed_exists().execute("String_Node_Str" + URL_check);
            while (check_finished == -1) {
            }
            if (check_finished == 0) {
              check_finished=-1;
              new check_feed_exists().execute("String_Node_Str" + URL_check);
              while (check_finished == -1) {
              }
              if (check_finished == 1)               URL_check="String_Node_Str" + URL_check;
            }
 else             if (check_finished == 1)             URL_check="String_Node_Str" + URL_check;
          }
 else {
            new check_feed_exists().execute(URL_check);
            while (check_finished == -1) {
            }
          }
          if (check_finished == 1)           rss=true;
          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"))             feed_name=feed_title;
            edit_feed(poser,current_title,feed_name,URL_check,current_group,new_group);
            edit_dialog.dismiss();
          }
        }
      }
);
    }
  }
);
  edit_dialog.show();
}