nus-yam/ex-repair huggingface dataset:
Program: 193462
Project: 193462
Buggy source:
boolean attachApplicationLocked(ProcessRecord proc,String processName) throws RemoteException {
  boolean didSomething=false;
  if (mPendingServices.size() > 0) {
    ServiceRecord sr=null;
    try {
      for (int i=0; i < mPendingServices.size(); i++) {
        sr=mPendingServices.get(i);
        if (proc != sr.isolatedProc && (proc.uid != sr.appInfo.uid || !processName.equals(sr.processName))) {
          continue;
        }
        mPendingServices.remove(i);
        i--;
        proc.addPackage(sr.appInfo.packageName,sr.appInfo.versionCode,mAm.mProcessStats);
        realStartServiceLocked(sr,proc,sr.createdFromFg);
        didSomething=true;
      }
    }
 catch (    RemoteException e) {
      Slog.w(TAG,"String_Node_Str" + sr.shortName,e);
      throw e;
    }
  }
  if (mRestartingServices.size() > 0) {
    ServiceRecord sr=null;
    for (int i=0; i < mRestartingServices.size(); i++) {
      sr=mRestartingServices.get(i);
      if (proc != sr.isolatedProc && (proc.uid != sr.appInfo.uid || !processName.equals(sr.processName))) {
        continue;
      }
      mAm.mHandler.removeCallbacks(sr.restarter);
      mAm.mHandler.post(sr.restarter);
    }
  }
  return didSomething;
}

Fixed version (ground truth):
boolean attachApplicationLocked(ProcessRecord proc,String processName) throws RemoteException {
  boolean didSomething=false;
  if (mPendingServices.size() > 0) {
    ServiceRecord sr=null;
    try {
      for (int i=0; i < mPendingServices.size(); i++) {
        sr=mPendingServices.get(i);
        if (proc != sr.isolatedProc && (proc.uid != sr.appInfo.uid || !processName.equals(sr.processName))) {
          continue;
        }
        mPendingServices.remove(i);
        i--;
        proc.addPackage(sr.appInfo.packageName,sr.appInfo.versionCode,mAm.mProcessStats);
        realStartServiceLocked(sr,proc,sr.createdFromFg);
        didSomething=true;
        if (!isServiceNeeded(sr,false,false)) {
          bringDownServiceLocked(sr);
        }
      }
    }
 catch (    RemoteException e) {
      Slog.w(TAG,"String_Node_Str" + sr.shortName,e);
      throw e;
    }
  }
  if (mRestartingServices.size() > 0) {
    ServiceRecord sr;
    for (int i=0; i < mRestartingServices.size(); i++) {
      sr=mRestartingServices.get(i);
      if (proc != sr.isolatedProc && (proc.uid != sr.appInfo.uid || !processName.equals(sr.processName))) {
        continue;
      }
      mAm.mHandler.removeCallbacks(sr.restarter);
      mAm.mHandler.post(sr.restarter);
    }
  }
  return didSomething;
}
Program: 193463
Project: 193463
Buggy source:
final void performServiceRestartLocked(ServiceRecord r){
  if (!mRestartingServices.contains(r)) {
    return;
  }
  try {
    bringUpServiceLocked(r,r.intent.getIntent().getFlags(),r.createdFromFg,true);
  }
 catch (  TransactionTooLargeException e) {
  }
}

Fixed version (ground truth):
final void performServiceRestartLocked(ServiceRecord r){
  if (!mRestartingServices.contains(r)) {
    return;
  }
  if (!isServiceNeeded(r,false,false)) {
    Slog.wtf(TAG,"String_Node_Str" + r);
    return;
  }
  try {
    bringUpServiceLocked(r,r.intent.getIntent().getFlags(),r.createdFromFg,true);
  }
 catch (  TransactionTooLargeException e) {
  }
}
Program: 193479
Project: 193479
Buggy source:
@Override public void onClick(View v){
  startSelected(holder.itemIndex,false,true);
}

Fixed version (ground truth):
@Override public void onClick(View v){
  startSelected(holder.itemIndices[column],false,true);
}
Program: 193480
Project: 193480
Buggy source:
RowViewHolder createViewHolder(ViewGroup parent){
  final ViewGroup row=(ViewGroup)mLayoutInflater.inflate(R.layout.chooser_row,parent,false);
  final RowViewHolder holder=new RowViewHolder(row,mColumnCount);
  final int spec=MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED);
  for (int i=0; i < mColumnCount; i++) {
    final View v=mChooserListAdapter.createView(row);
    v.setOnClickListener(new OnClickListener(){
      @Override public void onClick(      View v){
        startSelected(holder.itemIndex,false,true);
      }
    }
);
    v.setOnLongClickListener(new OnLongClickListener(){
      @Override public boolean onLongClick(      View v){
        showAppDetails(mChooserListAdapter.resolveInfoForPosition(holder.itemIndex,true));
        return true;
      }
    }
);
    row.addView(v);
    holder.cells[i]=v;
    LayoutParams lp=v.getLayoutParams();
    v.measure(spec,spec);
    if (lp == null) {
      lp=new LayoutParams(LayoutParams.MATCH_PARENT,v.getMeasuredHeight());
      row.setLayoutParams(lp);
    }
 else {
      lp.height=v.getMeasuredHeight();
    }
  }
  holder.measure();
  LayoutParams lp=row.getLayoutParams();
  if (lp == null) {
    lp=new LayoutParams(LayoutParams.MATCH_PARENT,holder.measuredRowHeight);
    row.setLayoutParams(lp);
  }
 else {
    lp.height=holder.measuredRowHeight;
  }
  row.setTag(holder);
  return holder;
}

Fixed version (ground truth):
RowViewHolder createViewHolder(ViewGroup parent){
  final ViewGroup row=(ViewGroup)mLayoutInflater.inflate(R.layout.chooser_row,parent,false);
  final RowViewHolder holder=new RowViewHolder(row,mColumnCount);
  final int spec=MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED);
  for (int i=0; i < mColumnCount; i++) {
    final View v=mChooserListAdapter.createView(row);
    final int column=i;
    v.setOnClickListener(new OnClickListener(){
      @Override public void onClick(      View v){
        startSelected(holder.itemIndices[column],false,true);
      }
    }
);
    v.setOnLongClickListener(new OnLongClickListener(){
      @Override public boolean onLongClick(      View v){
        showAppDetails(mChooserListAdapter.resolveInfoForPosition(holder.itemIndices[column],true));
        return true;
      }
    }
);
    row.addView(v);
    holder.cells[i]=v;
    LayoutParams lp=v.getLayoutParams();
    v.measure(spec,spec);
    if (lp == null) {
      lp=new LayoutParams(LayoutParams.MATCH_PARENT,v.getMeasuredHeight());
      row.setLayoutParams(lp);
    }
 else {
      lp.height=v.getMeasuredHeight();
    }
  }
  holder.measure();
  LayoutParams lp=row.getLayoutParams();
  if (lp == null) {
    lp=new LayoutParams(LayoutParams.MATCH_PARENT,holder.measuredRowHeight);
    row.setLayoutParams(lp);
  }
 else {
    lp.height=holder.measuredRowHeight;
  }
  row.setTag(holder);
  return holder;
}
Program: 193481
Project: 193481
Buggy source:
public RowViewHolder(ViewGroup row,int cellCount){
  this.row=row;
  this.cells=new View[cellCount];
}

Fixed version (ground truth):
public RowViewHolder(ViewGroup row,int cellCount){
  this.row=row;
  this.cells=new View[cellCount];
  this.itemIndices=new int[cellCount];
}
Program: 193482
Project: 193482
Buggy source:
public ChooserRowAdapter(ChooserListAdapter wrappedAdapter){
  mChooserListAdapter=wrappedAdapter;
  mLayoutInflater=LayoutInflater.from(ChooserActivity.this);
  mInterpolator=AnimationUtils.loadInterpolator(ChooserActivity.this,android.R.interpolator.decelerate_quint);
  wrappedAdapter.registerDataSetObserver(new DataSetObserver(){
    @Override public void onChanged(){
      super.onChanged();
      final int rcount=getServiceTargetRowCount();
      if (mServiceTargetScale == null || mServiceTargetScale.length != rcount) {
        RowScale[] old=mServiceTargetScale;
        int oldRCount=old != null ? old.length : 0;
        mServiceTargetScale=new RowScale[rcount];
        if (old != null && rcount > 0) {
          System.arraycopy(old,0,mServiceTargetScale,0,Math.min(old.length,rcount));
        }
        for (int i=rcount; i < oldRCount; i++) {
          old[i].cancelAnimation();
        }
        for (int i=oldRCount; i < rcount; i++) {
          final RowScale rs=new RowScale(ChooserRowAdapter.this,0.f,1.f).setInterpolator(mInterpolator);
          mServiceTargetScale[i]=rs;
          rs.startAnimation();
        }
      }
      notifyDataSetChanged();
    }
    @Override public void onInvalidated(){
      super.onInvalidated();
      notifyDataSetInvalidated();
      if (mServiceTargetScale != null) {
        for (        RowScale rs : mServiceTargetScale) {
          rs.cancelAnimation();
        }
      }
    }
  }
);
}

Fixed version (ground truth):
public ChooserRowAdapter(ChooserListAdapter wrappedAdapter){
  mChooserListAdapter=wrappedAdapter;
  mLayoutInflater=LayoutInflater.from(ChooserActivity.this);
  mInterpolator=AnimationUtils.loadInterpolator(ChooserActivity.this,android.R.interpolator.decelerate_quint);
  wrappedAdapter.registerDataSetObserver(new DataSetObserver(){
    @Override public void onChanged(){
      super.onChanged();
      final int rcount=getServiceTargetRowCount();
      if (mServiceTargetScale == null || mServiceTargetScale.length != rcount) {
        RowScale[] old=mServiceTargetScale;
        int oldRCount=old != null ? old.length : 0;
        mServiceTargetScale=new RowScale[rcount];
        if (old != null && rcount > 0) {
          System.arraycopy(old,0,mServiceTargetScale,0,Math.min(old.length,rcount));
        }
        for (int i=rcount; i < oldRCount; i++) {
          old[i].cancelAnimation();
        }
        for (int i=oldRCount; i < rcount; i++) {
          final RowScale rs=new RowScale(ChooserRowAdapter.this,0.f,1.f).setInterpolator(mInterpolator);
          mServiceTargetScale[i]=rs;
        }
        for (int i=oldRCount; i < rcount; i++) {
          mServiceTargetScale[i].startAnimation();
        }
      }
      notifyDataSetChanged();
    }
    @Override public void onInvalidated(){
      super.onInvalidated();
      notifyDataSetInvalidated();
      if (mServiceTargetScale != null) {
        for (        RowScale rs : mServiceTargetScale) {
          rs.cancelAnimation();
        }
      }
    }
  }
);
}
Program: 193483
Project: 193483
Buggy source:
void bindViewHolder(int rowPosition,RowViewHolder holder){
  final int start=getFirstRowPosition(rowPosition);
  final int startType=mChooserListAdapter.getPositionTargetType(start);
  int end=start + mColumnCount - 1;
  while (mChooserListAdapter.getPositionTargetType(end) != startType && end >= start) {
    end--;
  }
  if (startType == ChooserListAdapter.TARGET_SERVICE) {
    holder.row.setBackgroundColor(getColor(R.color.chooser_service_row_background_color));
  }
 else {
    holder.row.setBackgroundColor(Color.TRANSPARENT);
  }
  final int oldHeight=holder.row.getLayoutParams().height;
  holder.row.getLayoutParams().height=Math.max(1,(int)(holder.measuredRowHeight * getRowScale(rowPosition)));
  if (holder.row.getLayoutParams().height != oldHeight) {
    holder.row.requestLayout();
  }
  for (int i=0; i < mColumnCount; i++) {
    final View v=holder.cells[i];
    if (start + i <= end) {
      v.setVisibility(View.VISIBLE);
      holder.itemIndex=start + i;
      mChooserListAdapter.bindView(holder.itemIndex,v);
    }
 else {
      v.setVisibility(View.GONE);
    }
  }
}

Fixed version (ground truth):
void bindViewHolder(int rowPosition,RowViewHolder holder){
  final int start=getFirstRowPosition(rowPosition);
  final int startType=mChooserListAdapter.getPositionTargetType(start);
  int end=start + mColumnCount - 1;
  while (mChooserListAdapter.getPositionTargetType(end) != startType && end >= start) {
    end--;
  }
  if (startType == ChooserListAdapter.TARGET_SERVICE) {
    holder.row.setBackgroundColor(getColor(R.color.chooser_service_row_background_color));
  }
 else {
    holder.row.setBackgroundColor(Color.TRANSPARENT);
  }
  final int oldHeight=holder.row.getLayoutParams().height;
  holder.row.getLayoutParams().height=Math.max(1,(int)(holder.measuredRowHeight * getRowScale(rowPosition)));
  if (holder.row.getLayoutParams().height != oldHeight) {
    holder.row.requestLayout();
  }
  for (int i=0; i < mColumnCount; i++) {
    final View v=holder.cells[i];
    if (start + i <= end) {
      v.setVisibility(View.VISIBLE);
      holder.itemIndices[i]=start + i;
      mChooserListAdapter.bindView(holder.itemIndices[i],v);
    }
 else {
      v.setVisibility(View.GONE);
    }
  }
}
Program: 193484
Project: 193484
Buggy source:
@Override public void onChanged(){
  if (mResolverDrawerLayout == null) {
    return;
  }
  final int chooserTargetRows=mChooserRowAdapter.getServiceTargetRowCount();
  int offset=0;
  for (int i=0; i < chooserTargetRows; i++) {
    final int pos=mChooserRowAdapter.getCallerTargetRowCount() + i;
    final int vt=mChooserRowAdapter.getItemViewType(pos);
    if (vt != mCachedViewType) {
      mCachedView=null;
    }
    final View v=mChooserRowAdapter.getView(pos,mCachedView,mListView);
    int height=((RowViewHolder)(v.getTag())).measuredRowHeight;
    offset+=(int)(height * mChooserRowAdapter.getRowScale(pos) * chooserTargetRows);
    if (vt >= 0) {
      mCachedViewType=vt;
      mCachedView=v;
    }
 else {
      mCachedViewType=-1;
    }
  }
  mResolverDrawerLayout.setCollapsibleHeightReserved(offset);
}

Fixed version (ground truth):
@Override public void onChanged(){
  if (mResolverDrawerLayout == null) {
    return;
  }
  final int chooserTargetRows=mChooserRowAdapter.getServiceTargetRowCount();
  int offset=0;
  for (int i=0; i < chooserTargetRows; i++) {
    final int pos=mChooserRowAdapter.getCallerTargetRowCount() + i;
    final int vt=mChooserRowAdapter.getItemViewType(pos);
    if (vt != mCachedViewType) {
      mCachedView=null;
    }
    final View v=mChooserRowAdapter.getView(pos,mCachedView,mListView);
    int height=((RowViewHolder)(v.getTag())).measuredRowHeight;
    offset+=(int)(height * mChooserRowAdapter.getRowScale(pos));
    if (vt >= 0) {
      mCachedViewType=vt;
      mCachedView=v;
    }
 else {
      mCachedViewType=-1;
    }
  }
  mResolverDrawerLayout.setCollapsibleHeightReserved(offset);
}
Program: 193485
Project: 193485
Buggy source:
@Override public boolean onLongClick(View v){
  showAppDetails(mChooserListAdapter.resolveInfoForPosition(holder.itemIndex,true));
  return true;
}

Fixed version (ground truth):
@Override public boolean onLongClick(View v){
  showAppDetails(mChooserListAdapter.resolveInfoForPosition(holder.itemIndices[column],true));
  return true;
}
Program: 193486
Project: 193486
Buggy source:
@Override public void onClick(View v){
  startSelected(holder.itemIndex,false,true);
}

Fixed version (ground truth):
@Override public void onClick(View v){
  startSelected(holder.itemIndices[column],false,true);
}
Program: 193487
Project: 193487
Buggy source:
RowViewHolder createViewHolder(ViewGroup parent){
  final ViewGroup row=(ViewGroup)mLayoutInflater.inflate(R.layout.chooser_row,parent,false);
  final RowViewHolder holder=new RowViewHolder(row,mColumnCount);
  final int spec=MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED);
  for (int i=0; i < mColumnCount; i++) {
    final View v=mChooserListAdapter.createView(row);
    v.setOnClickListener(new OnClickListener(){
      @Override public void onClick(      View v){
        startSelected(holder.itemIndex,false,true);
      }
    }
);
    v.setOnLongClickListener(new OnLongClickListener(){
      @Override public boolean onLongClick(      View v){
        showAppDetails(mChooserListAdapter.resolveInfoForPosition(holder.itemIndex,true));
        return true;
      }
    }
);
    row.addView(v);
    holder.cells[i]=v;
    LayoutParams lp=v.getLayoutParams();
    v.measure(spec,spec);
    if (lp == null) {
      lp=new LayoutParams(LayoutParams.MATCH_PARENT,v.getMeasuredHeight());
      row.setLayoutParams(lp);
    }
 else {
      lp.height=v.getMeasuredHeight();
    }
  }
  holder.measure();
  LayoutParams lp=row.getLayoutParams();
  if (lp == null) {
    lp=new LayoutParams(LayoutParams.MATCH_PARENT,holder.measuredRowHeight);
    row.setLayoutParams(lp);
  }
 else {
    lp.height=holder.measuredRowHeight;
  }
  row.setTag(holder);
  return holder;
}

Fixed version (ground truth):
RowViewHolder createViewHolder(ViewGroup parent){
  final ViewGroup row=(ViewGroup)mLayoutInflater.inflate(R.layout.chooser_row,parent,false);
  final RowViewHolder holder=new RowViewHolder(row,mColumnCount);
  final int spec=MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED);
  for (int i=0; i < mColumnCount; i++) {
    final View v=mChooserListAdapter.createView(row);
    final int column=i;
    v.setOnClickListener(new OnClickListener(){
      @Override public void onClick(      View v){
        startSelected(holder.itemIndices[column],false,true);
      }
    }
);
    v.setOnLongClickListener(new OnLongClickListener(){
      @Override public boolean onLongClick(      View v){
        showAppDetails(mChooserListAdapter.resolveInfoForPosition(holder.itemIndices[column],true));
        return true;
      }
    }
);
    row.addView(v);
    holder.cells[i]=v;
    LayoutParams lp=v.getLayoutParams();
    v.measure(spec,spec);
    if (lp == null) {
      lp=new LayoutParams(LayoutParams.MATCH_PARENT,v.getMeasuredHeight());
      row.setLayoutParams(lp);
    }
 else {
      lp.height=v.getMeasuredHeight();
    }
  }
  holder.measure();
  LayoutParams lp=row.getLayoutParams();
  if (lp == null) {
    lp=new LayoutParams(LayoutParams.MATCH_PARENT,holder.measuredRowHeight);
    row.setLayoutParams(lp);
  }
 else {
    lp.height=holder.measuredRowHeight;
  }
  row.setTag(holder);
  return holder;
}
Program: 193488
Project: 193488
Buggy source:
public RowViewHolder(ViewGroup row,int cellCount){
  this.row=row;
  this.cells=new View[cellCount];
}

Fixed version (ground truth):
public RowViewHolder(ViewGroup row,int cellCount){
  this.row=row;
  this.cells=new View[cellCount];
  this.itemIndices=new int[cellCount];
}
Program: 193489
Project: 193489
Buggy source:
public ChooserRowAdapter(ChooserListAdapter wrappedAdapter){
  mChooserListAdapter=wrappedAdapter;
  mLayoutInflater=LayoutInflater.from(ChooserActivity.this);
  mInterpolator=AnimationUtils.loadInterpolator(ChooserActivity.this,android.R.interpolator.decelerate_quint);
  wrappedAdapter.registerDataSetObserver(new DataSetObserver(){
    @Override public void onChanged(){
      super.onChanged();
      final int rcount=getServiceTargetRowCount();
      if (mServiceTargetScale == null || mServiceTargetScale.length != rcount) {
        RowScale[] old=mServiceTargetScale;
        int oldRCount=old != null ? old.length : 0;
        mServiceTargetScale=new RowScale[rcount];
        if (old != null && rcount > 0) {
          System.arraycopy(old,0,mServiceTargetScale,0,Math.min(old.length,rcount));
        }
        for (int i=rcount; i < oldRCount; i++) {
          old[i].cancelAnimation();
        }
        for (int i=oldRCount; i < rcount; i++) {
          final RowScale rs=new RowScale(ChooserRowAdapter.this,0.f,1.f).setInterpolator(mInterpolator);
          mServiceTargetScale[i]=rs;
          rs.startAnimation();
        }
      }
      notifyDataSetChanged();
    }
    @Override public void onInvalidated(){
      super.onInvalidated();
      notifyDataSetInvalidated();
      if (mServiceTargetScale != null) {
        for (        RowScale rs : mServiceTargetScale) {
          rs.cancelAnimation();
        }
      }
    }
  }
);
}

Fixed version (ground truth):
public ChooserRowAdapter(ChooserListAdapter wrappedAdapter){
  mChooserListAdapter=wrappedAdapter;
  mLayoutInflater=LayoutInflater.from(ChooserActivity.this);
  mInterpolator=AnimationUtils.loadInterpolator(ChooserActivity.this,android.R.interpolator.decelerate_quint);
  wrappedAdapter.registerDataSetObserver(new DataSetObserver(){
    @Override public void onChanged(){
      super.onChanged();
      final int rcount=getServiceTargetRowCount();
      if (mServiceTargetScale == null || mServiceTargetScale.length != rcount) {
        RowScale[] old=mServiceTargetScale;
        int oldRCount=old != null ? old.length : 0;
        mServiceTargetScale=new RowScale[rcount];
        if (old != null && rcount > 0) {
          System.arraycopy(old,0,mServiceTargetScale,0,Math.min(old.length,rcount));
        }
        for (int i=rcount; i < oldRCount; i++) {
          old[i].cancelAnimation();
        }
        for (int i=oldRCount; i < rcount; i++) {
          final RowScale rs=new RowScale(ChooserRowAdapter.this,0.f,1.f).setInterpolator(mInterpolator);
          mServiceTargetScale[i]=rs;
        }
        for (int i=oldRCount; i < rcount; i++) {
          mServiceTargetScale[i].startAnimation();
        }
      }
      notifyDataSetChanged();
    }
    @Override public void onInvalidated(){
      super.onInvalidated();
      notifyDataSetInvalidated();
      if (mServiceTargetScale != null) {
        for (        RowScale rs : mServiceTargetScale) {
          rs.cancelAnimation();
        }
      }
    }
  }
);
}
Program: 193490
Project: 193490
Buggy source:
void bindViewHolder(int rowPosition,RowViewHolder holder){
  final int start=getFirstRowPosition(rowPosition);
  final int startType=mChooserListAdapter.getPositionTargetType(start);
  int end=start + mColumnCount - 1;
  while (mChooserListAdapter.getPositionTargetType(end) != startType && end >= start) {
    end--;
  }
  if (startType == ChooserListAdapter.TARGET_SERVICE) {
    holder.row.setBackgroundColor(getColor(R.color.chooser_service_row_background_color));
  }
 else {
    holder.row.setBackgroundColor(Color.TRANSPARENT);
  }
  final int oldHeight=holder.row.getLayoutParams().height;
  holder.row.getLayoutParams().height=Math.max(1,(int)(holder.measuredRowHeight * getRowScale(rowPosition)));
  if (holder.row.getLayoutParams().height != oldHeight) {
    holder.row.requestLayout();
  }
  for (int i=0; i < mColumnCount; i++) {
    final View v=holder.cells[i];
    if (start + i <= end) {
      v.setVisibility(View.VISIBLE);
      holder.itemIndex=start + i;
      mChooserListAdapter.bindView(holder.itemIndex,v);
    }
 else {
      v.setVisibility(View.GONE);
    }
  }
}

Fixed version (ground truth):
void bindViewHolder(int rowPosition,RowViewHolder holder){
  final int start=getFirstRowPosition(rowPosition);
  final int startType=mChooserListAdapter.getPositionTargetType(start);
  int end=start + mColumnCount - 1;
  while (mChooserListAdapter.getPositionTargetType(end) != startType && end >= start) {
    end--;
  }
  if (startType == ChooserListAdapter.TARGET_SERVICE) {
    holder.row.setBackgroundColor(getColor(R.color.chooser_service_row_background_color));
  }
 else {
    holder.row.setBackgroundColor(Color.TRANSPARENT);
  }
  final int oldHeight=holder.row.getLayoutParams().height;
  holder.row.getLayoutParams().height=Math.max(1,(int)(holder.measuredRowHeight * getRowScale(rowPosition)));
  if (holder.row.getLayoutParams().height != oldHeight) {
    holder.row.requestLayout();
  }
  for (int i=0; i < mColumnCount; i++) {
    final View v=holder.cells[i];
    if (start + i <= end) {
      v.setVisibility(View.VISIBLE);
      holder.itemIndices[i]=start + i;
      mChooserListAdapter.bindView(holder.itemIndices[i],v);
    }
 else {
      v.setVisibility(View.GONE);
    }
  }
}
Program: 193491
Project: 193491
Buggy source:
@Override public void onChanged(){
  if (mResolverDrawerLayout == null) {
    return;
  }
  final int chooserTargetRows=mChooserRowAdapter.getServiceTargetRowCount();
  int offset=0;
  for (int i=0; i < chooserTargetRows; i++) {
    final int pos=mChooserRowAdapter.getCallerTargetRowCount() + i;
    final int vt=mChooserRowAdapter.getItemViewType(pos);
    if (vt != mCachedViewType) {
      mCachedView=null;
    }
    final View v=mChooserRowAdapter.getView(pos,mCachedView,mListView);
    int height=((RowViewHolder)(v.getTag())).measuredRowHeight;
    offset+=(int)(height * mChooserRowAdapter.getRowScale(pos) * chooserTargetRows);
    if (vt >= 0) {
      mCachedViewType=vt;
      mCachedView=v;
    }
 else {
      mCachedViewType=-1;
    }
  }
  mResolverDrawerLayout.setCollapsibleHeightReserved(offset);
}

Fixed version (ground truth):
@Override public void onChanged(){
  if (mResolverDrawerLayout == null) {
    return;
  }
  final int chooserTargetRows=mChooserRowAdapter.getServiceTargetRowCount();
  int offset=0;
  for (int i=0; i < chooserTargetRows; i++) {
    final int pos=mChooserRowAdapter.getCallerTargetRowCount() + i;
    final int vt=mChooserRowAdapter.getItemViewType(pos);
    if (vt != mCachedViewType) {
      mCachedView=null;
    }
    final View v=mChooserRowAdapter.getView(pos,mCachedView,mListView);
    int height=((RowViewHolder)(v.getTag())).measuredRowHeight;
    offset+=(int)(height * mChooserRowAdapter.getRowScale(pos));
    if (vt >= 0) {
      mCachedViewType=vt;
      mCachedView=v;
    }
 else {
      mCachedViewType=-1;
    }
  }
  mResolverDrawerLayout.setCollapsibleHeightReserved(offset);
}
Program: 193492
Project: 193492
Buggy source:
@Override public boolean onLongClick(View v){
  showAppDetails(mChooserListAdapter.resolveInfoForPosition(holder.itemIndex,true));
  return true;
}

Fixed version (ground truth):
@Override public boolean onLongClick(View v){
  showAppDetails(mChooserListAdapter.resolveInfoForPosition(holder.itemIndices[column],true));
  return true;
}
Program: 193493
Project: 193493
Buggy source:
@Override public void onClick(View v){
  startSelected(holder.itemIndex,false,true);
}

Fixed version (ground truth):
@Override public void onClick(View v){
  startSelected(holder.itemIndices[column],false,true);
}
Program: 193494
Project: 193494
Buggy source:
RowViewHolder createViewHolder(ViewGroup parent){
  final ViewGroup row=(ViewGroup)mLayoutInflater.inflate(R.layout.chooser_row,parent,false);
  final RowViewHolder holder=new RowViewHolder(row,mColumnCount);
  final int spec=MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED);
  for (int i=0; i < mColumnCount; i++) {
    final View v=mChooserListAdapter.createView(row);
    v.setOnClickListener(new OnClickListener(){
      @Override public void onClick(      View v){
        startSelected(holder.itemIndex,false,true);
      }
    }
);
    v.setOnLongClickListener(new OnLongClickListener(){
      @Override public boolean onLongClick(      View v){
        showAppDetails(mChooserListAdapter.resolveInfoForPosition(holder.itemIndex,true));
        return true;
      }
    }
);
    row.addView(v);
    holder.cells[i]=v;
    LayoutParams lp=v.getLayoutParams();
    v.measure(spec,spec);
    if (lp == null) {
      lp=new LayoutParams(LayoutParams.MATCH_PARENT,v.getMeasuredHeight());
      row.setLayoutParams(lp);
    }
 else {
      lp.height=v.getMeasuredHeight();
    }
  }
  holder.measure();
  LayoutParams lp=row.getLayoutParams();
  if (lp == null) {
    lp=new LayoutParams(LayoutParams.MATCH_PARENT,holder.measuredRowHeight);
    row.setLayoutParams(lp);
  }
 else {
    lp.height=holder.measuredRowHeight;
  }
  row.setTag(holder);
  return holder;
}

Fixed version (ground truth):
RowViewHolder createViewHolder(ViewGroup parent){
  final ViewGroup row=(ViewGroup)mLayoutInflater.inflate(R.layout.chooser_row,parent,false);
  final RowViewHolder holder=new RowViewHolder(row,mColumnCount);
  final int spec=MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED);
  for (int i=0; i < mColumnCount; i++) {
    final View v=mChooserListAdapter.createView(row);
    final int column=i;
    v.setOnClickListener(new OnClickListener(){
      @Override public void onClick(      View v){
        startSelected(holder.itemIndices[column],false,true);
      }
    }
);
    v.setOnLongClickListener(new OnLongClickListener(){
      @Override public boolean onLongClick(      View v){
        showAppDetails(mChooserListAdapter.resolveInfoForPosition(holder.itemIndices[column],true));
        return true;
      }
    }
);
    row.addView(v);
    holder.cells[i]=v;
    LayoutParams lp=v.getLayoutParams();
    v.measure(spec,spec);
    if (lp == null) {
      lp=new LayoutParams(LayoutParams.MATCH_PARENT,v.getMeasuredHeight());
      row.setLayoutParams(lp);
    }
 else {
      lp.height=v.getMeasuredHeight();
    }
  }
  holder.measure();
  LayoutParams lp=row.getLayoutParams();
  if (lp == null) {
    lp=new LayoutParams(LayoutParams.MATCH_PARENT,holder.measuredRowHeight);
    row.setLayoutParams(lp);
  }
 else {
    lp.height=holder.measuredRowHeight;
  }
  row.setTag(holder);
  return holder;
}
Program: 193495
Project: 193495
Buggy source:
public RowViewHolder(ViewGroup row,int cellCount){
  this.row=row;
  this.cells=new View[cellCount];
}

Fixed version (ground truth):
public RowViewHolder(ViewGroup row,int cellCount){
  this.row=row;
  this.cells=new View[cellCount];
  this.itemIndices=new int[cellCount];
}
Program: 193496
Project: 193496
Buggy source:
public ChooserRowAdapter(ChooserListAdapter wrappedAdapter){
  mChooserListAdapter=wrappedAdapter;
  mLayoutInflater=LayoutInflater.from(ChooserActivity.this);
  mInterpolator=AnimationUtils.loadInterpolator(ChooserActivity.this,android.R.interpolator.decelerate_quint);
  wrappedAdapter.registerDataSetObserver(new DataSetObserver(){
    @Override public void onChanged(){
      super.onChanged();
      final int rcount=getServiceTargetRowCount();
      if (mServiceTargetScale == null || mServiceTargetScale.length != rcount) {
        RowScale[] old=mServiceTargetScale;
        int oldRCount=old != null ? old.length : 0;
        mServiceTargetScale=new RowScale[rcount];
        if (old != null && rcount > 0) {
          System.arraycopy(old,0,mServiceTargetScale,0,Math.min(old.length,rcount));
        }
        for (int i=rcount; i < oldRCount; i++) {
          old[i].cancelAnimation();
        }
        for (int i=oldRCount; i < rcount; i++) {
          final RowScale rs=new RowScale(ChooserRowAdapter.this,0.f,1.f).setInterpolator(mInterpolator);
          mServiceTargetScale[i]=rs;
          rs.startAnimation();
        }
      }
      notifyDataSetChanged();
    }
    @Override public void onInvalidated(){
      super.onInvalidated();
      notifyDataSetInvalidated();
      if (mServiceTargetScale != null) {
        for (        RowScale rs : mServiceTargetScale) {
          rs.cancelAnimation();
        }
      }
    }
  }
);
}

Fixed version (ground truth):
public ChooserRowAdapter(ChooserListAdapter wrappedAdapter){
  mChooserListAdapter=wrappedAdapter;
  mLayoutInflater=LayoutInflater.from(ChooserActivity.this);
  mInterpolator=AnimationUtils.loadInterpolator(ChooserActivity.this,android.R.interpolator.decelerate_quint);
  wrappedAdapter.registerDataSetObserver(new DataSetObserver(){
    @Override public void onChanged(){
      super.onChanged();
      final int rcount=getServiceTargetRowCount();
      if (mServiceTargetScale == null || mServiceTargetScale.length != rcount) {
        RowScale[] old=mServiceTargetScale;
        int oldRCount=old != null ? old.length : 0;
        mServiceTargetScale=new RowScale[rcount];
        if (old != null && rcount > 0) {
          System.arraycopy(old,0,mServiceTargetScale,0,Math.min(old.length,rcount));
        }
        for (int i=rcount; i < oldRCount; i++) {
          old[i].cancelAnimation();
        }
        for (int i=oldRCount; i < rcount; i++) {
          final RowScale rs=new RowScale(ChooserRowAdapter.this,0.f,1.f).setInterpolator(mInterpolator);
          mServiceTargetScale[i]=rs;
        }
        for (int i=oldRCount; i < rcount; i++) {
          mServiceTargetScale[i].startAnimation();
        }
      }
      notifyDataSetChanged();
    }
    @Override public void onInvalidated(){
      super.onInvalidated();
      notifyDataSetInvalidated();
      if (mServiceTargetScale != null) {
        for (        RowScale rs : mServiceTargetScale) {
          rs.cancelAnimation();
        }
      }
    }
  }
);
}
Program: 193497
Project: 193497
Buggy source:
void bindViewHolder(int rowPosition,RowViewHolder holder){
  final int start=getFirstRowPosition(rowPosition);
  final int startType=mChooserListAdapter.getPositionTargetType(start);
  int end=start + mColumnCount - 1;
  while (mChooserListAdapter.getPositionTargetType(end) != startType && end >= start) {
    end--;
  }
  if (startType == ChooserListAdapter.TARGET_SERVICE) {
    holder.row.setBackgroundColor(getColor(R.color.chooser_service_row_background_color));
  }
 else {
    holder.row.setBackgroundColor(Color.TRANSPARENT);
  }
  final int oldHeight=holder.row.getLayoutParams().height;
  holder.row.getLayoutParams().height=Math.max(1,(int)(holder.measuredRowHeight * getRowScale(rowPosition)));
  if (holder.row.getLayoutParams().height != oldHeight) {
    holder.row.requestLayout();
  }
  for (int i=0; i < mColumnCount; i++) {
    final View v=holder.cells[i];
    if (start + i <= end) {
      v.setVisibility(View.VISIBLE);
      holder.itemIndex=start + i;
      mChooserListAdapter.bindView(holder.itemIndex,v);
    }
 else {
      v.setVisibility(View.GONE);
    }
  }
}

Fixed version (ground truth):
void bindViewHolder(int rowPosition,RowViewHolder holder){
  final int start=getFirstRowPosition(rowPosition);
  final int startType=mChooserListAdapter.getPositionTargetType(start);
  int end=start + mColumnCount - 1;
  while (mChooserListAdapter.getPositionTargetType(end) != startType && end >= start) {
    end--;
  }
  if (startType == ChooserListAdapter.TARGET_SERVICE) {
    holder.row.setBackgroundColor(getColor(R.color.chooser_service_row_background_color));
  }
 else {
    holder.row.setBackgroundColor(Color.TRANSPARENT);
  }
  final int oldHeight=holder.row.getLayoutParams().height;
  holder.row.getLayoutParams().height=Math.max(1,(int)(holder.measuredRowHeight * getRowScale(rowPosition)));
  if (holder.row.getLayoutParams().height != oldHeight) {
    holder.row.requestLayout();
  }
  for (int i=0; i < mColumnCount; i++) {
    final View v=holder.cells[i];
    if (start + i <= end) {
      v.setVisibility(View.VISIBLE);
      holder.itemIndices[i]=start + i;
      mChooserListAdapter.bindView(holder.itemIndices[i],v);
    }
 else {
      v.setVisibility(View.GONE);
    }
  }
}
Program: 193498
Project: 193498
Buggy source:
@Override public void onChanged(){
  if (mResolverDrawerLayout == null) {
    return;
  }
  final int chooserTargetRows=mChooserRowAdapter.getServiceTargetRowCount();
  int offset=0;
  for (int i=0; i < chooserTargetRows; i++) {
    final int pos=mChooserRowAdapter.getCallerTargetRowCount() + i;
    final int vt=mChooserRowAdapter.getItemViewType(pos);
    if (vt != mCachedViewType) {
      mCachedView=null;
    }
    final View v=mChooserRowAdapter.getView(pos,mCachedView,mListView);
    int height=((RowViewHolder)(v.getTag())).measuredRowHeight;
    offset+=(int)(height * mChooserRowAdapter.getRowScale(pos) * chooserTargetRows);
    if (vt >= 0) {
      mCachedViewType=vt;
      mCachedView=v;
    }
 else {
      mCachedViewType=-1;
    }
  }
  mResolverDrawerLayout.setCollapsibleHeightReserved(offset);
}

Fixed version (ground truth):
@Override public void onChanged(){
  if (mResolverDrawerLayout == null) {
    return;
  }
  final int chooserTargetRows=mChooserRowAdapter.getServiceTargetRowCount();
  int offset=0;
  for (int i=0; i < chooserTargetRows; i++) {
    final int pos=mChooserRowAdapter.getCallerTargetRowCount() + i;
    final int vt=mChooserRowAdapter.getItemViewType(pos);
    if (vt != mCachedViewType) {
      mCachedView=null;
    }
    final View v=mChooserRowAdapter.getView(pos,mCachedView,mListView);
    int height=((RowViewHolder)(v.getTag())).measuredRowHeight;
    offset+=(int)(height * mChooserRowAdapter.getRowScale(pos));
    if (vt >= 0) {
      mCachedViewType=vt;
      mCachedView=v;
    }
 else {
      mCachedViewType=-1;
    }
  }
  mResolverDrawerLayout.setCollapsibleHeightReserved(offset);
}
Program: 193499
Project: 193499
Buggy source:
@Override public boolean onLongClick(View v){
  showAppDetails(mChooserListAdapter.resolveInfoForPosition(holder.itemIndex,true));
  return true;
}

Fixed version (ground truth):
@Override public boolean onLongClick(View v){
  showAppDetails(mChooserListAdapter.resolveInfoForPosition(holder.itemIndices[column],true));
  return true;
}
Program: 193500
Project: 193500
Buggy source:
@Override public void onClick(View v){
  startSelected(holder.itemIndex,false,true);
}

Fixed version (ground truth):
@Override public void onClick(View v){
  startSelected(holder.itemIndices[column],false,true);
}
Program: 193501
Project: 193501
Buggy source:
RowViewHolder createViewHolder(ViewGroup parent){
  final ViewGroup row=(ViewGroup)mLayoutInflater.inflate(R.layout.chooser_row,parent,false);
  final RowViewHolder holder=new RowViewHolder(row,mColumnCount);
  final int spec=MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED);
  for (int i=0; i < mColumnCount; i++) {
    final View v=mChooserListAdapter.createView(row);
    v.setOnClickListener(new OnClickListener(){
      @Override public void onClick(      View v){
        startSelected(holder.itemIndex,false,true);
      }
    }
);
    v.setOnLongClickListener(new OnLongClickListener(){
      @Override public boolean onLongClick(      View v){
        showAppDetails(mChooserListAdapter.resolveInfoForPosition(holder.itemIndex,true));
        return true;
      }
    }
);
    row.addView(v);
    holder.cells[i]=v;
    LayoutParams lp=v.getLayoutParams();
    v.measure(spec,spec);
    if (lp == null) {
      lp=new LayoutParams(LayoutParams.MATCH_PARENT,v.getMeasuredHeight());
      row.setLayoutParams(lp);
    }
 else {
      lp.height=v.getMeasuredHeight();
    }
  }
  holder.measure();
  LayoutParams lp=row.getLayoutParams();
  if (lp == null) {
    lp=new LayoutParams(LayoutParams.MATCH_PARENT,holder.measuredRowHeight);
    row.setLayoutParams(lp);
  }
 else {
    lp.height=holder.measuredRowHeight;
  }
  row.setTag(holder);
  return holder;
}

Fixed version (ground truth):
RowViewHolder createViewHolder(ViewGroup parent){
  final ViewGroup row=(ViewGroup)mLayoutInflater.inflate(R.layout.chooser_row,parent,false);
  final RowViewHolder holder=new RowViewHolder(row,mColumnCount);
  final int spec=MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED);
  for (int i=0; i < mColumnCount; i++) {
    final View v=mChooserListAdapter.createView(row);
    final int column=i;
    v.setOnClickListener(new OnClickListener(){
      @Override public void onClick(      View v){
        startSelected(holder.itemIndices[column],false,true);
      }
    }
);
    v.setOnLongClickListener(new OnLongClickListener(){
      @Override public boolean onLongClick(      View v){
        showAppDetails(mChooserListAdapter.resolveInfoForPosition(holder.itemIndices[column],true));
        return true;
      }
    }
);
    row.addView(v);
    holder.cells[i]=v;
    LayoutParams lp=v.getLayoutParams();
    v.measure(spec,spec);
    if (lp == null) {
      lp=new LayoutParams(LayoutParams.MATCH_PARENT,v.getMeasuredHeight());
      row.setLayoutParams(lp);
    }
 else {
      lp.height=v.getMeasuredHeight();
    }
  }
  holder.measure();
  LayoutParams lp=row.getLayoutParams();
  if (lp == null) {
    lp=new LayoutParams(LayoutParams.MATCH_PARENT,holder.measuredRowHeight);
    row.setLayoutParams(lp);
  }
 else {
    lp.height=holder.measuredRowHeight;
  }
  row.setTag(holder);
  return holder;
}
Program: 193502
Project: 193502
Buggy source:
public RowViewHolder(ViewGroup row,int cellCount){
  this.row=row;
  this.cells=new View[cellCount];
}

Fixed version (ground truth):
public RowViewHolder(ViewGroup row,int cellCount){
  this.row=row;
  this.cells=new View[cellCount];
  this.itemIndices=new int[cellCount];
}
Program: 193503
Project: 193503
Buggy source:
public ChooserRowAdapter(ChooserListAdapter wrappedAdapter){
  mChooserListAdapter=wrappedAdapter;
  mLayoutInflater=LayoutInflater.from(ChooserActivity.this);
  mInterpolator=AnimationUtils.loadInterpolator(ChooserActivity.this,android.R.interpolator.decelerate_quint);
  wrappedAdapter.registerDataSetObserver(new DataSetObserver(){
    @Override public void onChanged(){
      super.onChanged();
      final int rcount=getServiceTargetRowCount();
      if (mServiceTargetScale == null || mServiceTargetScale.length != rcount) {
        RowScale[] old=mServiceTargetScale;
        int oldRCount=old != null ? old.length : 0;
        mServiceTargetScale=new RowScale[rcount];
        if (old != null && rcount > 0) {
          System.arraycopy(old,0,mServiceTargetScale,0,Math.min(old.length,rcount));
        }
        for (int i=rcount; i < oldRCount; i++) {
          old[i].cancelAnimation();
        }
        for (int i=oldRCount; i < rcount; i++) {
          final RowScale rs=new RowScale(ChooserRowAdapter.this,0.f,1.f).setInterpolator(mInterpolator);
          mServiceTargetScale[i]=rs;
          rs.startAnimation();
        }
      }
      notifyDataSetChanged();
    }
    @Override public void onInvalidated(){
      super.onInvalidated();
      notifyDataSetInvalidated();
      if (mServiceTargetScale != null) {
        for (        RowScale rs : mServiceTargetScale) {
          rs.cancelAnimation();
        }
      }
    }
  }
);
}

Fixed version (ground truth):
public ChooserRowAdapter(ChooserListAdapter wrappedAdapter){
  mChooserListAdapter=wrappedAdapter;
  mLayoutInflater=LayoutInflater.from(ChooserActivity.this);
  mInterpolator=AnimationUtils.loadInterpolator(ChooserActivity.this,android.R.interpolator.decelerate_quint);
  wrappedAdapter.registerDataSetObserver(new DataSetObserver(){
    @Override public void onChanged(){
      super.onChanged();
      final int rcount=getServiceTargetRowCount();
      if (mServiceTargetScale == null || mServiceTargetScale.length != rcount) {
        RowScale[] old=mServiceTargetScale;
        int oldRCount=old != null ? old.length : 0;
        mServiceTargetScale=new RowScale[rcount];
        if (old != null && rcount > 0) {
          System.arraycopy(old,0,mServiceTargetScale,0,Math.min(old.length,rcount));
        }
        for (int i=rcount; i < oldRCount; i++) {
          old[i].cancelAnimation();
        }
        for (int i=oldRCount; i < rcount; i++) {
          final RowScale rs=new RowScale(ChooserRowAdapter.this,0.f,1.f).setInterpolator(mInterpolator);
          mServiceTargetScale[i]=rs;
        }
        for (int i=oldRCount; i < rcount; i++) {
          mServiceTargetScale[i].startAnimation();
        }
      }
      notifyDataSetChanged();
    }
    @Override public void onInvalidated(){
      super.onInvalidated();
      notifyDataSetInvalidated();
      if (mServiceTargetScale != null) {
        for (        RowScale rs : mServiceTargetScale) {
          rs.cancelAnimation();
        }
      }
    }
  }
);
}
Program: 193504
Project: 193504
Buggy source:
void bindViewHolder(int rowPosition,RowViewHolder holder){
  final int start=getFirstRowPosition(rowPosition);
  final int startType=mChooserListAdapter.getPositionTargetType(start);
  int end=start + mColumnCount - 1;
  while (mChooserListAdapter.getPositionTargetType(end) != startType && end >= start) {
    end--;
  }
  if (startType == ChooserListAdapter.TARGET_SERVICE) {
    holder.row.setBackgroundColor(getColor(R.color.chooser_service_row_background_color));
  }
 else {
    holder.row.setBackgroundColor(Color.TRANSPARENT);
  }
  final int oldHeight=holder.row.getLayoutParams().height;
  holder.row.getLayoutParams().height=Math.max(1,(int)(holder.measuredRowHeight * getRowScale(rowPosition)));
  if (holder.row.getLayoutParams().height != oldHeight) {
    holder.row.requestLayout();
  }
  for (int i=0; i < mColumnCount; i++) {
    final View v=holder.cells[i];
    if (start + i <= end) {
      v.setVisibility(View.VISIBLE);
      holder.itemIndex=start + i;
      mChooserListAdapter.bindView(holder.itemIndex,v);
    }
 else {
      v.setVisibility(View.GONE);
    }
  }
}

Fixed version (ground truth):
void bindViewHolder(int rowPosition,RowViewHolder holder){
  final int start=getFirstRowPosition(rowPosition);
  final int startType=mChooserListAdapter.getPositionTargetType(start);
  int end=start + mColumnCount - 1;
  while (mChooserListAdapter.getPositionTargetType(end) != startType && end >= start) {
    end--;
  }
  if (startType == ChooserListAdapter.TARGET_SERVICE) {
    holder.row.setBackgroundColor(getColor(R.color.chooser_service_row_background_color));
  }
 else {
    holder.row.setBackgroundColor(Color.TRANSPARENT);
  }
  final int oldHeight=holder.row.getLayoutParams().height;
  holder.row.getLayoutParams().height=Math.max(1,(int)(holder.measuredRowHeight * getRowScale(rowPosition)));
  if (holder.row.getLayoutParams().height != oldHeight) {
    holder.row.requestLayout();
  }
  for (int i=0; i < mColumnCount; i++) {
    final View v=holder.cells[i];
    if (start + i <= end) {
      v.setVisibility(View.VISIBLE);
      holder.itemIndices[i]=start + i;
      mChooserListAdapter.bindView(holder.itemIndices[i],v);
    }
 else {
      v.setVisibility(View.GONE);
    }
  }
}
Program: 193505
Project: 193505
Buggy source:
@Override public void onChanged(){
  if (mResolverDrawerLayout == null) {
    return;
  }
  final int chooserTargetRows=mChooserRowAdapter.getServiceTargetRowCount();
  int offset=0;
  for (int i=0; i < chooserTargetRows; i++) {
    final int pos=mChooserRowAdapter.getCallerTargetRowCount() + i;
    final int vt=mChooserRowAdapter.getItemViewType(pos);
    if (vt != mCachedViewType) {
      mCachedView=null;
    }
    final View v=mChooserRowAdapter.getView(pos,mCachedView,mListView);
    int height=((RowViewHolder)(v.getTag())).measuredRowHeight;
    offset+=(int)(height * mChooserRowAdapter.getRowScale(pos) * chooserTargetRows);
    if (vt >= 0) {
      mCachedViewType=vt;
      mCachedView=v;
    }
 else {
      mCachedViewType=-1;
    }
  }
  mResolverDrawerLayout.setCollapsibleHeightReserved(offset);
}

Fixed version (ground truth):
@Override public void onChanged(){
  if (mResolverDrawerLayout == null) {
    return;
  }
  final int chooserTargetRows=mChooserRowAdapter.getServiceTargetRowCount();
  int offset=0;
  for (int i=0; i < chooserTargetRows; i++) {
    final int pos=mChooserRowAdapter.getCallerTargetRowCount() + i;
    final int vt=mChooserRowAdapter.getItemViewType(pos);
    if (vt != mCachedViewType) {
      mCachedView=null;
    }
    final View v=mChooserRowAdapter.getView(pos,mCachedView,mListView);
    int height=((RowViewHolder)(v.getTag())).measuredRowHeight;
    offset+=(int)(height * mChooserRowAdapter.getRowScale(pos));
    if (vt >= 0) {
      mCachedViewType=vt;
      mCachedView=v;
    }
 else {
      mCachedViewType=-1;
    }
  }
  mResolverDrawerLayout.setCollapsibleHeightReserved(offset);
}
Program: 193506
Project: 193506
Buggy source:
@Override public boolean onLongClick(View v){
  showAppDetails(mChooserListAdapter.resolveInfoForPosition(holder.itemIndex,true));
  return true;
}

Fixed version (ground truth):
@Override public boolean onLongClick(View v){
  showAppDetails(mChooserListAdapter.resolveInfoForPosition(holder.itemIndices[column],true));
  return true;
}
Program: 193507
Project: 193507
Buggy source:
@Override public void onClick(View v){
  startSelected(holder.itemIndex,false,true);
}

Fixed version (ground truth):
@Override public void onClick(View v){
  startSelected(holder.itemIndices[column],false,true);
}