Program: 7615
Project: 7615
Buggy source:
private void updateCompletedNotification(){
  Cursor c=mContext.getContentResolver().query(Downloads.CONTENT_URI,new String[]{Downloads._ID,Downloads.COLUMN_TITLE,Downloads.COLUMN_DESCRIPTION,Downloads.COLUMN_NOTIFICATION_PACKAGE,Downloads.COLUMN_NOTIFICATION_CLASS,Downloads.COLUMN_CURRENT_BYTES,Downloads.COLUMN_TOTAL_BYTES,Downloads.COLUMN_STATUS,Downloads._DATA,Downloads.COLUMN_LAST_MODIFICATION,Downloads.COLUMN_DESTINATION},WHERE_COMPLETED,null,Downloads._ID);
  if (c == null) {
    return;
  }
  final int idColumn=0;
  final int titleColumn=1;
  final int descColumn=2;
  final int ownerColumn=3;
  final int classOwnerColumn=4;
  final int currentBytesColumn=5;
  final int totalBytesColumn=6;
  final int statusColumn=7;
  final int filenameColumnId=8;
  final int lastModColumnId=9;
  final int destinationColumnId=10;
  for (c.moveToFirst(); !c.isAfterLast(); c.moveToNext()) {
    Notification n=new Notification();
    n.icon=android.R.drawable.stat_sys_download_done;
    String title=c.getString(titleColumn);
    if (title == null || title.length() == 0) {
      title=mContext.getResources().getString(R.string.download_unknown_title);
    }
    Uri contentUri=Uri.parse(Downloads.CONTENT_URI + "String_Node_Str" + c.getInt(idColumn));
    String caption;
    Intent intent;
    if (Downloads.isStatusError(c.getInt(statusColumn))) {
      caption=mContext.getResources().getString(R.string.notification_download_failed);
      intent=new Intent(Constants.ACTION_LIST);
    }
 else {
      caption=mContext.getResources().getString(R.string.notification_download_complete);
      if (c.getInt(destinationColumnId) == Downloads.DESTINATION_EXTERNAL) {
        intent=new Intent(Constants.ACTION_OPEN);
      }
 else {
        intent=new Intent(Constants.ACTION_LIST);
      }
    }
    intent.setClassName("String_Node_Str",DownloadReceiver.class.getName());
    intent.setData(contentUri);
    n.setLatestEventInfo(mContext,title,caption,PendingIntent.getBroadcast(mContext,0,intent,0));
    intent=new Intent(Constants.ACTION_HIDE);
    intent.setClassName("String_Node_Str",DownloadReceiver.class.getName());
    intent.setData(contentUri);
    n.deleteIntent=PendingIntent.getBroadcast(mContext,0,intent,0);
    n.when=c.getLong(lastModColumnId);
    mNotificationMgr.notify(c.getInt(idColumn),n);
  }
  c.close();
}

Fixed version (ground truth):
private void updateCompletedNotification(){
  Cursor c=mContext.getContentResolver().query(Downloads.CONTENT_URI,new String[]{Downloads._ID,Downloads.COLUMN_TITLE,Downloads.COLUMN_DESCRIPTION,Downloads.COLUMN_NOTIFICATION_PACKAGE,Downloads.COLUMN_NOTIFICATION_CLASS,Downloads.COLUMN_CURRENT_BYTES,Downloads.COLUMN_TOTAL_BYTES,Downloads.COLUMN_STATUS,Downloads._DATA,Downloads.COLUMN_LAST_MODIFICATION,Downloads.COLUMN_DESTINATION},WHERE_COMPLETED,null,Downloads._ID);
  if (c == null) {
    return;
  }
  final int idColumn=0;
  final int titleColumn=1;
  final int descColumn=2;
  final int ownerColumn=3;
  final int classOwnerColumn=4;
  final int currentBytesColumn=5;
  final int totalBytesColumn=6;
  final int statusColumn=7;
  final int filenameColumnId=8;
  final int lastModColumnId=9;
  final int destinationColumnId=10;
  for (c.moveToFirst(); !c.isAfterLast(); c.moveToNext()) {
    Notification n=new Notification();
    n.icon=android.R.drawable.stat_sys_download_done;
    String title=c.getString(titleColumn);
    if (title == null || title.length() == 0) {
      title=mContext.getResources().getString(R.string.download_unknown_title);
    }
    Uri contentUri=Uri.parse(Downloads.CONTENT_URI + "String_Node_Str" + c.getInt(idColumn));
    String caption;
    Intent intent;
    if (Downloads.isStatusError(c.getInt(statusColumn))) {
      caption=mContext.getResources().getString(R.string.notification_download_failed);
      intent=new Intent(Constants.ACTION_LIST);
    }
 else {
      caption=mContext.getResources().getString(R.string.notification_download_complete);
      if (c.getInt(destinationColumnId) == Downloads.DESTINATION_EXTERNAL) {
        intent=new Intent(Constants.ACTION_OPEN);
      }
 else {
        intent=new Intent(Constants.ACTION_LIST);
      }
    }
    intent.setClassName("String_Node_Str",DownloadReceiver.class.getName());
    intent.setData(contentUri);
    n.when=c.getLong(lastModColumnId);
    n.setLatestEventInfo(mContext,title,caption,PendingIntent.getBroadcast(mContext,0,intent,0));
    intent=new Intent(Constants.ACTION_HIDE);
    intent.setClassName("String_Node_Str",DownloadReceiver.class.getName());
    intent.setData(contentUri);
    n.deleteIntent=PendingIntent.getBroadcast(mContext,0,intent,0);
    mNotificationMgr.notify(c.getInt(idColumn),n);
  }
  c.close();
}