Program: 7603
Project: 7603
Buggy source:
/** 
 * Updates the local copy of the info about a download.
 */
private void updateDownload(Cursor cursor,int arrayPos,long now){
  DownloadInfo info=(DownloadInfo)mDownloads.get(arrayPos);
  int statusColumn=cursor.getColumnIndexOrThrow(Downloads.Impl.COLUMN_STATUS);
  int failedColumn=cursor.getColumnIndexOrThrow(Constants.FAILED_CONNECTIONS);
  info.mId=cursor.getInt(cursor.getColumnIndexOrThrow(Downloads.Impl._ID));
  info.mUri=stringFromCursor(info.mUri,cursor,Downloads.Impl.COLUMN_URI);
  info.mNoIntegrity=cursor.getInt(cursor.getColumnIndexOrThrow(Downloads.Impl.COLUMN_NO_INTEGRITY)) == 1;
  info.mHint=stringFromCursor(info.mHint,cursor,Downloads.Impl.COLUMN_FILE_NAME_HINT);
  info.mFileName=stringFromCursor(info.mFileName,cursor,Downloads.Impl._DATA);
  info.mMimeType=stringFromCursor(info.mMimeType,cursor,Downloads.Impl.COLUMN_MIME_TYPE);
  info.mDestination=cursor.getInt(cursor.getColumnIndexOrThrow(Downloads.Impl.COLUMN_DESTINATION));
  int newVisibility=cursor.getInt(cursor.getColumnIndexOrThrow(Downloads.Impl.COLUMN_VISIBILITY));
  if (info.mVisibility == Downloads.Impl.VISIBILITY_VISIBLE_NOTIFY_COMPLETED && newVisibility != Downloads.Impl.VISIBILITY_VISIBLE_NOTIFY_COMPLETED && Downloads.Impl.isStatusCompleted(info.mStatus)) {
    mNotifier.mNotificationMgr.cancel(info.mId);
  }
  info.mVisibility=newVisibility;
synchronized (info) {
    info.mControl=cursor.getInt(cursor.getColumnIndexOrThrow(Downloads.Impl.COLUMN_CONTROL));
  }
  int newStatus=cursor.getInt(statusColumn);
  if (!Downloads.Impl.isStatusCompleted(info.mStatus) && Downloads.Impl.isStatusCompleted(newStatus)) {
    mNotifier.mNotificationMgr.cancel(info.mId);
  }
  info.mStatus=newStatus;
  info.mNumFailed=cursor.getInt(failedColumn);
  int retryRedirect=cursor.getInt(cursor.getColumnIndexOrThrow(Constants.RETRY_AFTER_X_REDIRECT_COUNT));
  info.mRetryAfter=retryRedirect & 0xfffffff;
  info.mRedirectCount=retryRedirect >> 28;
  info.mLastMod=cursor.getLong(cursor.getColumnIndexOrThrow(Downloads.Impl.COLUMN_LAST_MODIFICATION));
  info.mPackage=stringFromCursor(info.mPackage,cursor,Downloads.Impl.COLUMN_NOTIFICATION_PACKAGE);
  info.mClass=stringFromCursor(info.mClass,cursor,Downloads.Impl.COLUMN_NOTIFICATION_CLASS);
  info.mCookies=stringFromCursor(info.mCookies,cursor,Downloads.Impl.COLUMN_COOKIE_DATA);
  info.mUserAgent=stringFromCursor(info.mUserAgent,cursor,Downloads.Impl.COLUMN_USER_AGENT);
  info.mReferer=stringFromCursor(info.mReferer,cursor,Downloads.Impl.COLUMN_REFERER);
  info.mTotalBytes=cursor.getInt(cursor.getColumnIndexOrThrow(Downloads.Impl.COLUMN_TOTAL_BYTES));
  info.mCurrentBytes=cursor.getInt(cursor.getColumnIndexOrThrow(Downloads.Impl.COLUMN_CURRENT_BYTES));
  info.mETag=stringFromCursor(info.mETag,cursor,Constants.ETAG);
  info.mMediaScanned=cursor.getInt(cursor.getColumnIndexOrThrow(Constants.MEDIA_SCANNED)) == 1;
  info.startIfReady(now);
}

Fixed version (ground truth):
/** 
 * Updates the local copy of the info about a download.
 */
private void updateDownload(Cursor cursor,int arrayPos,long now){
  DownloadInfo info=(DownloadInfo)mDownloads.get(arrayPos);
  int statusColumn=cursor.getColumnIndexOrThrow(Downloads.Impl.COLUMN_STATUS);
  int failedColumn=cursor.getColumnIndexOrThrow(Constants.FAILED_CONNECTIONS);
  info.mId=cursor.getInt(cursor.getColumnIndexOrThrow(Downloads.Impl._ID));
  info.mUri=stringFromCursor(info.mUri,cursor,Downloads.Impl.COLUMN_URI);
  info.mNoIntegrity=cursor.getInt(cursor.getColumnIndexOrThrow(Downloads.Impl.COLUMN_NO_INTEGRITY)) == 1;
  info.mHint=stringFromCursor(info.mHint,cursor,Downloads.Impl.COLUMN_FILE_NAME_HINT);
  info.mFileName=stringFromCursor(info.mFileName,cursor,Downloads.Impl._DATA);
  info.mMimeType=stringFromCursor(info.mMimeType,cursor,Downloads.Impl.COLUMN_MIME_TYPE);
  info.mDestination=cursor.getInt(cursor.getColumnIndexOrThrow(Downloads.Impl.COLUMN_DESTINATION));
  int newVisibility=cursor.getInt(cursor.getColumnIndexOrThrow(Downloads.Impl.COLUMN_VISIBILITY));
  if (info.mVisibility == Downloads.Impl.VISIBILITY_VISIBLE_NOTIFY_COMPLETED && newVisibility != Downloads.Impl.VISIBILITY_VISIBLE_NOTIFY_COMPLETED && Downloads.Impl.isStatusCompleted(info.mStatus)) {
    mNotifier.mNotificationMgr.cancel(info.mId);
  }
  info.mVisibility=newVisibility;
synchronized (info) {
    info.mControl=cursor.getInt(cursor.getColumnIndexOrThrow(Downloads.Impl.COLUMN_CONTROL));
  }
  int newStatus=cursor.getInt(statusColumn);
  if (!Downloads.Impl.isStatusCompleted(info.mStatus) && Downloads.Impl.isStatusCompleted(newStatus)) {
    mNotifier.mNotificationMgr.cancel(info.mId);
  }
  info.mStatus=newStatus;
  info.mNumFailed=cursor.getInt(failedColumn);
  int retryRedirect=cursor.getInt(cursor.getColumnIndexOrThrow(Constants.RETRY_AFTER_X_REDIRECT_COUNT));
  info.mRetryAfter=retryRedirect & 0xfffffff;
  info.mRedirectCount=retryRedirect >> 28;
  info.mLastMod=cursor.getLong(cursor.getColumnIndexOrThrow(Downloads.Impl.COLUMN_LAST_MODIFICATION));
  info.mPackage=stringFromCursor(info.mPackage,cursor,Downloads.Impl.COLUMN_NOTIFICATION_PACKAGE);
  info.mClass=stringFromCursor(info.mClass,cursor,Downloads.Impl.COLUMN_NOTIFICATION_CLASS);
  info.mCookies=stringFromCursor(info.mCookies,cursor,Downloads.Impl.COLUMN_COOKIE_DATA);
  info.mUserAgent=stringFromCursor(info.mUserAgent,cursor,Downloads.Impl.COLUMN_USER_AGENT);
  info.mReferer=stringFromCursor(info.mReferer,cursor,Downloads.Impl.COLUMN_REFERER);
  info.mTotalBytes=cursor.getInt(cursor.getColumnIndexOrThrow(Downloads.Impl.COLUMN_TOTAL_BYTES));
  info.mCurrentBytes=cursor.getInt(cursor.getColumnIndexOrThrow(Downloads.Impl.COLUMN_CURRENT_BYTES));
  info.mETag=stringFromCursor(info.mETag,cursor,Constants.ETAG);
  info.mMediaScanned=cursor.getInt(cursor.getColumnIndexOrThrow(Constants.MEDIA_SCANNED)) == 1;
  if (info.isReadyToRestart(now)) {
    info.start(now);
  }
}