Program: 197900
Project: 197900
Buggy source:
private RemoteViews applyStandardTemplate(int resId){
  RemoteViews contentView=new BuilderRemoteViews(mContext.getPackageName(),mOriginatingUserId,resId);
  boolean showLine3=false;
  boolean showLine2=false;
  boolean contentTextInLine2=false;
  if (mLargeIcon != null) {
    contentView.setImageViewBitmap(R.id.icon,mLargeIcon);
    processLargeLegacyIcon(mLargeIcon,contentView);
    contentView.setImageViewResource(R.id.right_icon,mSmallIcon);
    contentView.setViewVisibility(R.id.right_icon,View.VISIBLE);
    processSmallRightIcon(mSmallIcon,contentView);
  }
 else {
    contentView.setImageViewResource(R.id.icon,mSmallIcon);
    contentView.setViewVisibility(R.id.icon,View.VISIBLE);
    processSmallIconAsLarge(mSmallIcon,contentView);
  }
  if (mContentTitle != null) {
    contentView.setTextViewText(R.id.title,processLegacyText(mContentTitle));
  }
  if (mContentText != null) {
    contentView.setTextViewText(R.id.text,processLegacyText(mContentText));
    showLine3=true;
  }
  if (mContentInfo != null) {
    contentView.setTextViewText(R.id.info,processLegacyText(mContentInfo));
    contentView.setViewVisibility(R.id.info,View.VISIBLE);
    showLine3=true;
  }
 else   if (mNumber > 0) {
    final int tooBig=mContext.getResources().getInteger(R.integer.status_bar_notification_info_maxnum);
    if (mNumber > tooBig) {
      contentView.setTextViewText(R.id.info,processLegacyText(mContext.getResources().getString(R.string.status_bar_notification_info_overflow)));
    }
 else {
      NumberFormat f=NumberFormat.getIntegerInstance();
      contentView.setTextViewText(R.id.info,processLegacyText(f.format(mNumber)));
    }
    contentView.setViewVisibility(R.id.info,View.VISIBLE);
    showLine3=true;
  }
 else {
    contentView.setViewVisibility(R.id.info,View.GONE);
  }
  if (mSubText != null) {
    contentView.setTextViewText(R.id.text,processLegacyText(mSubText));
    if (mContentText != null) {
      contentView.setTextViewText(R.id.text2,processLegacyText(mContentText));
      contentView.setViewVisibility(R.id.text2,View.VISIBLE);
      showLine2=true;
      contentTextInLine2=true;
    }
 else {
      contentView.setViewVisibility(R.id.text2,View.GONE);
    }
  }
 else {
    contentView.setViewVisibility(R.id.text2,View.GONE);
    if (mProgressMax != 0 || mProgressIndeterminate) {
      contentView.setProgressBar(R.id.progress,mProgressMax,mProgress,mProgressIndeterminate);
      contentView.setViewVisibility(R.id.progress,View.VISIBLE);
      showLine2=true;
    }
 else {
      contentView.setViewVisibility(R.id.progress,View.GONE);
    }
  }
  if (showLine2) {
    final Resources res=mContext.getResources();
    final float subTextSize=res.getDimensionPixelSize(R.dimen.notification_subtext_size);
    contentView.setTextViewTextSize(R.id.text,TypedValue.COMPLEX_UNIT_PX,subTextSize);
  }
  if (mWhen != 0 && mShowWhen) {
    if (mUseChronometer) {
      contentView.setViewVisibility(R.id.chronometer,View.VISIBLE);
      contentView.setLong(R.id.chronometer,"String_Node_Str",mWhen + (SystemClock.elapsedRealtime() - System.currentTimeMillis()));
      contentView.setBoolean(R.id.chronometer,"String_Node_Str",true);
    }
 else {
      contentView.setViewVisibility(R.id.time,View.VISIBLE);
      contentView.setLong(R.id.time,"String_Node_Str",mWhen);
    }
  }
 else {
    contentView.setViewVisibility(R.id.time,View.GONE);
  }
  contentView.setViewPadding(R.id.line1,0,calculateTopPadding(mContext,hasThreeLines(),mContext.getResources().getConfiguration().fontScale),0,0);
  boolean addedBadge=addProfileBadge(contentView,contentTextInLine2 ? R.id.profile_badge_line2 : R.id.profile_badge_line3);
  if (addedBadge && !contentTextInLine2) {
    showLine3=true;
  }
  contentView.setViewVisibility(R.id.line3,showLine3 ? View.VISIBLE : View.GONE);
  contentView.setViewVisibility(R.id.overflow_divider,showLine3 ? View.VISIBLE : View.GONE);
  return contentView;
}

Fixed version (ground truth):
private RemoteViews applyStandardTemplate(int resId){
  RemoteViews contentView=new BuilderRemoteViews(mContext.getPackageName(),mOriginatingUserId,resId);
  boolean showLine3=false;
  boolean showLine2=false;
  boolean contentTextInLine2=false;
  if (mLargeIcon != null) {
    contentView.setImageViewBitmap(R.id.icon,mLargeIcon);
    processLargeLegacyIcon(mLargeIcon,contentView);
    contentView.setImageViewResource(R.id.right_icon,mSmallIcon);
    contentView.setViewVisibility(R.id.right_icon,View.VISIBLE);
    processSmallRightIcon(mSmallIcon,contentView);
  }
 else {
    contentView.setImageViewResource(R.id.icon,mSmallIcon);
    contentView.setViewVisibility(R.id.icon,View.VISIBLE);
    processSmallIconAsLarge(mSmallIcon,contentView);
  }
  if (mContentTitle != null) {
    contentView.setTextViewText(R.id.title,processLegacyText(mContentTitle));
  }
  if (mContentText != null) {
    contentView.setTextViewText(R.id.text,processLegacyText(mContentText));
    showLine3=true;
  }
  if (mContentInfo != null) {
    contentView.setTextViewText(R.id.info,processLegacyText(mContentInfo));
    contentView.setViewVisibility(R.id.info,View.VISIBLE);
    showLine3=true;
  }
 else   if (mNumber > 0) {
    final int tooBig=mContext.getResources().getInteger(R.integer.status_bar_notification_info_maxnum);
    if (mNumber > tooBig) {
      contentView.setTextViewText(R.id.info,processLegacyText(mContext.getResources().getString(R.string.status_bar_notification_info_overflow)));
    }
 else {
      NumberFormat f=NumberFormat.getIntegerInstance();
      contentView.setTextViewText(R.id.info,processLegacyText(f.format(mNumber)));
    }
    contentView.setViewVisibility(R.id.info,View.VISIBLE);
    showLine3=true;
  }
 else {
    contentView.setViewVisibility(R.id.info,View.GONE);
  }
  if (mSubText != null) {
    contentView.setTextViewText(R.id.text,processLegacyText(mSubText));
    if (mContentText != null) {
      contentView.setTextViewText(R.id.text2,processLegacyText(mContentText));
      contentView.setViewVisibility(R.id.text2,View.VISIBLE);
      showLine2=true;
      contentTextInLine2=true;
    }
 else {
      contentView.setViewVisibility(R.id.text2,View.GONE);
    }
  }
 else {
    contentView.setViewVisibility(R.id.text2,View.GONE);
    if (mProgressMax != 0 || mProgressIndeterminate) {
      contentView.setProgressBar(R.id.progress,mProgressMax,mProgress,mProgressIndeterminate);
      contentView.setViewVisibility(R.id.progress,View.VISIBLE);
      showLine2=true;
    }
 else {
      contentView.setViewVisibility(R.id.progress,View.GONE);
    }
  }
  if (showLine2) {
    shrinkLine3Text(contentView);
  }
  if (mWhen != 0 && mShowWhen) {
    if (mUseChronometer) {
      contentView.setViewVisibility(R.id.chronometer,View.VISIBLE);
      contentView.setLong(R.id.chronometer,"String_Node_Str",mWhen + (SystemClock.elapsedRealtime() - System.currentTimeMillis()));
      contentView.setBoolean(R.id.chronometer,"String_Node_Str",true);
    }
 else {
      contentView.setViewVisibility(R.id.time,View.VISIBLE);
      contentView.setLong(R.id.time,"String_Node_Str",mWhen);
    }
  }
 else {
    contentView.setViewVisibility(R.id.time,View.GONE);
  }
  contentView.setViewPadding(R.id.line1,0,calculateTopPadding(mContext,mHasThreeLines,mContext.getResources().getConfiguration().fontScale),0,0);
  boolean addedBadge=addProfileBadge(contentView,contentTextInLine2 ? R.id.profile_badge_line2 : R.id.profile_badge_line3);
  if (addedBadge && !contentTextInLine2) {
    showLine3=true;
  }
  contentView.setViewVisibility(R.id.line3,showLine3 ? View.VISIBLE : View.GONE);
  contentView.setViewVisibility(R.id.overflow_divider,showLine3 ? View.VISIBLE : View.GONE);
  return contentView;
}