Program: 195873
Project: 195873
Buggy source:
private void calculateEllipsis(int lineStart,int lineEnd,float[] widths,int widthStart,float avail,TextUtils.TruncateAt where,int line,float textWidth,TextPaint paint,boolean forceEllipsis){
  if (textWidth <= avail && !forceEllipsis) {
    mLines[mColumns * line + ELLIPSIS_START]=0;
    mLines[mColumns * line + ELLIPSIS_COUNT]=0;
    return;
  }
  float ellipsisWidth=paint.measureText((where == TextUtils.TruncateAt.END_SMALL) ? ELLIPSIS_TWO_DOTS : ELLIPSIS_NORMAL,0,1);
  int ellipsisStart=0;
  int ellipsisCount=0;
  int len=lineEnd - lineStart;
  if (where == TextUtils.TruncateAt.START) {
    if (mMaximumVisibleLineCount == 1) {
      float sum=0;
      int i;
      for (i=len; i >= 0; i--) {
        float w=widths[i - 1 + lineStart - widthStart];
        if (w + sum + ellipsisWidth > avail) {
          break;
        }
        sum+=w;
      }
      ellipsisStart=0;
      ellipsisCount=i;
    }
 else {
      if (Log.isLoggable(TAG,Log.WARN)) {
        Log.w(TAG,"String_Node_Str");
      }
    }
  }
 else   if (where == TextUtils.TruncateAt.END || where == TextUtils.TruncateAt.MARQUEE || where == TextUtils.TruncateAt.END_SMALL) {
    float sum=0;
    int i;
    for (i=0; i < len; i++) {
      float w=widths[i + lineStart - widthStart];
      if (w + sum + ellipsisWidth > avail) {
        break;
      }
      sum+=w;
    }
    ellipsisStart=i;
    ellipsisCount=len - i;
    if (forceEllipsis && ellipsisCount == 0 && len > 0) {
      ellipsisStart=len - 1;
      ellipsisCount=1;
    }
  }
 else {
    if (mMaximumVisibleLineCount == 1) {
      float lsum=0, rsum=0;
      int left=0, right=len;
      float ravail=(avail - ellipsisWidth) / 2;
      for (right=len; right >= 0; right--) {
        float w=widths[right - 1 + lineStart - widthStart];
        if (w + rsum > ravail) {
          break;
        }
        rsum+=w;
      }
      float lavail=avail - ellipsisWidth - rsum;
      for (left=0; left < right; left++) {
        float w=widths[left + lineStart - widthStart];
        if (w + lsum > lavail) {
          break;
        }
        lsum+=w;
      }
      ellipsisStart=left;
      ellipsisCount=right - left;
    }
 else {
      if (Log.isLoggable(TAG,Log.WARN)) {
        Log.w(TAG,"String_Node_Str");
      }
    }
  }
  mLines[mColumns * line + ELLIPSIS_START]=ellipsisStart;
  mLines[mColumns * line + ELLIPSIS_COUNT]=ellipsisCount;
}

Fixed version (ground truth):
private void calculateEllipsis(int lineStart,int lineEnd,float[] widths,int widthStart,float avail,TextUtils.TruncateAt where,int line,float textWidth,TextPaint paint,boolean forceEllipsis){
  if (textWidth <= avail && !forceEllipsis) {
    mLines[mColumns * line + ELLIPSIS_START]=0;
    mLines[mColumns * line + ELLIPSIS_COUNT]=0;
    return;
  }
  float ellipsisWidth=paint.measureText((where == TextUtils.TruncateAt.END_SMALL) ? ELLIPSIS_TWO_DOTS : ELLIPSIS_NORMAL,0,1);
  int ellipsisStart=0;
  int ellipsisCount=0;
  int len=lineEnd - lineStart;
  if (where == TextUtils.TruncateAt.START) {
    if (mMaximumVisibleLineCount == 1) {
      float sum=0;
      int i;
      for (i=len; i >= 0; i--) {
        float w=widths[i - 1 + lineStart - widthStart];
        if (w + sum + ellipsisWidth > avail) {
          break;
        }
        sum+=w;
      }
      ellipsisStart=0;
      ellipsisCount=i;
    }
 else {
      if (Log.isLoggable(TAG,Log.WARN)) {
        Log.w(TAG,"String_Node_Str");
      }
    }
  }
 else   if (where == TextUtils.TruncateAt.END || where == TextUtils.TruncateAt.MARQUEE || where == TextUtils.TruncateAt.END_SMALL) {
    float sum=0;
    int i;
    for (i=0; i < len; i++) {
      float w=widths[i + lineStart - widthStart];
      if (w + sum + ellipsisWidth > avail) {
        break;
      }
      sum+=w;
    }
    ellipsisStart=i;
    ellipsisCount=len - i;
    if (forceEllipsis && ellipsisCount == 0 && len > 0) {
      ellipsisStart=len - 1;
      ellipsisCount=1;
    }
  }
 else {
    if (mMaximumVisibleLineCount == 1) {
      float lsum=0, rsum=0;
      int left=0, right=len;
      float ravail=(avail - ellipsisWidth) / 2;
      for (right=len; right > 0; right--) {
        float w=widths[right - 1 + lineStart - widthStart];
        if (w + rsum > ravail) {
          break;
        }
        rsum+=w;
      }
      float lavail=avail - ellipsisWidth - rsum;
      for (left=0; left < right; left++) {
        float w=widths[left + lineStart - widthStart];
        if (w + lsum > lavail) {
          break;
        }
        lsum+=w;
      }
      ellipsisStart=left;
      ellipsisCount=right - left;
    }
 else {
      if (Log.isLoggable(TAG,Log.WARN)) {
        Log.w(TAG,"String_Node_Str");
      }
    }
  }
  mLines[mColumns * line + ELLIPSIS_START]=ellipsisStart;
  mLines[mColumns * line + ELLIPSIS_COUNT]=ellipsisCount;
}