Program: 7613
Project: 7613
Buggy source:
private void updateActiveNotification(List<DownloadInfo> downloads){
  mNotifications.clear();
  for (  DownloadInfo download : downloads) {
    if (!isActiveAndVisible(download)) {
      continue;
    }
    String packageName=download.mPackage;
    long max=download.mTotalBytes;
    long progress=download.mCurrentBytes;
    long id=download.mId;
    String title=download.mTitle;
    if (title == null || title.length() == 0) {
      title=mContext.getResources().getString(R.string.download_unknown_title);
    }
    NotificationItem item;
    if (mNotifications.containsKey(packageName)) {
      item=mNotifications.get(packageName);
      item.addItem(title,progress,max);
    }
 else {
      item=new NotificationItem();
      item.mId=(int)id;
      item.mPackageName=packageName;
      item.mDescription=download.mDescription;
      String className=download.mClass;
      item.addItem(title,progress,max);
      mNotifications.put(packageName,item);
    }
    if (hasPausedReason(download) && item.mPausedText == null) {
      item.mPausedText=download.mPausedReason;
    }
  }
  for (  NotificationItem item : mNotifications.values()) {
    Notification n=new Notification();
    boolean hasPausedText=(item.mPausedText != null);
    int iconResource=android.R.drawable.stat_sys_download;
    if (hasPausedText) {
      iconResource=android.R.drawable.stat_sys_warning;
    }
    n.icon=iconResource;
    n.flags|=Notification.FLAG_ONGOING_EVENT;
    RemoteViews expandedView=new RemoteViews("String_Node_Str",R.layout.status_bar_ongoing_event_progress_bar);
    StringBuilder title=new StringBuilder(item.mTitles[0]);
    if (item.mTitleCount > 1) {
      title.append(mContext.getString(R.string.notification_filename_separator));
      title.append(item.mTitles[1]);
      n.number=item.mTitleCount;
      if (item.mTitleCount > 2) {
        title.append(mContext.getString(R.string.notification_filename_extras,new Object[]{Integer.valueOf(item.mTitleCount - 2)}));
      }
    }
 else {
      expandedView.setTextViewText(R.id.description,item.mDescription);
    }
    expandedView.setTextViewText(R.id.title,title);
    if (hasPausedText) {
      expandedView.setViewVisibility(R.id.progress_bar,View.GONE);
      expandedView.setTextViewText(R.id.paused_text,item.mPausedText);
    }
 else {
      expandedView.setViewVisibility(R.id.paused_text,View.GONE);
      expandedView.setProgressBar(R.id.progress_bar,(int)item.mTotalTotal,(int)item.mTotalCurrent,item.mTotalTotal == -1);
    }
    expandedView.setTextViewText(R.id.progress_text,getDownloadingText(item.mTotalTotal,item.mTotalCurrent));
    expandedView.setImageViewResource(R.id.appIcon,iconResource);
    n.contentView=expandedView;
    Intent intent=new Intent(Constants.ACTION_LIST);
    intent.setClassName("String_Node_Str",DownloadReceiver.class.getName());
    intent.setData(ContentUris.withAppendedId(Downloads.Impl.CONTENT_URI,item.mId));
    intent.putExtra("String_Node_Str",item.mTitleCount > 1);
    n.contentIntent=PendingIntent.getBroadcast(mContext,0,intent,0);
    mSystemFacade.postNotification(item.mId,n);
  }
}

Fixed version (ground truth):
private void updateActiveNotification(Collection<DownloadInfo> downloads){
  mNotifications.clear();
  for (  DownloadInfo download : downloads) {
    if (!isActiveAndVisible(download)) {
      continue;
    }
    String packageName=download.mPackage;
    long max=download.mTotalBytes;
    long progress=download.mCurrentBytes;
    long id=download.mId;
    String title=download.mTitle;
    if (title == null || title.length() == 0) {
      title=mContext.getResources().getString(R.string.download_unknown_title);
    }
    NotificationItem item;
    if (mNotifications.containsKey(packageName)) {
      item=mNotifications.get(packageName);
      item.addItem(title,progress,max);
    }
 else {
      item=new NotificationItem();
      item.mId=(int)id;
      item.mPackageName=packageName;
      item.mDescription=download.mDescription;
      item.addItem(title,progress,max);
      mNotifications.put(packageName,item);
    }
    if (hasPausedReason(download) && item.mPausedText == null) {
      item.mPausedText=download.mPausedReason;
    }
  }
  for (  NotificationItem item : mNotifications.values()) {
    Notification n=new Notification();
    boolean hasPausedText=(item.mPausedText != null);
    int iconResource=android.R.drawable.stat_sys_download;
    if (hasPausedText) {
      iconResource=android.R.drawable.stat_sys_warning;
    }
    n.icon=iconResource;
    n.flags|=Notification.FLAG_ONGOING_EVENT;
    RemoteViews expandedView=new RemoteViews("String_Node_Str",R.layout.status_bar_ongoing_event_progress_bar);
    StringBuilder title=new StringBuilder(item.mTitles[0]);
    if (item.mTitleCount > 1) {
      title.append(mContext.getString(R.string.notification_filename_separator));
      title.append(item.mTitles[1]);
      n.number=item.mTitleCount;
      if (item.mTitleCount > 2) {
        title.append(mContext.getString(R.string.notification_filename_extras,new Object[]{Integer.valueOf(item.mTitleCount - 2)}));
      }
    }
 else {
      expandedView.setTextViewText(R.id.description,item.mDescription);
    }
    expandedView.setTextViewText(R.id.title,title);
    if (hasPausedText) {
      expandedView.setViewVisibility(R.id.progress_bar,View.GONE);
      expandedView.setTextViewText(R.id.paused_text,item.mPausedText);
    }
 else {
      expandedView.setViewVisibility(R.id.paused_text,View.GONE);
      expandedView.setProgressBar(R.id.progress_bar,(int)item.mTotalTotal,(int)item.mTotalCurrent,item.mTotalTotal == -1);
    }
    expandedView.setTextViewText(R.id.progress_text,getDownloadingText(item.mTotalTotal,item.mTotalCurrent));
    expandedView.setImageViewResource(R.id.appIcon,iconResource);
    n.contentView=expandedView;
    Intent intent=new Intent(Constants.ACTION_LIST);
    intent.setClassName("String_Node_Str",DownloadReceiver.class.getName());
    intent.setData(ContentUris.withAppendedId(Downloads.Impl.ALL_DOWNLOADS_CONTENT_URI,item.mId));
    intent.putExtra("String_Node_Str",item.mTitleCount > 1);
    n.contentIntent=PendingIntent.getBroadcast(mContext,0,intent,0);
    mSystemFacade.postNotification(item.mId,n);
  }
}