nus-yam/ex-repair huggingface dataset:
Program: 192829
Project: 192829
Buggy source:
public void setHideSensitive(boolean hideSensitive,boolean animated,long delay,long duration){
  boolean oldShowingPublic=mShowingPublic;
  mShowingPublic=mSensitive && hideSensitive;
  if (mShowingPublicInitialized && mShowingPublic == oldShowingPublic) {
    return;
  }
  if (mPublicLayout.getChildCount() == 0)   return;
  if (!animated) {
    mPublicLayout.animate().cancel();
    mPrivateLayout.animate().cancel();
    mPublicLayout.setAlpha(1f);
    mPrivateLayout.setAlpha(1f);
    mPublicLayout.setVisibility(mShowingPublic ? View.VISIBLE : View.INVISIBLE);
    updateChildrenVisibility();
  }
 else {
    animateShowingPublic(delay,duration);
  }
  mPrivateLayout.updateExpandButtons(isExpandable());
  updateVetoButton();
  mShowingPublicInitialized=true;
}

Fixed version (ground truth):
public void setHideSensitive(boolean hideSensitive,boolean animated,long delay,long duration){
  boolean oldShowingPublic=mShowingPublic;
  mShowingPublic=mSensitive && hideSensitive;
  if (mShowingPublicInitialized && mShowingPublic == oldShowingPublic) {
    return;
  }
  if (mPublicLayout.getChildCount() == 0)   return;
  if (!animated) {
    mPublicLayout.animate().cancel();
    mPrivateLayout.animate().cancel();
    mPublicLayout.setAlpha(1f);
    mPrivateLayout.setAlpha(1f);
    mPublicLayout.setVisibility(mShowingPublic ? View.VISIBLE : View.INVISIBLE);
    updateChildrenVisibility();
  }
 else {
    animateShowingPublic(delay,duration);
  }
  mPrivateLayout.updateExpandButtons(isExpandable());
  updateClearability();
  mShowingPublicInitialized=true;
}
Program: 192830
Project: 192830
Buggy source:
@Override protected void onLayout(boolean changed,int l,int t,int r,int b){
  super.onLayout(changed,l,t,r,b);
  if (mProfileBadge.getVisibility() != View.GONE) {
    int paddingEnd=getPaddingEnd();
    if (getLayoutDirection() == LAYOUT_DIRECTION_RTL) {
      mProfileBadge.layout(paddingEnd,mProfileBadge.getTop(),paddingEnd + mProfileBadge.getMeasuredWidth(),mProfileBadge.getBottom());
    }
 else {
      mProfileBadge.layout(getWidth() - paddingEnd - mProfileBadge.getMeasuredWidth(),mProfileBadge.getTop(),getWidth() - paddingEnd,mProfileBadge.getBottom());
    }
  }
  updateTouchListener();
}

Fixed version (ground truth):
@Override protected void onLayout(boolean changed,int l,int t,int r,int b){
  super.onLayout(changed,l,t,r,b);
  if (mProfileBadge.getVisibility() != View.GONE) {
    int paddingEnd=getPaddingEnd();
    if (mShowWorkBadgeAtEnd) {
      paddingEnd=mContentEndMargin;
    }
    if (getLayoutDirection() == LAYOUT_DIRECTION_RTL) {
      mProfileBadge.layout(paddingEnd,mProfileBadge.getTop(),paddingEnd + mProfileBadge.getMeasuredWidth(),mProfileBadge.getBottom());
    }
 else {
      mProfileBadge.layout(getWidth() - paddingEnd - mProfileBadge.getMeasuredWidth(),mProfileBadge.getTop(),getWidth() - paddingEnd,mProfileBadge.getBottom());
    }
  }
  updateTouchListener();
}
Program: 192831
Project: 192831
Buggy source:
public NotificationHeaderView(Context context,AttributeSet attrs,int defStyleAttr,int defStyleRes){
  super(context,attrs,defStyleAttr,defStyleRes);
  mHeaderMinWidth=getResources().getDimensionPixelSize(com.android.internal.R.dimen.notification_header_shrink_min_width);
  mExpandTopPadding=(int)(1 * getResources().getDisplayMetrics().density);
}

Fixed version (ground truth):
public NotificationHeaderView(Context context,AttributeSet attrs,int defStyleAttr,int defStyleRes){
  super(context,attrs,defStyleAttr,defStyleRes);
  mHeaderMinWidth=getResources().getDimensionPixelSize(com.android.internal.R.dimen.notification_header_shrink_min_width);
  mContentEndMargin=getResources().getDimensionPixelSize(com.android.internal.R.dimen.notification_content_margin_end);
  mExpandTopPadding=(int)(1 * getResources().getDisplayMetrics().density);
}
Program: 192832
Project: 192832
Buggy source:
@Override protected void onLayout(boolean changed,int l,int t,int r,int b){
  super.onLayout(changed,l,t,r,b);
  if (mProfileBadge.getVisibility() != View.GONE) {
    int paddingEnd=getPaddingEnd();
    if (getLayoutDirection() == LAYOUT_DIRECTION_RTL) {
      mProfileBadge.layout(paddingEnd,mProfileBadge.getTop(),paddingEnd + mProfileBadge.getMeasuredWidth(),mProfileBadge.getBottom());
    }
 else {
      mProfileBadge.layout(getWidth() - paddingEnd - mProfileBadge.getMeasuredWidth(),mProfileBadge.getTop(),getWidth() - paddingEnd,mProfileBadge.getBottom());
    }
  }
  updateTouchListener();
}

Fixed version (ground truth):
@Override protected void onLayout(boolean changed,int l,int t,int r,int b){
  super.onLayout(changed,l,t,r,b);
  if (mProfileBadge.getVisibility() != View.GONE) {
    int paddingEnd=getPaddingEnd();
    if (mShowWorkBadgeAtEnd) {
      paddingEnd=mContentEndMargin;
    }
    if (getLayoutDirection() == LAYOUT_DIRECTION_RTL) {
      mProfileBadge.layout(paddingEnd,mProfileBadge.getTop(),paddingEnd + mProfileBadge.getMeasuredWidth(),mProfileBadge.getBottom());
    }
 else {
      mProfileBadge.layout(getWidth() - paddingEnd - mProfileBadge.getMeasuredWidth(),mProfileBadge.getTop(),getWidth() - paddingEnd,mProfileBadge.getBottom());
    }
  }
  updateTouchListener();
}
Program: 192833
Project: 192833
Buggy source:
public NotificationHeaderView(Context context,AttributeSet attrs,int defStyleAttr,int defStyleRes){
  super(context,attrs,defStyleAttr,defStyleRes);
  mHeaderMinWidth=getResources().getDimensionPixelSize(com.android.internal.R.dimen.notification_header_shrink_min_width);
  mExpandTopPadding=(int)(1 * getResources().getDisplayMetrics().density);
}

Fixed version (ground truth):
public NotificationHeaderView(Context context,AttributeSet attrs,int defStyleAttr,int defStyleRes){
  super(context,attrs,defStyleAttr,defStyleRes);
  mHeaderMinWidth=getResources().getDimensionPixelSize(com.android.internal.R.dimen.notification_header_shrink_min_width);
  mContentEndMargin=getResources().getDimensionPixelSize(com.android.internal.R.dimen.notification_content_margin_end);
  mExpandTopPadding=(int)(1 * getResources().getDisplayMetrics().density);
}
Program: 192836
Project: 192836
Buggy source:
private void maybeComputeTransitionDurationScale(){
  if (mMainPanelSize == null || mOverflowPanel == null) {
    int w=mMainPanelSize.getWidth() - mOverflowPanelSize.getWidth();
    int h=mOverflowPanelSize.getHeight() - mMainPanelSize.getHeight();
    mTransitionDurationScale=(int)(Math.sqrt(w * w + h * h) / mContentContainer.getContext().getResources().getDisplayMetrics().density);
  }
}

Fixed version (ground truth):
private void maybeComputeTransitionDurationScale(){
  if (mMainPanelSize != null && mOverflowPanelSize != null) {
    int w=mMainPanelSize.getWidth() - mOverflowPanelSize.getWidth();
    int h=mOverflowPanelSize.getHeight() - mMainPanelSize.getHeight();
    mTransitionDurationScale=(int)(Math.sqrt(w * w + h * h) / mContentContainer.getContext().getResources().getDisplayMetrics().density);
  }
}
Program: 192837
Project: 192837
Buggy source:
private void maybeComputeTransitionDurationScale(){
  if (mMainPanelSize == null || mOverflowPanel == null) {
    int w=mMainPanelSize.getWidth() - mOverflowPanelSize.getWidth();
    int h=mOverflowPanelSize.getHeight() - mMainPanelSize.getHeight();
    mTransitionDurationScale=(int)(Math.sqrt(w * w + h * h) / mContentContainer.getContext().getResources().getDisplayMetrics().density);
  }
}

Fixed version (ground truth):
private void maybeComputeTransitionDurationScale(){
  if (mMainPanelSize != null && mOverflowPanelSize != null) {
    int w=mMainPanelSize.getWidth() - mOverflowPanelSize.getWidth();
    int h=mOverflowPanelSize.getHeight() - mMainPanelSize.getHeight();
    mTransitionDurationScale=(int)(Math.sqrt(w * w + h * h) / mContentContainer.getContext().getResources().getDisplayMetrics().density);
  }
}
Program: 192838
Project: 192838
Buggy source:
/** 
 * Prepares a local set of mutable animators based on the constant state. <p> If there are any pending uninflated animators, attempts to inflate them immediately against the provided resources object.
 * @param animatorSet the animator set to which the animators shouldbe added
 * @param res the resources against which to inflate any pendinganimators, or  {@code null} if not available
 */
public void prepareLocalAnimators(@NonNull AnimatorSet animatorSet,@NonNull ValueAnimator.AnimatorUpdateListener updateListener,@Nullable Resources res){
  if (mPendingAnims != null) {
    if (res != null) {
      inflatePendingAnimators(res,null);
    }
 else {
      Log.e(LOGTAG,"String_Node_Str" + "String_Node_Str" + "String_Node_Str");
    }
    mPendingAnims=null;
  }
  final int count=mAnimators == null ? 0 : mAnimators.size();
  if (count > 0) {
    final Animator firstAnim=prepareLocalAnimator(0);
    final AnimatorSet.Builder builder=animatorSet.play(firstAnim);
    for (int i=1; i < count; ++i) {
      final Animator nextAnim=prepareLocalAnimator(i);
      builder.with(nextAnim);
    }
    long totalDuration=animatorSet.getTotalDuration();
    ValueAnimator updateAnim=ValueAnimator.ofFloat(0f,1f);
    if (totalDuration == ValueAnimator.DURATION_INFINITE) {
      updateAnim.setRepeatCount(ValueAnimator.INFINITE);
    }
 else {
      updateAnim.setDuration(totalDuration);
    }
    updateAnim.addUpdateListener(updateListener);
    builder.with(updateAnim);
  }
}

Fixed version (ground truth):
/** 
 * Prepares a local set of mutable animators based on the constant state. <p> If there are any pending uninflated animators, attempts to inflate them immediately against the provided resources object.
 * @param animatorSet the animator set to which the animators shouldbe added
 * @param res the resources against which to inflate any pendinganimators, or  {@code null} if not available
 */
public void prepareLocalAnimators(@NonNull AnimatorSet animatorSet,@Nullable Resources res){
  if (mPendingAnims != null) {
    if (res != null) {
      inflatePendingAnimators(res,null);
    }
 else {
      Log.e(LOGTAG,"String_Node_Str" + "String_Node_Str" + "String_Node_Str");
    }
    mPendingAnims=null;
  }
  final int count=mAnimators == null ? 0 : mAnimators.size();
  if (count > 0) {
    final Animator firstAnim=prepareLocalAnimator(0);
    final AnimatorSet.Builder builder=animatorSet.play(firstAnim);
    for (int i=1; i < count; ++i) {
      final Animator nextAnim=prepareLocalAnimator(i);
      builder.with(nextAnim);
    }
  }
}
Program: 192839
Project: 192839
Buggy source:
@Override public void draw(Canvas canvas){
  mAnimatedVectorState.mVectorDrawable.draw(canvas);
}

Fixed version (ground truth):
@Override public void draw(Canvas canvas){
  mAnimatedVectorState.mVectorDrawable.draw(canvas);
  if (isStarted()) {
    invalidateSelf();
  }
}
Program: 192840
Project: 192840
Buggy source:
@NonNull private void ensureAnimatorSet(){
  if (!mHasAnimatorSet) {
    mAnimatedVectorState.prepareLocalAnimators(mAnimatorSet,mUpdateListener,mRes);
    mHasAnimatorSet=true;
    mRes=null;
  }
}

Fixed version (ground truth):
@NonNull private void ensureAnimatorSet(){
  if (!mHasAnimatorSet) {
    mAnimatedVectorState.prepareLocalAnimators(mAnimatorSet,mRes);
    mHasAnimatorSet=true;
    mRes=null;
  }
}
Program: 192841
Project: 192841
Buggy source:
/** 
 * Prepares a local set of mutable animators based on the constant state. <p> If there are any pending uninflated animators, attempts to inflate them immediately against the provided resources object.
 * @param animatorSet the animator set to which the animators shouldbe added
 * @param res the resources against which to inflate any pendinganimators, or  {@code null} if not available
 */
public void prepareLocalAnimators(@NonNull AnimatorSet animatorSet,@NonNull ValueAnimator.AnimatorUpdateListener updateListener,@Nullable Resources res){
  if (mPendingAnims != null) {
    if (res != null) {
      inflatePendingAnimators(res,null);
    }
 else {
      Log.e(LOGTAG,"String_Node_Str" + "String_Node_Str" + "String_Node_Str");
    }
    mPendingAnims=null;
  }
  final int count=mAnimators == null ? 0 : mAnimators.size();
  if (count > 0) {
    final Animator firstAnim=prepareLocalAnimator(0);
    final AnimatorSet.Builder builder=animatorSet.play(firstAnim);
    for (int i=1; i < count; ++i) {
      final Animator nextAnim=prepareLocalAnimator(i);
      builder.with(nextAnim);
    }
    long totalDuration=animatorSet.getTotalDuration();
    ValueAnimator updateAnim=ValueAnimator.ofFloat(0f,1f);
    if (totalDuration == ValueAnimator.DURATION_INFINITE) {
      updateAnim.setRepeatCount(ValueAnimator.INFINITE);
    }
 else {
      updateAnim.setDuration(totalDuration);
    }
    updateAnim.addUpdateListener(updateListener);
    builder.with(updateAnim);
  }
}

Fixed version (ground truth):
/** 
 * Prepares a local set of mutable animators based on the constant state. <p> If there are any pending uninflated animators, attempts to inflate them immediately against the provided resources object.
 * @param animatorSet the animator set to which the animators shouldbe added
 * @param res the resources against which to inflate any pendinganimators, or  {@code null} if not available
 */
public void prepareLocalAnimators(@NonNull AnimatorSet animatorSet,@Nullable Resources res){
  if (mPendingAnims != null) {
    if (res != null) {
      inflatePendingAnimators(res,null);
    }
 else {
      Log.e(LOGTAG,"String_Node_Str" + "String_Node_Str" + "String_Node_Str");
    }
    mPendingAnims=null;
  }
  final int count=mAnimators == null ? 0 : mAnimators.size();
  if (count > 0) {
    final Animator firstAnim=prepareLocalAnimator(0);
    final AnimatorSet.Builder builder=animatorSet.play(firstAnim);
    for (int i=1; i < count; ++i) {
      final Animator nextAnim=prepareLocalAnimator(i);
      builder.with(nextAnim);
    }
  }
}
Program: 192842
Project: 192842
Buggy source:
@Override public void draw(Canvas canvas){
  mAnimatedVectorState.mVectorDrawable.draw(canvas);
}

Fixed version (ground truth):
@Override public void draw(Canvas canvas){
  mAnimatedVectorState.mVectorDrawable.draw(canvas);
  if (isStarted()) {
    invalidateSelf();
  }
}
Program: 192843
Project: 192843
Buggy source:
@NonNull private void ensureAnimatorSet(){
  if (!mHasAnimatorSet) {
    mAnimatedVectorState.prepareLocalAnimators(mAnimatorSet,mUpdateListener,mRes);
    mHasAnimatorSet=true;
    mRes=null;
  }
}

Fixed version (ground truth):
@NonNull private void ensureAnimatorSet(){
  if (!mHasAnimatorSet) {
    mAnimatedVectorState.prepareLocalAnimators(mAnimatorSet,mRes);
    mHasAnimatorSet=true;
    mRes=null;
  }
}
Program: 192844
Project: 192844
Buggy source:
public float getAlpha(){
  return mAlpha;
}

Fixed version (ground truth):
public float getAlpha(){
  return mAlpha != null ? mAlpha : 1;
}
Program: 192845
Project: 192845
Buggy source:
public int getVisibility(){
  return mVisibility;
}

Fixed version (ground truth):
public int getVisibility(){
  return mVisibility != null ? mVisibility : View.VISIBLE;
}
Program: 192846
Project: 192846
Buggy source:
public float getAlpha(){
  return mAlpha;
}

Fixed version (ground truth):
public float getAlpha(){
  return mAlpha != null ? mAlpha : 1;
}
Program: 192847
Project: 192847
Buggy source:
public int getVisibility(){
  return mVisibility;
}

Fixed version (ground truth):
public int getVisibility(){
  return mVisibility != null ? mVisibility : View.VISIBLE;
}
Program: 192848
Project: 192848
Buggy source:
public float getAlpha(){
  return mAlpha;
}

Fixed version (ground truth):
public float getAlpha(){
  return mAlpha != null ? mAlpha : 1;
}
Program: 192849
Project: 192849
Buggy source:
public int getVisibility(){
  return mVisibility;
}

Fixed version (ground truth):
public int getVisibility(){
  return mVisibility != null ? mVisibility : View.VISIBLE;
}
Program: 192850
Project: 192850
Buggy source:
@Override public void prepareViewToLeavePool(TaskView tv,Task task,boolean isNewView){
  tv.onTaskBound(task);
  Recents.getTaskLoader().loadTaskData(task);
  tv.setNoUserInteractionState();
  int taskIndex=mStack.indexOfStackTask(task);
  int insertIndex=findTaskViewInsertIndex(task,taskIndex);
  if (isNewView) {
    addView(tv,insertIndex);
  }
 else {
    attachViewToParent(tv,insertIndex,tv.getLayoutParams());
  }
  updateTaskViewsList();
  tv.setCallbacks(this);
  tv.setTouchEnabled(true);
  tv.setClipViewInStack(true);
  if (mFocusedTask == task) {
    tv.setFocusedState(true,false);
    if (mStartTimerIndicator) {
      tv.getHeaderView().startFocusTimerIndicator();
      mStartTimerIndicator=false;
    }
  }
  if (mScreenPinningEnabled && tv.getTask() == mStack.getStackFrontMostTask(false)) {
    tv.showActionButton(false,0);
  }
}

Fixed version (ground truth):
@Override public void prepareViewToLeavePool(TaskView tv,Task task,boolean isNewView){
  int taskIndex=mStack.indexOfStackTask(task);
  int insertIndex=findTaskViewInsertIndex(task,taskIndex);
  if (isNewView) {
    addView(tv,insertIndex);
  }
 else {
    attachViewToParent(tv,insertIndex,tv.getLayoutParams());
  }
  updateTaskViewsList();
  tv.onTaskBound(task);
  Recents.getTaskLoader().loadTaskData(task);
  tv.setNoUserInteractionState();
  tv.setCallbacks(this);
  tv.setTouchEnabled(true);
  tv.setClipViewInStack(true);
  if (mFocusedTask == task) {
    tv.setFocusedState(true,false);
    if (mStartTimerIndicator) {
      tv.getHeaderView().startFocusTimerIndicator();
      mStartTimerIndicator=false;
    }
  }
  if (mScreenPinningEnabled && tv.getTask() == mStack.getStackFrontMostTask(false)) {
    tv.showActionButton(false,0);
  }
}
Program: 192851
Project: 192851
Buggy source:
@Override public void prepareViewToEnterPool(TaskView tv){
  final Task task=tv.getTask();
  Recents.getTaskLoader().unloadTaskData(task);
  detachViewFromParent(tv);
  updateTaskViewsList();
  tv.resetViewProperties();
  tv.setFocusedState(false,false);
  tv.setClipViewInStack(false);
  if (mScreenPinningEnabled) {
    tv.hideActionButton(false,0,false,null);
  }
}

Fixed version (ground truth):
@Override public void prepareViewToEnterPool(TaskView tv){
  final Task task=tv.getTask();
  Recents.getTaskLoader().unloadTaskData(task);
  tv.resetViewProperties();
  tv.setFocusedState(false,false);
  tv.setClipViewInStack(false);
  if (mScreenPinningEnabled) {
    tv.hideActionButton(false,0,false,null);
  }
  detachViewFromParent(tv);
  updateTaskViewsList();
}
Program: 192853
Project: 192853
Buggy source:
/** 
 * Updates the visibility of the the thumbnail. 
 */
void updateThumbnailVisibility(int clipBottom){
  boolean invisible=mTaskBar != null && (getHeight() - clipBottom) <= mTaskBar.getHeight();
  if (invisible != mInvisible) {
    mInvisible=invisible;
    if (!mInvisible) {
      updateThumbnailPaintFilter();
    }
    invalidate();
  }
}

Fixed version (ground truth):
/** 
 * Updates the visibility of the the thumbnail. 
 */
void updateThumbnailVisibility(int clipBottom){
  boolean invisible=mTaskBar != null && (getHeight() - clipBottom) <= mTaskBar.getHeight();
  if (invisible != mInvisible) {
    mInvisible=invisible;
    if (!mInvisible) {
      updateThumbnailPaintFilter();
    }
  }
}
Program: 192854
Project: 192854
Buggy source:
@Override public void setClipToActualHeight(boolean clipToActualHeight){
  super.setClipToActualHeight(clipToActualHeight);
  getShowingLayout().setClipToActualHeight(clipToActualHeight);
}

Fixed version (ground truth):
@Override public void setClipToActualHeight(boolean clipToActualHeight){
  super.setClipToActualHeight(clipToActualHeight || isUserLocked());
  getShowingLayout().setClipToActualHeight(clipToActualHeight || isUserLocked());
}
Program: 192855
Project: 192855
Buggy source:
/** 
 * Sets the focused state.
 */
public void setFocusState(float focusState){
  mFocusState=focusState;
  updateFrontBackTransforms();
}

Fixed version (ground truth):
/** 
 * Sets the focused state.
 */
public void setFocusState(float focusState){
  float prevFocusState=mFocusState;
  mFocusState=focusState;
  updateFrontBackTransforms();
  if (mCb != null) {
    mCb.onFocusStateChanged(prevFocusState,focusState);
  }
}
Program: 192856
Project: 192856
Buggy source:
public TaskStackLayoutAlgorithm(Context context){
  Resources res=context.getResources();
  mFocusedRange=new Range(res.getFloat(R.integer.recents_layout_focused_range_min),res.getFloat(R.integer.recents_layout_focused_range_max));
  mUnfocusedRange=new Range(res.getFloat(R.integer.recents_layout_unfocused_range_min),res.getFloat(R.integer.recents_layout_unfocused_range_max));
  mFocusState=getDefaultFocusState();
  mFocusedPeekHeight=res.getDimensionPixelSize(R.dimen.recents_layout_focused_peek_size);
  mMinTranslationZ=res.getDimensionPixelSize(R.dimen.recents_task_view_z_min);
  mMaxTranslationZ=res.getDimensionPixelSize(R.dimen.recents_task_view_z_max);
  mContext=context;
  mFreeformLayoutAlgorithm=new FreeformWorkspaceLayoutAlgorithm(context);
  mLinearOutSlowInInterpolator=AnimationUtils.loadInterpolator(context,com.android.internal.R.interpolator.linear_out_slow_in);
}

Fixed version (ground truth):
public TaskStackLayoutAlgorithm(Context context,TaskStackLayoutAlgorithmCallbacks cb){
  Resources res=context.getResources();
  mContext=context;
  mCb=cb;
  mFocusedRange=new Range(res.getFloat(R.integer.recents_layout_focused_range_min),res.getFloat(R.integer.recents_layout_focused_range_max));
  mUnfocusedRange=new Range(res.getFloat(R.integer.recents_layout_unfocused_range_min),res.getFloat(R.integer.recents_layout_unfocused_range_max));
  mFocusState=getDefaultFocusState();
  mFocusedPeekHeight=res.getDimensionPixelSize(R.dimen.recents_layout_focused_peek_size);
  mMinTranslationZ=res.getDimensionPixelSize(R.dimen.recents_task_view_z_min);
  mMaxTranslationZ=res.getDimensionPixelSize(R.dimen.recents_task_view_z_max);
  mFreeformLayoutAlgorithm=new FreeformWorkspaceLayoutAlgorithm(context);
  mLinearOutSlowInInterpolator=AnimationUtils.loadInterpolator(context,com.android.internal.R.interpolator.linear_out_slow_in);
}
Program: 192859
Project: 192859
Buggy source:
/** 
 * Posts an update to synchronize the   {@link TaskView}s with the stack on the next frame.
 */
void relayoutTaskViewsOnNextFrame(TaskViewAnimation animation){
  mDeferredTaskViewLayoutAnimation=animation;
  postInvalidateOnAnimation();
}

Fixed version (ground truth):
/** 
 * Posts an update to synchronize the   {@link TaskView}s with the stack on the next frame.
 */
void relayoutTaskViewsOnNextFrame(TaskViewAnimation animation){
  mDeferredTaskViewLayoutAnimation=animation;
  invalidate();
}
Program: 192860
Project: 192860
Buggy source:
public TaskStackViewScroller(Context context,TaskStackLayoutAlgorithm layoutAlgorithm){
  mContext=context;
  mScroller=new OverScroller(context);
  mLayoutAlgorithm=layoutAlgorithm;
  mLinearOutSlowInInterpolator=AnimationUtils.loadInterpolator(context,com.android.internal.R.interpolator.linear_out_slow_in);
}

Fixed version (ground truth):
public TaskStackViewScroller(Context context,TaskStackViewScrollerCallbacks cb,TaskStackLayoutAlgorithm layoutAlgorithm){
  mContext=context;
  mCb=cb;
  mScroller=new OverScroller(context);
  mLayoutAlgorithm=layoutAlgorithm;
  mLinearOutSlowInInterpolator=AnimationUtils.loadInterpolator(context,com.android.internal.R.interpolator.linear_out_slow_in);
}
Program: 192861
Project: 192861
Buggy source:
/** 
 * Animates the stack scroll 
 */
void animateScroll(float curScroll,float newScroll,final Runnable postRunnable){
  if (mScrollAnimator != null && mScrollAnimator.isRunning()) {
    setStackScroll(mFinalAnimatedScroll);
    mScroller.startScroll(0,progressToScrollRange(mFinalAnimatedScroll),0,0,0);
  }
  stopScroller();
  stopBoundScrollAnimation();
  mFinalAnimatedScroll=newScroll;
  mScrollAnimator=ObjectAnimator.ofFloat(this,"String_Node_Str",curScroll,newScroll);
  mScrollAnimator.setDuration(mContext.getResources().getInteger(R.integer.recents_animate_task_stack_scroll_duration));
  mScrollAnimator.setInterpolator(mLinearOutSlowInInterpolator);
  mScrollAnimator.addListener(new AnimatorListenerAdapter(){
    @Override public void onAnimationEnd(    Animator animation){
      if (postRunnable != null) {
        postRunnable.run();
      }
      mScrollAnimator.removeAllListeners();
    }
  }
);
  mScrollAnimator.start();
}

Fixed version (ground truth):
/** 
 * Animates the stack scroll 
 */
void animateScroll(float curScroll,float newScroll,final Runnable postRunnable){
  if (mScrollAnimator != null && mScrollAnimator.isRunning()) {
    setStackScroll(mFinalAnimatedScroll);
    mScroller.startScroll(0,progressToScrollRange(mFinalAnimatedScroll),0,0,0);
  }
  stopScroller();
  stopBoundScrollAnimation();
  mFinalAnimatedScroll=newScroll;
  mScrollAnimator=ObjectAnimator.ofFloat(this,STACK_SCROLL,curScroll,newScroll);
  mScrollAnimator.setDuration(mContext.getResources().getInteger(R.integer.recents_animate_task_stack_scroll_duration));
  mScrollAnimator.setInterpolator(mLinearOutSlowInInterpolator);
  mScrollAnimator.addListener(new AnimatorListenerAdapter(){
    @Override public void onAnimationEnd(    Animator animation){
      if (postRunnable != null) {
        postRunnable.run();
      }
      mScrollAnimator.removeAllListeners();
    }
  }
);
  mScrollAnimator.start();
}
Program: 192862
Project: 192862
Buggy source:
/** 
 * Sets the focused state.
 */
public void setFocusState(float focusState){
  mFocusState=focusState;
  updateFrontBackTransforms();
}

Fixed version (ground truth):
/** 
 * Sets the focused state.
 */
public void setFocusState(float focusState){
  float prevFocusState=mFocusState;
  mFocusState=focusState;
  updateFrontBackTransforms();
  if (mCb != null) {
    mCb.onFocusStateChanged(prevFocusState,focusState);
  }
}
Program: 192863
Project: 192863
Buggy source:
public TaskStackLayoutAlgorithm(Context context){
  Resources res=context.getResources();
  mFocusedRange=new Range(res.getFloat(R.integer.recents_layout_focused_range_min),res.getFloat(R.integer.recents_layout_focused_range_max));
  mUnfocusedRange=new Range(res.getFloat(R.integer.recents_layout_unfocused_range_min),res.getFloat(R.integer.recents_layout_unfocused_range_max));
  mFocusState=getDefaultFocusState();
  mFocusedPeekHeight=res.getDimensionPixelSize(R.dimen.recents_layout_focused_peek_size);
  mMinTranslationZ=res.getDimensionPixelSize(R.dimen.recents_task_view_z_min);
  mMaxTranslationZ=res.getDimensionPixelSize(R.dimen.recents_task_view_z_max);
  mContext=context;
  mFreeformLayoutAlgorithm=new FreeformWorkspaceLayoutAlgorithm(context);
  mLinearOutSlowInInterpolator=AnimationUtils.loadInterpolator(context,com.android.internal.R.interpolator.linear_out_slow_in);
}

Fixed version (ground truth):
public TaskStackLayoutAlgorithm(Context context,TaskStackLayoutAlgorithmCallbacks cb){
  Resources res=context.getResources();
  mContext=context;
  mCb=cb;
  mFocusedRange=new Range(res.getFloat(R.integer.recents_layout_focused_range_min),res.getFloat(R.integer.recents_layout_focused_range_max));
  mUnfocusedRange=new Range(res.getFloat(R.integer.recents_layout_unfocused_range_min),res.getFloat(R.integer.recents_layout_unfocused_range_max));
  mFocusState=getDefaultFocusState();
  mFocusedPeekHeight=res.getDimensionPixelSize(R.dimen.recents_layout_focused_peek_size);
  mMinTranslationZ=res.getDimensionPixelSize(R.dimen.recents_task_view_z_min);
  mMaxTranslationZ=res.getDimensionPixelSize(R.dimen.recents_task_view_z_max);
  mFreeformLayoutAlgorithm=new FreeformWorkspaceLayoutAlgorithm(context);
  mLinearOutSlowInInterpolator=AnimationUtils.loadInterpolator(context,com.android.internal.R.interpolator.linear_out_slow_in);
}
Program: 192866
Project: 192866
Buggy source:
/** 
 * Posts an update to synchronize the   {@link TaskView}s with the stack on the next frame.
 */
void relayoutTaskViewsOnNextFrame(TaskViewAnimation animation){
  mDeferredTaskViewLayoutAnimation=animation;
  postInvalidateOnAnimation();
}

Fixed version (ground truth):
/** 
 * Posts an update to synchronize the   {@link TaskView}s with the stack on the next frame.
 */
void relayoutTaskViewsOnNextFrame(TaskViewAnimation animation){
  mDeferredTaskViewLayoutAnimation=animation;
  invalidate();
}
Program: 192867
Project: 192867
Buggy source:
public TaskStackViewScroller(Context context,TaskStackLayoutAlgorithm layoutAlgorithm){
  mContext=context;
  mScroller=new OverScroller(context);
  mLayoutAlgorithm=layoutAlgorithm;
  mLinearOutSlowInInterpolator=AnimationUtils.loadInterpolator(context,com.android.internal.R.interpolator.linear_out_slow_in);
}

Fixed version (ground truth):
public TaskStackViewScroller(Context context,TaskStackViewScrollerCallbacks cb,TaskStackLayoutAlgorithm layoutAlgorithm){
  mContext=context;
  mCb=cb;
  mScroller=new OverScroller(context);
  mLayoutAlgorithm=layoutAlgorithm;
  mLinearOutSlowInInterpolator=AnimationUtils.loadInterpolator(context,com.android.internal.R.interpolator.linear_out_slow_in);
}
Program: 192868
Project: 192868
Buggy source:
/** 
 * Animates the stack scroll 
 */
void animateScroll(float curScroll,float newScroll,final Runnable postRunnable){
  if (mScrollAnimator != null && mScrollAnimator.isRunning()) {
    setStackScroll(mFinalAnimatedScroll);
    mScroller.startScroll(0,progressToScrollRange(mFinalAnimatedScroll),0,0,0);
  }
  stopScroller();
  stopBoundScrollAnimation();
  mFinalAnimatedScroll=newScroll;
  mScrollAnimator=ObjectAnimator.ofFloat(this,"String_Node_Str",curScroll,newScroll);
  mScrollAnimator.setDuration(mContext.getResources().getInteger(R.integer.recents_animate_task_stack_scroll_duration));
  mScrollAnimator.setInterpolator(mLinearOutSlowInInterpolator);
  mScrollAnimator.addListener(new AnimatorListenerAdapter(){
    @Override public void onAnimationEnd(    Animator animation){
      if (postRunnable != null) {
        postRunnable.run();
      }
      mScrollAnimator.removeAllListeners();
    }
  }
);
  mScrollAnimator.start();
}

Fixed version (ground truth):
/** 
 * Animates the stack scroll 
 */
void animateScroll(float curScroll,float newScroll,final Runnable postRunnable){
  if (mScrollAnimator != null && mScrollAnimator.isRunning()) {
    setStackScroll(mFinalAnimatedScroll);
    mScroller.startScroll(0,progressToScrollRange(mFinalAnimatedScroll),0,0,0);
  }
  stopScroller();
  stopBoundScrollAnimation();
  mFinalAnimatedScroll=newScroll;
  mScrollAnimator=ObjectAnimator.ofFloat(this,STACK_SCROLL,curScroll,newScroll);
  mScrollAnimator.setDuration(mContext.getResources().getInteger(R.integer.recents_animate_task_stack_scroll_duration));
  mScrollAnimator.setInterpolator(mLinearOutSlowInInterpolator);
  mScrollAnimator.addListener(new AnimatorListenerAdapter(){
    @Override public void onAnimationEnd(    Animator animation){
      if (postRunnable != null) {
        postRunnable.run();
      }
      mScrollAnimator.removeAllListeners();
    }
  }
);
  mScrollAnimator.start();
}
Program: 192869
Project: 192869
Buggy source:
@Override public void onAnimationEnd(Animator animation){
  if (onFinishedRunnable != null) {
    onFinishedRunnable.run();
  }
  if (!mWasCancelled) {
    mAppearAnimationFraction=-1;
    setOutlineRect(null);
    enableAppearDrawing(false);
  }
}

Fixed version (ground truth):
@Override public void onAnimationEnd(Animator animation){
  if (onFinishedRunnable != null) {
    onFinishedRunnable.run();
  }
  if (!mWasCancelled) {
    enableAppearDrawing(false);
  }
}
Program: 192870
Project: 192870
Buggy source:
private void cancelAppearAnimation(){
  if (mAppearAnimator != null) {
    mAppearAnimator.cancel();
  }
}

Fixed version (ground truth):
private void cancelAppearAnimation(){
  if (mAppearAnimator != null) {
    mAppearAnimator.cancel();
    mAppearAnimator=null;
  }
}
Program: 192872
Project: 192872
Buggy source:
/** 
 * When we draw the appear animation, we render the view in a bitmap and render this bitmap as a shader of a rect. This call creates the Bitmap and switches the drawing mode, such that the normal drawing of the views does not happen anymore.
 * @param enable Should it be enabled.
 */
private void enableAppearDrawing(boolean enable){
  if (enable != mDrawingAppearAnimation) {
    mDrawingAppearAnimation=enable;
    if (!enable) {
      setContentAlpha(1.0f);
    }
    invalidate();
  }
}

Fixed version (ground truth):
/** 
 * When we draw the appear animation, we render the view in a bitmap and render this bitmap as a shader of a rect. This call creates the Bitmap and switches the drawing mode, such that the normal drawing of the views does not happen anymore.
 * @param enable Should it be enabled.
 */
private void enableAppearDrawing(boolean enable){
  if (enable != mDrawingAppearAnimation) {
    mDrawingAppearAnimation=enable;
    if (!enable) {
      setContentAlpha(1.0f);
      mAppearAnimationFraction=-1;
      setOutlineRect(null);
    }
    invalidate();
  }
}
Program: 192873
Project: 192873
Buggy source:
/** 
 * Computes the selection given the previously-computed start- and end-indices for each row and column.
 */
private void updateSelection(int columnStartIndex,int columnEndIndex,int rowStartIndex,int rowEndIndex){
  mSelection.clear();
  for (int column=columnStartIndex; column <= columnEndIndex; column++) {
    SparseIntArray items=mColumns.get(mColumnBounds.get(column).lowerLimit);
    for (int row=rowStartIndex; row <= rowEndIndex; row++) {
      int position=items.get(items.keyAt(row),NOT_SET);
      if (position != NOT_SET) {
        String id=mAdapter.getModelId(position);
        if (id != null) {
          mSelection.add(id);
        }
        if (isPossiblePositionNearestOrigin(column,columnStartIndex,columnEndIndex,row,rowStartIndex,rowEndIndex)) {
          mPositionNearestOrigin=position;
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Computes the selection given the previously-computed start- and end-indices for each row and column.
 */
private void updateSelection(int columnStartIndex,int columnEndIndex,int rowStartIndex,int rowEndIndex){
  if (DEBUG)   Log.d(TAG,String.format("String_Node_Str",columnStartIndex,columnEndIndex,rowStartIndex,rowEndIndex));
  mSelection.clear();
  for (int column=columnStartIndex; column <= columnEndIndex; column++) {
    SparseIntArray items=mColumns.get(mColumnBounds.get(column).lowerLimit);
    for (int row=rowStartIndex; row <= rowEndIndex; row++) {
      final int rowKey=mRowBounds.get(row).lowerLimit;
      int position=items.get(rowKey,NOT_SET);
      if (position != NOT_SET) {
        String id=mAdapter.getModelId(position);
        if (id != null) {
          mSelection.add(id);
        }
        if (isPossiblePositionNearestOrigin(column,columnStartIndex,columnEndIndex,row,rowStartIndex,rowEndIndex)) {
          mPositionNearestOrigin=position;
        }
      }
    }
  }
}
Program: 192874
Project: 192874
Buggy source:
/** 
 * Queries the view for all children and records their location metadata.
 */
private void recordVisibleChildren(){
  for (int i=0; i < mHelper.getVisibleChildCount(); i++) {
    int adapterPosition=mHelper.getAdapterPositionAt(i);
    if (!mKnownPositions.get(adapterPosition)) {
      mKnownPositions.put(adapterPosition,true);
      recordItemData(mHelper.getAbsoluteRectForChildViewAt(i),adapterPosition);
    }
  }
}

Fixed version (ground truth):
/** 
 * Queries the view for all children and records their location metadata.
 */
private void recordVisibleChildren(){
  for (int i=0; i < mHelper.getVisibleChildCount(); i++) {
    int adapterPosition=mHelper.getAdapterPositionAt(i);
    if (!mHelper.isLayoutItem(adapterPosition) && !mKnownPositions.get(adapterPosition)) {
      mKnownPositions.put(adapterPosition,true);
      recordItemData(mHelper.getAbsoluteRectForChildViewAt(i),adapterPosition);
    }
  }
}
Program: 192875
Project: 192875
Buggy source:
/** 
 * Computes the selection given the previously-computed start- and end-indices for each row and column.
 */
private void updateSelection(int columnStartIndex,int columnEndIndex,int rowStartIndex,int rowEndIndex){
  mSelection.clear();
  for (int column=columnStartIndex; column <= columnEndIndex; column++) {
    SparseIntArray items=mColumns.get(mColumnBounds.get(column).lowerLimit);
    for (int row=rowStartIndex; row <= rowEndIndex; row++) {
      int position=items.get(items.keyAt(row),NOT_SET);
      if (position != NOT_SET) {
        String id=mAdapter.getModelId(position);
        if (id != null) {
          mSelection.add(id);
        }
        if (isPossiblePositionNearestOrigin(column,columnStartIndex,columnEndIndex,row,rowStartIndex,rowEndIndex)) {
          mPositionNearestOrigin=position;
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Computes the selection given the previously-computed start- and end-indices for each row and column.
 */
private void updateSelection(int columnStartIndex,int columnEndIndex,int rowStartIndex,int rowEndIndex){
  if (DEBUG)   Log.d(TAG,String.format("String_Node_Str",columnStartIndex,columnEndIndex,rowStartIndex,rowEndIndex));
  mSelection.clear();
  for (int column=columnStartIndex; column <= columnEndIndex; column++) {
    SparseIntArray items=mColumns.get(mColumnBounds.get(column).lowerLimit);
    for (int row=rowStartIndex; row <= rowEndIndex; row++) {
      final int rowKey=mRowBounds.get(row).lowerLimit;
      int position=items.get(rowKey,NOT_SET);
      if (position != NOT_SET) {
        String id=mAdapter.getModelId(position);
        if (id != null) {
          mSelection.add(id);
        }
        if (isPossiblePositionNearestOrigin(column,columnStartIndex,columnEndIndex,row,rowStartIndex,rowEndIndex)) {
          mPositionNearestOrigin=position;
        }
      }
    }
  }
}
Program: 192876
Project: 192876
Buggy source:
/** 
 * Queries the view for all children and records their location metadata.
 */
private void recordVisibleChildren(){
  for (int i=0; i < mHelper.getVisibleChildCount(); i++) {
    int adapterPosition=mHelper.getAdapterPositionAt(i);
    if (!mKnownPositions.get(adapterPosition)) {
      mKnownPositions.put(adapterPosition,true);
      recordItemData(mHelper.getAbsoluteRectForChildViewAt(i),adapterPosition);
    }
  }
}

Fixed version (ground truth):
/** 
 * Queries the view for all children and records their location metadata.
 */
private void recordVisibleChildren(){
  for (int i=0; i < mHelper.getVisibleChildCount(); i++) {
    int adapterPosition=mHelper.getAdapterPositionAt(i);
    if (!mHelper.isLayoutItem(adapterPosition) && !mKnownPositions.get(adapterPosition)) {
      mKnownPositions.put(adapterPosition,true);
      recordItemData(mHelper.getAbsoluteRectForChildViewAt(i),adapterPosition);
    }
  }
}
Program: 192877
Project: 192877
Buggy source:
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  super.onLayout(changed,left,top,right,bottom);
  if (mLayoutHeight != getHeight()) {
    mLayoutHeight=getHeight();
    mStatusBar.onPanelHeightChanged();
  }
  requestPanelHeightUpdate();
  mHasLayoutedSinceDown=true;
  if (mUpdateFlingOnLayout) {
    abortAnimations();
    fling(mUpdateFlingVelocity,true);
    mUpdateFlingOnLayout=false;
  }
}

Fixed version (ground truth):
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  super.onLayout(changed,left,top,right,bottom);
  mStatusBar.onPanelLaidOut();
  requestPanelHeightUpdate();
  mHasLayoutedSinceDown=true;
  if (mUpdateFlingOnLayout) {
    abortAnimations();
    fling(mUpdateFlingVelocity,true);
    mUpdateFlingOnLayout=false;
  }
}
Program: 192878
Project: 192878
Buggy source:
public void setContractedChild(View child){
  if (mContractedChild != null) {
    mContractedChild.animate().cancel();
    removeView(mContractedChild);
  }
  addView(child);
  mContractedChild=child;
  mContractedWrapper=NotificationViewWrapper.wrap(getContext(),child);
  selectLayout(false,true);
  mContractedWrapper.setDark(mDark,false,0);
  updateRoundRectClipping();
}

Fixed version (ground truth):
public void setContractedChild(View child){
  if (mContractedChild != null) {
    mContractedChild.animate().cancel();
    mContractedChild.removeOnLayoutChangeListener(mLayoutUpdater);
    removeView(mContractedChild);
  }
  addView(child);
  mContractedChild=child;
  mContractedChild.addOnLayoutChangeListener(mLayoutUpdater);
  mContractedWrapper=NotificationViewWrapper.wrap(getContext(),child);
  selectLayout(false,true);
  mContractedWrapper.setDark(mDark,false,0);
  updateRoundRectClipping();
}
Program: 192879
Project: 192879
Buggy source:
public void setDark(boolean dark,boolean fade,long delay){
  if (mDark == dark || mContractedChild == null)   return;
  mDark=dark;
  mContractedWrapper.setDark(dark && !mShowingLegacyBackground,fade,delay);
  if (mSingleLineView != null) {
    mSingleLineView.setDark(dark,fade,delay);
  }
}

Fixed version (ground truth):
public void setDark(boolean dark,boolean fade,long delay){
  if (mDark == dark || mContractedChild == null)   return;
  mDark=dark;
  dark=dark && !mShowingLegacyBackground;
  if (mVisibleType == VISIBLE_TYPE_CONTRACTED) {
    mContractedWrapper.setDark(dark,fade,delay);
  }
  if (mVisibleType == VISIBLE_TYPE_EXPANDED) {
    mExpandedWrapper.setDark(dark,fade,delay);
  }
  if (mVisibleType == VISIBLE_TYPE_HEADSUP) {
    mHeadsUpWrapper.setDark(dark,fade,delay);
  }
  if (mSingleLineView != null && mVisibleType == VISIBLE_TYPE_SINGLELINE) {
    mSingleLineView.setDark(dark,fade,delay);
  }
}
Program: 192880
Project: 192880
Buggy source:
public void setExpandedChild(View child){
  if (mExpandedChild != null) {
    mExpandedChild.animate().cancel();
    removeView(mExpandedChild);
  }
  addView(child);
  mExpandedChild=child;
  mExpandedWrapper=NotificationViewWrapper.wrap(getContext(),child);
  selectLayout(false,true);
  updateRoundRectClipping();
}

Fixed version (ground truth):
public void setExpandedChild(View child){
  if (mExpandedChild != null) {
    mExpandedChild.animate().cancel();
    mExpandedChild.removeOnLayoutChangeListener(mLayoutUpdater);
    removeView(mExpandedChild);
  }
  addView(child);
  mExpandedChild=child;
  mExpandedChild.addOnLayoutChangeListener(mLayoutUpdater);
  mExpandedWrapper=NotificationViewWrapper.wrap(getContext(),child);
  selectLayout(false,true);
  updateRoundRectClipping();
}
Program: 192881
Project: 192881
Buggy source:
public void setHeadsUpChild(View child){
  if (mHeadsUpChild != null) {
    mHeadsUpChild.animate().cancel();
    removeView(mHeadsUpChild);
  }
  addView(child);
  mHeadsUpChild=child;
  mHeadsUpWrapper=NotificationViewWrapper.wrap(getContext(),child);
  selectLayout(false,true);
  updateRoundRectClipping();
}

Fixed version (ground truth):
public void setHeadsUpChild(View child){
  if (mHeadsUpChild != null) {
    mHeadsUpChild.animate().cancel();
    mHeadsUpChild.removeOnLayoutChangeListener(mLayoutUpdater);
    removeView(mHeadsUpChild);
  }
  addView(child);
  mHeadsUpChild=child;
  mHeadsUpChild.addOnLayoutChangeListener(mLayoutUpdater);
  mHeadsUpWrapper=NotificationViewWrapper.wrap(getContext(),child);
  selectLayout(false,true);
  updateRoundRectClipping();
}
Program: 192882
Project: 192882
Buggy source:
public HybridNotificationView bindFromNotification(HybridNotificationView reusableView,Notification notification){
  CharSequence titleText=resolveTitle(notification);
  if (titleText == null) {
    if (reusableView != null) {
      mParent.removeView(reusableView);
    }
    return null;
  }
  if (reusableView == null) {
    reusableView=inflateHybridView();
  }
  CharSequence contentText=resolveText(notification);
  reusableView.bind(titleText,contentText);
  return reusableView;
}

Fixed version (ground truth):
public HybridNotificationView bindFromNotification(HybridNotificationView reusableView,Notification notification){
  if (reusableView == null) {
    reusableView=inflateHybridView();
  }
  CharSequence titleText=resolveTitle(notification);
  CharSequence contentText=resolveText(notification);
  reusableView.bind(titleText,contentText);
  return reusableView;
}
Program: 192884
Project: 192884
Buggy source:
@Override public void run(){
  if (DEBUG_ATLAS)   Log.d(LOG_TAG,"String_Node_Str" + Thread.currentThread().getName());
  Atlas.Entry entry=new Atlas.Entry();
  for (  Atlas.Type type : Atlas.Type.values()) {
    for (int width=mEnd; width > mStart; width-=mStep) {
      for (int height=MAX_SIZE; height > MIN_SIZE; height-=STEP) {
        if (width * height <= mThreshold)         continue;
        final int count=packBitmaps(type,width,height,entry);
        if (count > 0) {
          mResults.add(new WorkerResult(type,width,height,count));
          if (count == mBitmaps.size()) {
            break;
          }
        }
      }
    }
  }
  if (mSignal != null) {
    mSignal.countDown();
  }
}

Fixed version (ground truth):
@Override public void run(){
  if (DEBUG_ATLAS)   Log.d(LOG_TAG,"String_Node_Str" + Thread.currentThread().getName());
  Atlas.Entry entry=new Atlas.Entry();
  for (int width=mEnd; width > mStart; width-=mStep) {
    for (int height=MAX_SIZE; height > MIN_SIZE; height-=STEP) {
      if (width * height <= mThreshold)       continue;
      boolean packSuccess=false;
      for (      Atlas.Type type : Atlas.Type.values()) {
        final int count=packBitmaps(type,width,height,entry);
        if (count > 0) {
          mResults.add(new WorkerResult(type,width,height,count));
          if (count == mBitmaps.size()) {
            packSuccess=true;
            break;
          }
        }
      }
      if (!packSuccess) {
        break;
      }
    }
  }
  if (mSignal != null) {
    mSignal.countDown();
  }
}
Program: 192885
Project: 192885
Buggy source:
@Override public void run(){
  if (DEBUG_ATLAS)   Log.d(LOG_TAG,"String_Node_Str" + Thread.currentThread().getName());
  Atlas.Entry entry=new Atlas.Entry();
  for (  Atlas.Type type : Atlas.Type.values()) {
    for (int width=mEnd; width > mStart; width-=mStep) {
      for (int height=MAX_SIZE; height > MIN_SIZE; height-=STEP) {
        if (width * height <= mThreshold)         continue;
        final int count=packBitmaps(type,width,height,entry);
        if (count > 0) {
          mResults.add(new WorkerResult(type,width,height,count));
          if (count == mBitmaps.size()) {
            break;
          }
        }
      }
    }
  }
  if (mSignal != null) {
    mSignal.countDown();
  }
}

Fixed version (ground truth):
@Override public void run(){
  if (DEBUG_ATLAS)   Log.d(LOG_TAG,"String_Node_Str" + Thread.currentThread().getName());
  Atlas.Entry entry=new Atlas.Entry();
  for (int width=mEnd; width > mStart; width-=mStep) {
    for (int height=MAX_SIZE; height > MIN_SIZE; height-=STEP) {
      if (width * height <= mThreshold)       continue;
      boolean packSuccess=false;
      for (      Atlas.Type type : Atlas.Type.values()) {
        final int count=packBitmaps(type,width,height,entry);
        if (count > 0) {
          mResults.add(new WorkerResult(type,width,height,count));
          if (count == mBitmaps.size()) {
            packSuccess=true;
            break;
          }
        }
      }
      if (!packSuccess) {
        break;
      }
    }
  }
  if (mSignal != null) {
    mSignal.countDown();
  }
}
Program: 192886
Project: 192886
Buggy source:
@Override public void run(){
  if (DEBUG_ATLAS)   Log.d(LOG_TAG,"String_Node_Str" + Thread.currentThread().getName());
  Atlas.Entry entry=new Atlas.Entry();
  for (  Atlas.Type type : Atlas.Type.values()) {
    for (int width=mEnd; width > mStart; width-=mStep) {
      for (int height=MAX_SIZE; height > MIN_SIZE; height-=STEP) {
        if (width * height <= mThreshold)         continue;
        final int count=packBitmaps(type,width,height,entry);
        if (count > 0) {
          mResults.add(new WorkerResult(type,width,height,count));
          if (count == mBitmaps.size()) {
            break;
          }
        }
      }
    }
  }
  if (mSignal != null) {
    mSignal.countDown();
  }
}

Fixed version (ground truth):
@Override public void run(){
  if (DEBUG_ATLAS)   Log.d(LOG_TAG,"String_Node_Str" + Thread.currentThread().getName());
  Atlas.Entry entry=new Atlas.Entry();
  for (int width=mEnd; width > mStart; width-=mStep) {
    for (int height=MAX_SIZE; height > MIN_SIZE; height-=STEP) {
      if (width * height <= mThreshold)       continue;
      boolean packSuccess=false;
      for (      Atlas.Type type : Atlas.Type.values()) {
        final int count=packBitmaps(type,width,height,entry);
        if (count > 0) {
          mResults.add(new WorkerResult(type,width,height,count));
          if (count == mBitmaps.size()) {
            packSuccess=true;
            break;
          }
        }
      }
      if (!packSuccess) {
        break;
      }
    }
  }
  if (mSignal != null) {
    mSignal.countDown();
  }
}