Program: 69260
Project: 69260
Buggy source:
void showDesc(final View view,int index,final UnicodeAdapter ua){
  PagerTabStrip tab=new PagerTabStrip(activity);
  tab.setId(0x3EFFFFFF);
  ViewPager.LayoutParams layoutParams=new ViewPager.LayoutParams();
  layoutParams.height=LayoutParams.WRAP_CONTENT;
  layoutParams.width=LayoutParams.MATCH_PARENT;
  layoutParams.gravity=Gravity.TOP;
  final ViewPager pager=new ViewPager(activity);
  pager.addView(tab,layoutParams);
  final CharacterAdapter adapter=new CharacterAdapter(activity,ua,tf,db,afav);
  pager.setAdapter(adapter);
  pager.setCurrentItem(index,false);
  pager.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT,(int)(activity.getResources().getDisplayMetrics().scaledDensity * (CharacterAdapter.fontsize * 1.8f + new TextAppearanceSpan(activity,android.R.style.TextAppearance_Small).getTextSize() * 2.4f + 32.f))));
  LinearLayout layout=new LinearLayout(activity);
  layout.addView(pager);
  AlertDialog.Builder builder=new AlertDialog.Builder(activity).setView(layout);
  if (view != null)   builder.setPositiveButton(R.string.input,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      if (adapter.getId() != -1) {
        arec.add((int)adapter.getId());
        if (recpage != -1 && page != recpage && grids[recpage] != null)         grids[recpage].invalidateViews();
      }
      int start=edit.getSelectionStart();
      int end=edit.getSelectionEnd();
      if (start == -1)       return;
      edit.getEditableText().replace(Math.min(start,end),Math.max(start,end),(String)ua.getItem(adapter.getIndex()));
    }
  }
);
  if (!(view instanceof GridView) || ((GridView)view).getAdapter() != aemoji)   builder.setNeutralButton(R.string.inlist,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      find((int)adapter.getId());
    }
  }
);
  if (view instanceof GridView && ((GridView)view).getAdapter() == arec)   builder.setNegativeButton(R.string.remrec,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      arec.remove((int)adapter.getId());
      if (grids[recpage] != null)       grids[recpage].invalidateViews();
    }
  }
);
  if (view instanceof GridView && ((GridView)view).getAdapter() == aedt)   builder.setNegativeButton(R.string.delete,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      int i=pager.getCurrentItem();
      String s=edit.getEditableText().toString();
      edit.getEditableText().delete(s.offsetByCodePoints(0,i),s.offsetByCodePoints(0,i + 1));
    }
  }
);
  if (view instanceof GridView && ((GridView)view).getAdapter() == alist)   builder.setNegativeButton(R.string.mark,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      final EditText edit=new EditText(activity);
      new AlertDialog.Builder(activity).setTitle(R.string.mark).setView(edit).setPositiveButton(R.string.mark,new DialogInterface.OnClickListener(){
        @Override public void onClick(        DialogInterface arg0,        int arg1){
          alist.mark((int)adapter.getId(),edit.getText().toString());
        }
      }
).create().show();
    }
  }
);
  if (dlg != null && dlg.isShowing())   dlg.dismiss();
  dlg=builder.create();
  dlg.show();
}

Fixed version (ground truth):
void showDesc(final View view,int index,final UnicodeAdapter ua){
  PagerTabStrip tab=new PagerTabStrip(activity);
  tab.setId(R.id.TAB_ID);
  ViewPager.LayoutParams layoutParams=new ViewPager.LayoutParams();
  layoutParams.height=LayoutParams.WRAP_CONTENT;
  layoutParams.width=LayoutParams.MATCH_PARENT;
  layoutParams.gravity=Gravity.TOP;
  final ViewPager pager=new ViewPager(activity);
  pager.addView(tab,layoutParams);
  final CharacterAdapter adapter=new CharacterAdapter(activity,ua,tf,db,afav);
  pager.setAdapter(adapter);
  pager.setCurrentItem(index,false);
  pager.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT,(int)(activity.getResources().getDisplayMetrics().scaledDensity * (CharacterAdapter.fontsize * 1.8f + new TextAppearanceSpan(activity,android.R.style.TextAppearance_Small).getTextSize() * 2.4f + 32.f))));
  LinearLayout layout=new LinearLayout(activity);
  layout.addView(pager);
  AlertDialog.Builder builder=new AlertDialog.Builder(activity).setView(layout);
  if (view != null)   builder.setPositiveButton(R.string.input,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      if (adapter.getId() != -1) {
        arec.add((int)adapter.getId());
        if (recpage != -1 && page != recpage && grids[recpage] != null)         grids[recpage].invalidateViews();
      }
      int start=edit.getSelectionStart();
      int end=edit.getSelectionEnd();
      if (start == -1)       return;
      edit.getEditableText().replace(Math.min(start,end),Math.max(start,end),(String)ua.getItem(adapter.getIndex()));
    }
  }
);
  if (!(view instanceof GridView) || ((GridView)view).getAdapter() != aemoji)   builder.setNeutralButton(R.string.inlist,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      find((int)adapter.getId());
    }
  }
);
  if (view instanceof GridView && ((GridView)view).getAdapter() == arec)   builder.setNegativeButton(R.string.remrec,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      arec.remove((int)adapter.getId());
      if (grids[recpage] != null)       grids[recpage].invalidateViews();
    }
  }
);
  if (view instanceof GridView && ((GridView)view).getAdapter() == aedt)   builder.setNegativeButton(R.string.delete,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      int i=pager.getCurrentItem();
      String s=edit.getEditableText().toString();
      edit.getEditableText().delete(s.offsetByCodePoints(0,i),s.offsetByCodePoints(0,i + 1));
    }
  }
);
  if (view instanceof GridView && ((GridView)view).getAdapter() == alist)   builder.setNegativeButton(R.string.mark,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      final EditText edit=new EditText(activity);
      new AlertDialog.Builder(activity).setTitle(R.string.mark).setView(edit).setPositiveButton(R.string.mark,new DialogInterface.OnClickListener(){
        @Override public void onClick(        DialogInterface arg0,        int arg1){
          alist.mark((int)adapter.getId(),edit.getText().toString());
        }
      }
).create().show();
    }
  }
);
  if (dlg != null && dlg.isShowing())   dlg.dismiss();
  dlg=builder.create();
  dlg.show();
}