Program: 46922
Project: 46922
Buggy source:
@Override public View getView(int position,View convertView,ViewGroup parent){
  RelativeLayout v;
  View child;
  if (convertView != null) {
    v=(RelativeLayout)convertView;
    View oldChild=v.getChildAt(0);
    child=mAdapter.getView(position,oldChild,v);
    if (child != oldChild) {
      v.removeViewAt(0);
      v.addView(child);
      v.setTag(child.findViewById(R.id.drag));
    }
  }
 else {
    AbsListView.LayoutParams params=new AbsListView.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT);
    v=new RelativeLayout(getContext());
    v.setLayoutParams(params);
    child=super.getView(position,null,v);
    v.addView(child);
    v.setTag(child.findViewById(R.id.drag));
  }
  ViewGroup.LayoutParams lp=v.getLayoutParams();
  final int numHeaders=getHeaderViewsCount();
  final int srcAdapter=mSrcDragPos - numHeaders;
  final int expAdapter=mExpDragPos - numHeaders;
  boolean itemIsNormal=position != srcAdapter && position != expAdapter;
  boolean listHasExpPos=mDragState == SRC_ABOVE || mDragState == SRC_BELOW;
  boolean itemNeedsWC=itemIsNormal || !listHasExpPos;
  int oldHeight=lp.height;
  if (itemNeedsWC && lp.height != ViewGroup.LayoutParams.WRAP_CONTENT) {
    lp.height=ViewGroup.LayoutParams.WRAP_CONTENT;
  }
 else   if (listHasExpPos) {
    if (position == srcAdapter && lp.height != mItemHeightCollapsed) {
      lp.height=mItemHeightCollapsed;
    }
 else     if (position == expAdapter) {
      int spec=MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED);
      child.measure(spec,spec);
      mExpandedChildHeight=child.getMeasuredHeight();
      int height=mExpandedChildHeight + mFloatViewHeight;
      if (lp.height != height) {
        lp.height=height;
      }
      if (mDragState == SRC_ABOVE) {
        v.setGravity(Gravity.TOP);
      }
 else {
        v.setGravity(Gravity.BOTTOM);
      }
    }
  }
  if (lp.height != oldHeight) {
    v.setLayoutParams(lp);
  }
  int oldVis=v.getVisibility();
  int vis=oldVis;
  if (position == srcAdapter && mDragState != NO_DRAG && vis == View.VISIBLE) {
    vis=View.INVISIBLE;
  }
 else   if (vis == View.INVISIBLE) {
    vis=View.VISIBLE;
  }
  if (vis != oldVis) {
    v.setVisibility(vis);
  }
  return v;
}

Fixed version (ground truth):
@Override public View getView(int position,View convertView,ViewGroup parent){
  RelativeLayout v;
  View child;
  if (convertView != null) {
    v=(RelativeLayout)convertView;
    View oldChild=v.getChildAt(0);
    child=mAdapter.getView(position,oldChild,v);
    if (child != oldChild) {
      v.removeViewAt(0);
      v.addView(child);
      v.setTag(child.findViewById(R.id.drag));
    }
  }
 else {
    AbsListView.LayoutParams params=new AbsListView.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT);
    v=new RelativeLayout(getContext());
    v.setLayoutParams(params);
    child=mAdapter.getView(position,null,v);
    v.addView(child);
    v.setTag(child.findViewById(R.id.drag));
  }
  ViewGroup.LayoutParams lp=v.getLayoutParams();
  final int numHeaders=getHeaderViewsCount();
  final int srcAdapter=mSrcDragPos - numHeaders;
  final int expAdapter=mExpDragPos - numHeaders;
  boolean itemIsNormal=position != srcAdapter && position != expAdapter;
  boolean listHasExpPos=mDragState == SRC_ABOVE || mDragState == SRC_BELOW;
  boolean itemNeedsWC=itemIsNormal || !listHasExpPos;
  int oldHeight=lp.height;
  if (itemNeedsWC && lp.height != ViewGroup.LayoutParams.WRAP_CONTENT) {
    lp.height=ViewGroup.LayoutParams.WRAP_CONTENT;
  }
 else   if (listHasExpPos) {
    if (position == srcAdapter && lp.height != mItemHeightCollapsed) {
      lp.height=mItemHeightCollapsed;
    }
 else     if (position == expAdapter) {
      int spec=MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED);
      child.measure(spec,spec);
      mExpandedChildHeight=child.getMeasuredHeight();
      int height=mExpandedChildHeight + mFloatViewHeight;
      if (lp.height != height) {
        lp.height=height;
      }
      if (mDragState == SRC_ABOVE) {
        v.setGravity(Gravity.TOP);
      }
 else {
        v.setGravity(Gravity.BOTTOM);
      }
    }
  }
  if (lp.height != oldHeight) {
    v.setLayoutParams(lp);
  }
  int oldVis=v.getVisibility();
  int vis=oldVis;
  if (position == srcAdapter && mDragState != NO_DRAG && vis == View.VISIBLE) {
    vis=View.INVISIBLE;
  }
 else   if (vis == View.INVISIBLE) {
    vis=View.VISIBLE;
  }
  if (vis != oldVis) {
    v.setVisibility(vis);
  }
  return v;
}