Program: 193218
Project: 193218
Buggy source:
/** 
 * Computes the stack and task rects.  The given task stack bounds is the whole bounds not including the search bar.
 */
public void initialize(Rect taskStackBounds){
  SystemServicesProxy ssp=Recents.getSystemServices();
  RecentsConfiguration config=Recents.getConfiguration();
  int widthPadding=(int)(config.taskStackWidthPaddingPct * taskStackBounds.width());
  int heightPadding=mContext.getResources().getDimensionPixelSize(R.dimen.recents_stack_top_padding);
  mStackBottomOffset=mSystemInsets.bottom + heightPadding;
  int ffHeight=(taskStackBounds.height() - 2 * heightPadding - mStackBottomOffset) / 2;
  mFreeformRect.set(taskStackBounds.left + widthPadding,taskStackBounds.top + heightPadding,taskStackBounds.right - widthPadding,taskStackBounds.top + heightPadding + ffHeight);
  mFreeformStackRect.set(taskStackBounds.left + widthPadding,taskStackBounds.top + heightPadding + ffHeight+ heightPadding,taskStackBounds.right - widthPadding,taskStackBounds.bottom);
  mStackRect.set(taskStackBounds.left + widthPadding,taskStackBounds.top + heightPadding,taskStackBounds.right - widthPadding,taskStackBounds.bottom);
  int size=Math.min(mStackRect.width(),mStackRect.height() - mStackBottomOffset);
  mTaskRect.set(mStackRect.left,mStackRect.top,mStackRect.left + size,mStackRect.top + size);
  mCurrentStackRect=ssp.hasFreeformWorkspaceSupport() ? mFreeformStackRect : mStackRect;
  int withinAffiliationOffset=mContext.getResources().getDimensionPixelSize(R.dimen.recents_task_bar_height);
  int betweenAffiliationOffset=(int)(VISIBLE_TASK_HEIGHT_BETWEEN_TASKS * mTaskRect.height());
  mWithinAffiliationPOffset=sCurve.computePOffsetForScaledHeight(withinAffiliationOffset,mCurrentStackRect);
  mBetweenAffiliationPOffset=sCurve.computePOffsetForScaledHeight(betweenAffiliationOffset,mCurrentStackRect);
  mTaskHeightPOffset=sCurve.computePOffsetForScaledHeight(mTaskRect.height(),mCurrentStackRect);
  mTaskHalfHeightPOffset=sCurve.computePOffsetForScaledHeight(mTaskRect.height() / 2,mCurrentStackRect);
  mStackBottomPOffset=sCurve.computePOffsetForHeight(mStackBottomOffset,mCurrentStackRect);
  if (DEBUG) {
    Log.d(TAG,"String_Node_Str");
    Log.d(TAG,"String_Node_Str" + sCurve.getArcLength());
    Log.d(TAG,"String_Node_Str" + mFreeformRect);
    Log.d(TAG,"String_Node_Str" + mFreeformStackRect);
    Log.d(TAG,"String_Node_Str" + mStackRect);
    Log.d(TAG,"String_Node_Str" + mTaskRect);
    Log.d(TAG,"String_Node_Str" + mSystemInsets);
    Log.d(TAG,"String_Node_Str" + mWithinAffiliationPOffset);
    Log.d(TAG,"String_Node_Str" + mBetweenAffiliationPOffset);
    Log.d(TAG,"String_Node_Str" + mTaskHeightPOffset);
    Log.d(TAG,"String_Node_Str" + mTaskHalfHeightPOffset);
    Log.d(TAG,"String_Node_Str" + mStackBottomPOffset);
    Log.d(TAG,"String_Node_Str" + sCurve.pToX(0f,mCurrentStackRect));
    Log.d(TAG,"String_Node_Str" + sCurve.pToX(1f,mCurrentStackRect));
  }
}

Fixed version (ground truth):
/** 
 * Computes the stack and task rects.  The given task stack bounds is the whole bounds not including the search bar.
 */
public void initialize(Rect taskStackBounds){
  SystemServicesProxy ssp=Recents.getSystemServices();
  RecentsConfiguration config=Recents.getConfiguration();
  int widthPadding=(int)(config.taskStackWidthPaddingPct * taskStackBounds.width());
  int heightPadding=mContext.getResources().getDimensionPixelSize(R.dimen.recents_stack_top_padding);
  mStackBottomOffset=mSystemInsets.bottom + heightPadding;
  int ffHeight=(taskStackBounds.height() - 2 * heightPadding - mStackBottomOffset) / 2;
  mFreeformRect.set(taskStackBounds.left + widthPadding,taskStackBounds.top + heightPadding,taskStackBounds.right - widthPadding,taskStackBounds.top + heightPadding + ffHeight);
  mFreeformStackRect.set(taskStackBounds.left + widthPadding,taskStackBounds.top + heightPadding + ffHeight+ heightPadding,taskStackBounds.right - widthPadding,taskStackBounds.bottom);
  mStackRect.set(taskStackBounds.left + widthPadding,taskStackBounds.top + heightPadding,taskStackBounds.right - widthPadding,taskStackBounds.bottom);
  int size=mStackRect.width();
  mTaskRect.set(mStackRect.left,mStackRect.top,mStackRect.left + size,mStackRect.top + size);
  mCurrentStackRect=ssp.hasFreeformWorkspaceSupport() ? mFreeformStackRect : mStackRect;
  int withinAffiliationOffset=mContext.getResources().getDimensionPixelSize(R.dimen.recents_task_bar_height);
  int betweenAffiliationOffset=(int)(VISIBLE_TASK_HEIGHT_BETWEEN_TASKS * mTaskRect.height());
  mWithinAffiliationPOffset=sCurve.computePOffsetForScaledHeight(withinAffiliationOffset,mCurrentStackRect);
  mBetweenAffiliationPOffset=sCurve.computePOffsetForScaledHeight(betweenAffiliationOffset,mCurrentStackRect);
  mTaskHeightPOffset=sCurve.computePOffsetForScaledHeight(mTaskRect.height(),mCurrentStackRect);
  mTaskHalfHeightPOffset=sCurve.computePOffsetForScaledHeight(mTaskRect.height() / 2,mCurrentStackRect);
  mStackBottomPOffset=sCurve.computePOffsetForHeight(mStackBottomOffset,mCurrentStackRect);
  if (DEBUG) {
    Log.d(TAG,"String_Node_Str");
    Log.d(TAG,"String_Node_Str" + sCurve.getArcLength());
    Log.d(TAG,"String_Node_Str" + mFreeformRect);
    Log.d(TAG,"String_Node_Str" + mFreeformStackRect);
    Log.d(TAG,"String_Node_Str" + mStackRect);
    Log.d(TAG,"String_Node_Str" + mTaskRect);
    Log.d(TAG,"String_Node_Str" + mSystemInsets);
    Log.d(TAG,"String_Node_Str" + mWithinAffiliationPOffset);
    Log.d(TAG,"String_Node_Str" + mBetweenAffiliationPOffset);
    Log.d(TAG,"String_Node_Str" + mTaskHeightPOffset);
    Log.d(TAG,"String_Node_Str" + mTaskHalfHeightPOffset);
    Log.d(TAG,"String_Node_Str" + mStackBottomPOffset);
    Log.d(TAG,"String_Node_Str" + sCurve.pToX(0f,mCurrentStackRect));
    Log.d(TAG,"String_Node_Str" + sCurve.pToX(1f,mCurrentStackRect));
  }
}