Program: 165277
Project: 165277
Buggy source:
@Override public void onActivityCreated(Bundle savedInstanceState){
  super.onActivityCreated(savedInstanceState);
  setEmptyText(getString(R.string.no_applications_found));
  packageManager=getActivity().getPackageManager();
  defaultAppIcon=getActivity().getResources().getDrawable(android.R.drawable.sym_def_app_icon);
  selectLocalAppsActivity=(SelectLocalAppsActivity)getActivity();
  ListView listView=getListView();
  listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
  SimpleCursorAdapter adapter=new SimpleCursorAdapter(getActivity(),R.layout.select_local_apps_list_item,null,new String[]{InstalledAppProvider.DataColumns.APPLICATION_LABEL,InstalledAppProvider.DataColumns.APP_ID},new int[]{R.id.application_label,R.id.package_name},0);
  adapter.setViewBinder(new ViewBinder(){
    @Override public boolean setViewValue(    View view,    Cursor cursor,    int columnIndex){
      if (columnIndex == cursor.getColumnIndex(InstalledAppProvider.DataColumns.APP_ID)) {
        String packageName=cursor.getString(columnIndex);
        TextView textView=(TextView)view.findViewById(R.id.package_name);
        textView.setText(packageName);
        LinearLayout ll=(LinearLayout)view.getParent().getParent();
        ImageView iconView=(ImageView)ll.getChildAt(0);
        Drawable icon;
        try {
          icon=packageManager.getApplicationIcon(packageName);
        }
 catch (        PackageManager.NameNotFoundException e) {
          icon=defaultAppIcon;
        }
        iconView.setImageDrawable(icon);
        return true;
      }
      return false;
    }
  }
);
  setListAdapter(adapter);
  setListShown(false);
  getLoaderManager().initLoader(0,null,this);
  if (FDroidApp.selectedApps == null) {
    HashSet<String> selectedApps=new HashSet<String>();
    for (    String filename : LocalRepoManager.get(selectLocalAppsActivity).repoDir.list()) {
      if (filename.matches("String_Node_Str")) {
        String packageName=filename.substring(0,filename.indexOf("String_Node_Str"));
        FDroidApp.selectedApps.add(packageName);
      }
    }
    FDroidApp.selectedApps=selectedApps;
  }
}

Fixed version (ground truth):
@Override public void onActivityCreated(Bundle savedInstanceState){
  super.onActivityCreated(savedInstanceState);
  setEmptyText(getString(R.string.no_applications_found));
  packageManager=getActivity().getPackageManager();
  defaultAppIcon=getActivity().getResources().getDrawable(android.R.drawable.sym_def_app_icon);
  selectLocalAppsActivity=(SelectLocalAppsActivity)getActivity();
  ListView listView=getListView();
  listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
  SimpleCursorAdapter adapter=new SimpleCursorAdapter(getActivity(),R.layout.select_local_apps_list_item,null,new String[]{InstalledAppProvider.DataColumns.APPLICATION_LABEL,InstalledAppProvider.DataColumns.APP_ID},new int[]{R.id.application_label,R.id.package_name},0);
  adapter.setViewBinder(new ViewBinder(){
    @Override public boolean setViewValue(    View view,    Cursor cursor,    int columnIndex){
      if (columnIndex == cursor.getColumnIndex(InstalledAppProvider.DataColumns.APP_ID)) {
        String packageName=cursor.getString(columnIndex);
        TextView textView=(TextView)view.findViewById(R.id.package_name);
        textView.setText(packageName);
        LinearLayout ll=(LinearLayout)view.getParent().getParent();
        ImageView iconView=(ImageView)ll.getChildAt(0);
        Drawable icon;
        try {
          icon=packageManager.getApplicationIcon(packageName);
        }
 catch (        PackageManager.NameNotFoundException e) {
          icon=defaultAppIcon;
        }
        iconView.setImageDrawable(icon);
        return true;
      }
      return false;
    }
  }
);
  setListAdapter(adapter);
  setListShown(false);
  getLoaderManager().initLoader(0,null,this);
  if (FDroidApp.selectedApps == null) {
    HashSet<String> selectedApps=new HashSet<String>();
    for (    String filename : LocalRepoManager.get(selectLocalAppsActivity).repoDir.list()) {
      if (filename.matches("String_Node_Str")) {
        String packageName=filename.substring(0,filename.indexOf("String_Node_Str"));
        selectedApps.add(packageName);
      }
    }
    FDroidApp.selectedApps=selectedApps;
  }
}