Program: 2626
Project: 2626
Buggy source:
@Override protected void dispatchDraw(Canvas canvas){
  super.dispatchDraw(canvas);
  if ((mChildIndicator == null) && (mGroupIndicator == null)) {
    return;
  }
  int saveCount=0;
  final boolean clipToPadding=(mGroupFlags & CLIP_TO_PADDING_MASK) == CLIP_TO_PADDING_MASK;
  if (clipToPadding) {
    saveCount=canvas.save();
    final int scrollX=mScrollX;
    final int scrollY=mScrollY;
    canvas.clipRect(scrollX + mPaddingLeft,scrollY + mPaddingTop,scrollX + mRight - mLeft - mPaddingRight,scrollY + mBottom - mTop - mPaddingBottom);
  }
  final int headerViewsCount=getHeaderViewsCount();
  final int lastChildFlPos=mItemCount - getFooterViewsCount() - headerViewsCount- 1;
  final int myB=mBottom;
  PositionMetadata pos;
  View item;
  Drawable indicator;
  int t, b;
  int lastItemType=~(ExpandableListPosition.CHILD | ExpandableListPosition.GROUP);
  final Rect indicatorRect=mIndicatorRect;
  final int childCount=getChildCount();
  for (int i=0, childFlPos=mFirstPosition - headerViewsCount; i < childCount; i++, childFlPos++) {
    if (childFlPos < 0) {
      continue;
    }
 else     if (childFlPos > lastChildFlPos) {
      break;
    }
    item=getChildAt(i);
    t=item.getTop();
    b=item.getBottom();
    if ((b < 0) || (t > myB))     continue;
    pos=mConnector.getUnflattenedPos(childFlPos);
    if (pos.position.type != lastItemType) {
      if (pos.position.type == ExpandableListPosition.CHILD) {
        indicatorRect.left=(mChildIndicatorLeft == CHILD_INDICATOR_INHERIT) ? mIndicatorLeft : mChildIndicatorLeft;
        indicatorRect.right=(mChildIndicatorRight == CHILD_INDICATOR_INHERIT) ? mIndicatorRight : mChildIndicatorRight;
      }
 else {
        indicatorRect.left=mIndicatorLeft;
        indicatorRect.right=mIndicatorRight;
      }
      indicatorRect.left+=mPaddingLeft;
      indicatorRect.right+=mPaddingLeft;
      lastItemType=pos.position.type;
    }
    if (indicatorRect.left != indicatorRect.right) {
      if (mStackFromBottom) {
        indicatorRect.top=t;
        indicatorRect.bottom=b;
      }
 else {
        indicatorRect.top=t;
        indicatorRect.bottom=b;
      }
      indicator=getIndicator(pos);
      if (indicator != null) {
        indicator.setBounds(indicatorRect);
        indicator.draw(canvas);
      }
    }
    pos.recycle();
  }
  if (clipToPadding) {
    canvas.restoreToCount(saveCount);
  }
}

Fixed version (ground truth):
@Override protected void dispatchDraw(Canvas canvas){
  super.dispatchDraw(canvas);
  if ((mChildIndicator == null) && (mGroupIndicator == null)) {
    return;
  }
  int saveCount=0;
  final boolean clipToPadding=(mGroupFlags & CLIP_TO_PADDING_MASK) == CLIP_TO_PADDING_MASK;
  if (clipToPadding) {
    saveCount=canvas.save();
    final int scrollX=mScrollX;
    final int scrollY=mScrollY;
    canvas.clipRect(scrollX + mPaddingLeft,scrollY + mPaddingTop,scrollX + mRight - mLeft - mPaddingRight,scrollY + mBottom - mTop - mPaddingBottom);
  }
  final int headerViewsCount=getHeaderViewsCount();
  final int lastChildFlPos=mItemCount - getFooterViewsCount() - headerViewsCount- 1;
  final int myB=mBottom;
  PositionMetadata pos;
  View item;
  Drawable indicator;
  int t, b;
  int lastItemType=~(ExpandableListPosition.CHILD | ExpandableListPosition.GROUP);
  final Rect indicatorRect=mIndicatorRect;
  final int childCount=getChildCount();
  for (int i=0, childFlPos=mFirstPosition - headerViewsCount; i < childCount; i++, childFlPos++) {
    if (childFlPos < 0) {
      continue;
    }
 else     if (childFlPos > lastChildFlPos) {
      break;
    }
    item=getChildAt(i);
    t=item.getTop();
    b=item.getBottom();
    if ((b < 0) || (t > myB))     continue;
    pos=mConnector.getUnflattenedPos(childFlPos);
    final boolean isLayoutRtl=isLayoutRtl();
    final int width=getWidth();
    if (pos.position.type != lastItemType) {
      if (pos.position.type == ExpandableListPosition.CHILD) {
        indicatorRect.left=(mChildIndicatorLeft == CHILD_INDICATOR_INHERIT) ? mIndicatorLeft : mChildIndicatorLeft;
        indicatorRect.right=(mChildIndicatorRight == CHILD_INDICATOR_INHERIT) ? mIndicatorRight : mChildIndicatorRight;
      }
 else {
        indicatorRect.left=mIndicatorLeft;
        indicatorRect.right=mIndicatorRight;
      }
      if (isLayoutRtl) {
        final int temp=indicatorRect.left;
        indicatorRect.left=width - indicatorRect.right;
        indicatorRect.right=width - temp;
        indicatorRect.left-=mPaddingRight;
        indicatorRect.right-=mPaddingRight;
      }
 else {
        indicatorRect.left+=mPaddingLeft;
        indicatorRect.right+=mPaddingLeft;
      }
      lastItemType=pos.position.type;
    }
    if (indicatorRect.left != indicatorRect.right) {
      if (mStackFromBottom) {
        indicatorRect.top=t;
        indicatorRect.bottom=b;
      }
 else {
        indicatorRect.top=t;
        indicatorRect.bottom=b;
      }
      indicator=getIndicator(pos);
      if (indicator != null) {
        indicator.setBounds(indicatorRect);
        indicator.draw(canvas);
      }
    }
    pos.recycle();
  }
  if (clipToPadding) {
    canvas.restoreToCount(saveCount);
  }
}