nus-yam/ex-repair huggingface dataset:
Program: 199910
Project: 199910
Buggy source:
private void inflateKeyguardView(Bundle options){
  View v=mKeyguardHost.findViewById(R.id.keyguard_host_view);
  if (v != null) {
    mKeyguardHost.removeView(v);
  }
  final LayoutInflater inflater=LayoutInflater.from(mContext);
  View view=inflater.inflate(HOST_LAYOUT,mKeyguardHost,true);
  mKeyguardView=(KeyguardViewBase)view.findViewById(R.id.keyguard_host_view);
  mKeyguardView.setLockPatternUtils(mLockPatternUtils);
  mKeyguardView.setViewMediatorCallback(mViewMediatorCallback);
  mKeyguardView.onUserSwitching(options != null && options.getBoolean(IS_SWITCHING_USER));
  if (mViewMediatorCallback != null) {
    KeyguardPasswordView kpv=(KeyguardPasswordView)mKeyguardView.findViewById(R.id.keyguard_password_view);
    if (kpv != null) {
      mViewMediatorCallback.setNeedsInput(kpv.needsInput());
    }
  }
  mKeyguardView.onCreateOptions(options);
}

Fixed version (ground truth):
private KeyguardViewBase inflateKeyguardView(Bundle options,int layoutId){
  View v=mKeyguardHost.findViewById(R.id.keyguard_host_view);
  if (v != null) {
    mKeyguardHost.removeView(v);
  }
  final LayoutInflater inflater=LayoutInflater.from(mContext);
  View view=inflater.inflate(layoutId,mKeyguardHost,true);
  KeyguardViewBase keyguard=(KeyguardViewBase)view.findViewById(R.id.keyguard_host_view);
  keyguard.setLockPatternUtils(mLockPatternUtils);
  keyguard.setViewMediatorCallback(mViewMediatorCallback);
  keyguard.onUserSwitching(options != null && options.getBoolean(IS_SWITCHING_USER));
  keyguard.onCreateOptions(options);
  return keyguard;
}
Program: 199913
Project: 199913
Buggy source:
@LayoutlibDelegate static void nativeDraw(long canvas_instance,Rect loc,long bitmap_instance,long chunk,long paint_instance_or_null,int destDensity,int srcDensity){
  draw(canvas_instance,loc.left,loc.top,loc.width(),loc.height(),bitmap_instance,chunk,paint_instance_or_null,destDensity,srcDensity);
}

Fixed version (ground truth):
@LayoutlibDelegate static void nativeDraw(long canvas_instance,Rect loc,long bitmap_instance,long chunk,long paint_instance_or_null,int destDensity,int srcDensity){
  draw(canvas_instance,loc.left,loc.top,loc.right,loc.bottom,bitmap_instance,chunk,paint_instance_or_null,destDensity,srcDensity);
}
Program: 199914
Project: 199914
Buggy source:
@LayoutlibDelegate static void nativeDraw(long canvas_instance,Rect loc,long bitmap_instance,long chunk,long paint_instance_or_null,int destDensity,int srcDensity){
  draw(canvas_instance,loc.left,loc.top,loc.width(),loc.height(),bitmap_instance,chunk,paint_instance_or_null,destDensity,srcDensity);
}

Fixed version (ground truth):
@LayoutlibDelegate static void nativeDraw(long canvas_instance,Rect loc,long bitmap_instance,long chunk,long paint_instance_or_null,int destDensity,int srcDensity){
  draw(canvas_instance,loc.left,loc.top,loc.right,loc.bottom,bitmap_instance,chunk,paint_instance_or_null,destDensity,srcDensity);
}
Program: 199915
Project: 199915
Buggy source:
@LayoutlibDelegate static void nativeDraw(long canvas_instance,Rect loc,long bitmap_instance,long chunk,long paint_instance_or_null,int destDensity,int srcDensity){
  draw(canvas_instance,loc.left,loc.top,loc.width(),loc.height(),bitmap_instance,chunk,paint_instance_or_null,destDensity,srcDensity);
}

Fixed version (ground truth):
@LayoutlibDelegate static void nativeDraw(long canvas_instance,Rect loc,long bitmap_instance,long chunk,long paint_instance_or_null,int destDensity,int srcDensity){
  draw(canvas_instance,loc.left,loc.top,loc.right,loc.bottom,bitmap_instance,chunk,paint_instance_or_null,destDensity,srcDensity);
}
Program: 199916
Project: 199916
Buggy source:
@LayoutlibDelegate static void nativeDraw(int canvas_instance,Rect loc,int bitmap_instance,int chunk,int paint_instance_or_null,int destDensity,int srcDensity){
  draw(canvas_instance,loc.left,loc.top,loc.width(),loc.height(),bitmap_instance,chunk,paint_instance_or_null,destDensity,srcDensity);
}

Fixed version (ground truth):
@LayoutlibDelegate static void nativeDraw(int canvas_instance,Rect loc,int bitmap_instance,int chunk,int paint_instance_or_null,int destDensity,int srcDensity){
  draw(canvas_instance,loc.left,loc.top,loc.right,loc.bottom,bitmap_instance,chunk,paint_instance_or_null,destDensity,srcDensity);
}
Program: 199917
Project: 199917
Buggy source:
@LayoutlibDelegate static void nativeDraw(int canvas_instance,Rect loc,int bitmap_instance,int chunk,int paint_instance_or_null,int destDensity,int srcDensity){
  draw(canvas_instance,loc.left,loc.top,loc.width(),loc.height(),bitmap_instance,chunk,paint_instance_or_null,destDensity,srcDensity);
}

Fixed version (ground truth):
@LayoutlibDelegate static void nativeDraw(int canvas_instance,Rect loc,int bitmap_instance,int chunk,int paint_instance_or_null,int destDensity,int srcDensity){
  draw(canvas_instance,loc.left,loc.top,loc.right,loc.bottom,bitmap_instance,chunk,paint_instance_or_null,destDensity,srcDensity);
}
Program: 199918
Project: 199918
Buggy source:
@LayoutlibDelegate static void nativeDraw(long canvas_instance,Rect loc,long bitmap_instance,long chunk,long paint_instance_or_null,int destDensity,int srcDensity){
  draw(canvas_instance,loc.left,loc.top,loc.width(),loc.height(),bitmap_instance,chunk,paint_instance_or_null,destDensity,srcDensity);
}

Fixed version (ground truth):
@LayoutlibDelegate static void nativeDraw(long canvas_instance,Rect loc,long bitmap_instance,long chunk,long paint_instance_or_null,int destDensity,int srcDensity){
  draw(canvas_instance,loc.left,loc.top,loc.right,loc.bottom,bitmap_instance,chunk,paint_instance_or_null,destDensity,srcDensity);
}
Program: 199921
Project: 199921
Buggy source:
@Override public void onRtlPropertiesChanged(int layoutDirection){
  super.onRtlPropertiesChanged(layoutDirection);
  mTextDir=getTextDirectionHeuristic();
}

Fixed version (ground truth):
@Override public void onRtlPropertiesChanged(int layoutDirection){
  super.onRtlPropertiesChanged(layoutDirection);
  mTextDir=getTextDirectionHeuristic();
  if (mLayout != null) {
    checkForRelayout();
  }
}
Program: 199923
Project: 199923
Buggy source:
@Override public void onRtlPropertiesChanged(int layoutDirection){
  super.onRtlPropertiesChanged(layoutDirection);
  mTextDir=getTextDirectionHeuristic();
}

Fixed version (ground truth):
@Override public void onRtlPropertiesChanged(int layoutDirection){
  super.onRtlPropertiesChanged(layoutDirection);
  mTextDir=getTextDirectionHeuristic();
  if (mLayout != null) {
    checkForRelayout();
  }
}
Program: 199924
Project: 199924
Buggy source:
public void handleExternalCameraEvent(MotionEvent event){
  beginCameraEvent();
  int cameraPage=getPageCount() - 1;
  boolean endWarp=false;
  if (isCameraPage(cameraPage) || mCameraEventInProgress) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
      mCameraEventInProgress=true;
    userActivity();
  startPageWarp(cameraPage);
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
mCameraEventInProgress=false;
endWarp=isWarping();
break;
}
dispatchTouchEvent(event);
if (endWarp) stopPageWarp();
}
endCameraEvent();
}

Fixed version (ground truth):
public void handleExternalCameraEvent(MotionEvent event){
  beginCameraEvent();
  int cameraPage=getPageCount() - 1;
  boolean endWarp=false;
  if (isCameraPage(cameraPage) || mCameraEventInProgress) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
      mCameraEventInProgress=true;
    userActivity();
  break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
mCameraEventInProgress=false;
break;
}
dispatchTouchEvent(event);
}
endCameraEvent();
}
Program: 199925
Project: 199925
Buggy source:
protected void pageBeginMoving(){
  if (DEBUG_WARP)   Log.v(TAG,"String_Node_Str" + mIsPageMoving + "String_Node_Str");
  if (!mIsPageMoving) {
    mIsPageMoving=true;
    if (isWarping()) {
      dispatchOnPageBeginWarp();
      if (mPageSwapIndex != -1) {
        swapPages(mPageSwapIndex,mPageWarpIndex);
      }
    }
    onPageBeginMoving();
  }
}

Fixed version (ground truth):
protected void pageBeginMoving(){
  if (DEBUG_WARP)   Log.v(TAG,"String_Node_Str" + mIsPageMoving + "String_Node_Str");
  if (!mIsPageMoving) {
    mIsPageMoving=true;
    if (isWarping()) {
      dispatchOnPageBeginWarp();
    }
    onPageBeginMoving();
  }
}
Program: 199926
Project: 199926
Buggy source:
@Override public void onAnimationEnd(Animator animation){
  mWarpAnimation=null;
  mWarpPageExposed=false;
}

Fixed version (ground truth):
@Override public void onAnimationEnd(Animator animation){
  mWarpAnimation=null;
  mWarpPageExposed=false;
  KeyguardWidgetFrame v=(KeyguardWidgetFrame)getPageAt(getPageWarpIndex());
  v.setTranslationX(0.0f);
}
Program: 199927
Project: 199927
Buggy source:
@Override public void onAnimationCancel(Animator animation){
  mDragView=null;
}

Fixed version (ground truth):
@Override public void onAnimationCancel(Animator animation){
  super.onAnimationCancel(animation);
  mWarpAnimation=null;
}
Program: 199928
Project: 199928
Buggy source:
protected boolean determineScrollingStart(MotionEvent ev){
  final int pointerIndex=ev.findPointerIndex(mActivePointerId);
  if (pointerIndex == -1)   return false;
  final float x=ev.getX(pointerIndex);
  final float y=ev.getY(pointerIndex);
  if (!isTouchPointInViewportWithBuffer((int)x,(int)y))   return false;
  if (mOnlyAllowEdgeSwipes && !mDownEventOnEdge)   return false;
  final int xDiff=(int)Math.abs(x - mLastMotionX);
  final int yDiff=(int)Math.abs(y - mLastMotionY);
  final int touchSlop=Math.round(TOUCH_SLOP_SCALE * mTouchSlop);
  boolean xPaged=xDiff > mPagingTouchSlop;
  boolean xMoved=xDiff > touchSlop;
  boolean yMoved=yDiff > touchSlop;
  return (xMoved || xPaged || yMoved) && (mUsePagingTouchSlop ? xPaged : xMoved);
}

Fixed version (ground truth):
protected boolean determineScrollingStart(MotionEvent ev){
  final int pointerIndex=ev.findPointerIndex(mActivePointerId);
  if (pointerIndex == -1)   return false;
  final float x=ev.getX(pointerIndex);
  final float y=ev.getY(pointerIndex);
  if (!isTouchPointInViewportWithBuffer((int)x,(int)y))   return false;
  if (mOnlyAllowEdgeSwipes && !mDownEventOnEdge)   return false;
  final int xDiff=(int)Math.abs(x - mLastMotionX);
  final int touchSlop=Math.round(TOUCH_SLOP_SCALE * mTouchSlop);
  boolean xPaged=xDiff > mPagingTouchSlop;
  boolean xMoved=xDiff > touchSlop;
  return mUsePagingTouchSlop ? xPaged : xMoved;
}
Program: 199929
Project: 199929
Buggy source:
private void cancelWarpAnimation(String msg,boolean abortAnimation){
  if (DEBUG_WARP)   Log.v(TAG,"String_Node_Str" + msg + "String_Node_Str"+ abortAnimation+ "String_Node_Str");
  if (abortAnimation) {
    KeyguardWidgetFrame v=(KeyguardWidgetFrame)getPageAt(mPageWarpIndex);
    v.animate().cancel();
    scrollBy(Math.round(-v.getTranslationX()),0);
    v.setTranslationX(0);
  }
 else {
    animateWarpPageOffScreen("String_Node_Str",true);
  }
}

Fixed version (ground truth):
private void cancelWarpAnimation(String msg,boolean abortAnimation){
  if (DEBUG_WARP)   Log.v(TAG,"String_Node_Str" + msg + "String_Node_Str"+ abortAnimation+ "String_Node_Str");
  if (abortAnimation) {
    KeyguardWidgetFrame v=(KeyguardWidgetFrame)getPageAt(getPageWarpIndex());
    v.animate().cancel();
    scrollBy(Math.round(-v.getTranslationX()),0);
    v.setTranslationX(0);
  }
 else {
    animateWarpPageOffScreen("String_Node_Str",true);
  }
}
Program: 199930
Project: 199930
Buggy source:
protected void snapToPage(int whichPage,int delta,int duration,boolean immediate){
  if (mPageSwapIndex != -1 && whichPage == mPageSwapIndex) {
    mNextPage=mPageWarpIndex;
    if (DEBUG_WARP)     Log.v(TAG,"String_Node_Str" + whichPage + "String_Node_Str");
  }
 else {
    mNextPage=whichPage;
  }
  if (isWarping()) {
    dispatchOnPageEndWarp();
    notifyPageSwitching(whichPage);
    resetPageWarp();
  }
 else {
    notifyPageSwitching(whichPage);
  }
  View focusedChild=getFocusedChild();
  if (focusedChild != null && whichPage != mCurrentPage && focusedChild == getPageAt(mCurrentPage)) {
    focusedChild.clearFocus();
  }
  pageBeginMoving();
  awakenScrollBars(duration);
  if (immediate) {
    duration=0;
  }
 else   if (duration == 0) {
    duration=Math.abs(delta);
  }
  if (!mScroller.isFinished())   mScroller.abortAnimation();
  mScroller.startScroll(mUnboundedScrollX,0,delta,0,duration);
  notifyPageSwitched();
  if (immediate) {
    computeScroll();
  }
  mForceScreenScrolled=true;
  invalidate();
}

Fixed version (ground truth):
protected void snapToPage(int whichPage,int delta,int duration,boolean immediate){
  if (isWarping() && whichPage == mCurrentPage + 1) {
    mNextPage=getPageWarpIndex();
    if (DEBUG_WARP)     Log.v(TAG,"String_Node_Str" + whichPage + "String_Node_Str");
  }
 else {
    mNextPage=whichPage;
  }
  if (mWarpPageExposed) {
    dispatchOnPageEndWarp();
    mWarpPageExposed=false;
  }
  notifyPageSwitching(whichPage);
  View focusedChild=getFocusedChild();
  if (focusedChild != null && whichPage != mCurrentPage && focusedChild == getPageAt(mCurrentPage)) {
    focusedChild.clearFocus();
  }
  pageBeginMoving();
  awakenScrollBars(duration);
  if (immediate) {
    duration=0;
  }
 else   if (duration == 0) {
    duration=Math.abs(delta);
  }
  if (!mScroller.isFinished())   mScroller.abortAnimation();
  mScroller.startScroll(mUnboundedScrollX,0,delta,0,duration);
  notifyPageSwitched();
  if (immediate) {
    computeScroll();
  }
  mForceScreenScrolled=true;
  invalidate();
}
Program: 199931
Project: 199931
Buggy source:
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  if (!mIsDataReady || getChildCount() == 0) {
    return;
  }
  if (DEBUG)   Log.d(TAG,"String_Node_Str");
  final int childCount=getChildCount();
  int offsetX=getViewportOffsetX();
  int offsetY=getViewportOffsetY();
  mViewport.offset(offsetX,offsetY);
  int childLeft=offsetX + getRelativeChildOffset(0);
  for (int i=0; i < childCount; i++) {
    final View child=getPageAt(i);
    int childTop=offsetY + getPaddingTop();
    if (child.getVisibility() != View.GONE) {
      final int childWidth=getScaledMeasuredWidth(child);
      final int childHeight=child.getMeasuredHeight();
      if (DEBUG)       Log.d(TAG,"String_Node_Str" + i + "String_Node_Str"+ childLeft+ "String_Node_Str"+ childTop);
      child.layout(childLeft,childTop,childLeft + child.getMeasuredWidth(),childTop + childHeight);
      childLeft+=childWidth + mPageSpacing;
    }
  }
  if (mFirstLayout && mCurrentPage >= 0 && mCurrentPage < getChildCount()) {
    setHorizontalScrollBarEnabled(false);
    updateCurrentPageScroll();
    setHorizontalScrollBarEnabled(true);
    mFirstLayout=false;
  }
  if (mPageSwapIndex != -1) {
    if (DEBUG_WARP)     Log.v(TAG,"String_Node_Str");
    swapPages(mPageSwapIndex,mPageWarpIndex);
  }
}

Fixed version (ground truth):
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  if (!mIsDataReady || getChildCount() == 0) {
    return;
  }
  if (DEBUG)   Log.d(TAG,"String_Node_Str");
  final int childCount=getChildCount();
  int offsetX=getViewportOffsetX();
  int offsetY=getViewportOffsetY();
  mViewport.offset(offsetX,offsetY);
  int childLeft=offsetX + getRelativeChildOffset(0);
  for (int i=0; i < childCount; i++) {
    final View child=getPageAt(i);
    int childTop=offsetY + getPaddingTop();
    if (child.getVisibility() != View.GONE) {
      final int childWidth=getScaledMeasuredWidth(child);
      final int childHeight=child.getMeasuredHeight();
      if (DEBUG)       Log.d(TAG,"String_Node_Str" + i + "String_Node_Str"+ childLeft+ "String_Node_Str"+ childTop);
      child.layout(childLeft,childTop,childLeft + child.getMeasuredWidth(),childTop + childHeight);
      childLeft+=childWidth + mPageSpacing;
    }
  }
  if (mFirstLayout && mCurrentPage >= 0 && mCurrentPage < getChildCount()) {
    setHorizontalScrollBarEnabled(false);
    updateCurrentPageScroll();
    setHorizontalScrollBarEnabled(true);
    mFirstLayout=false;
  }
}
Program: 199932
Project: 199932
Buggy source:
protected void pageEndMoving(){
  if (DEBUG_WARP)   Log.v(TAG,"String_Node_Str" + mIsPageMoving + "String_Node_Str");
  if (mIsPageMoving) {
    mIsPageMoving=false;
    if (isWarping()) {
      if (mPageSwapIndex != -1) {
        swapPages(mPageSwapIndex,mPageWarpIndex);
      }
      dispatchOnPageEndWarp();
      resetPageWarp();
    }
    onPageEndMoving();
  }
}

Fixed version (ground truth):
protected void pageEndMoving(){
  if (DEBUG_WARP)   Log.v(TAG,"String_Node_Str" + mIsPageMoving + "String_Node_Str");
  if (mIsPageMoving) {
    mIsPageMoving=false;
    if (isWarping()) {
      dispatchOnPageEndWarp();
      mWarpPageExposed=false;
    }
    onPageEndMoving();
  }
}
Program: 199933
Project: 199933
Buggy source:
private void animateWarpPageOnScreen(String reason){
  if (DEBUG_WARP)   Log.v(TAG,"String_Node_Str" + reason + "String_Node_Str");
  if (isWarping() && !mWarpPageExposed) {
    mWarpPageExposed=true;
    dispatchOnPageBeginWarp();
    KeyguardWidgetFrame v=(KeyguardWidgetFrame)getPageAt(mPageWarpIndex);
    if (DEBUG_WARP)     Log.v(TAG,"String_Node_Str" + v.getTranslationX());
    DecelerateInterpolator interp=new DecelerateInterpolator(1.5f);
    mWarpAnimation=v.animate();
    mWarpAnimation.translationX(mWarpPeekAmount).setInterpolator(interp).setDuration(WARP_PEEK_ANIMATION_DURATION).setListener(mOnScreenAnimationListener);
  }
}

Fixed version (ground truth):
private void animateWarpPageOnScreen(String reason){
  if (DEBUG_WARP)   Log.v(TAG,"String_Node_Str" + reason + "String_Node_Str");
  if (!mWarpPageExposed) {
    mWarpPageExposed=true;
    dispatchOnPageBeginWarp();
    KeyguardWidgetFrame v=(KeyguardWidgetFrame)getPageAt(getPageWarpIndex());
    if (DEBUG_WARP)     Log.v(TAG,"String_Node_Str" + v.getTranslationX());
    DecelerateInterpolator interp=new DecelerateInterpolator(1.5f);
    int totalOffset=getCurrentWarpOffset();
    v.setTranslationX(totalOffset);
    mWarpAnimation=v.animate();
    mWarpAnimation.translationX(mWarpPeekAmount + totalOffset).setInterpolator(interp).setDuration(WARP_PEEK_ANIMATION_DURATION).setListener(mOnScreenAnimationListener);
  }
}
Program: 199935
Project: 199935
Buggy source:
protected boolean isWarping(){
  return mPageWarpIndex != -1;
}

Fixed version (ground truth):
protected boolean isWarping(){
  return mWarpPageExposed;
}
Program: 199936
Project: 199936
Buggy source:
private void animateWarpPageOffScreen(String reason,boolean animate){
  if (DEBUG_WARP)   Log.v(TAG,"String_Node_Str" + reason + "String_Node_Str"+ animate+ "String_Node_Str");
  if (isWarping()) {
    dispatchOnPageEndWarp();
    KeyguardWidgetFrame v=(KeyguardWidgetFrame)getPageAt(mPageWarpIndex);
    if (DEBUG_WARP)     Log.v(TAG,"String_Node_Str" + v.getTranslationX());
    AccelerateInterpolator interp=new AccelerateInterpolator(1.5f);
    v.animate().translationX(0.0f).setInterpolator(interp).setDuration(animate ? WARP_PEEK_ANIMATION_DURATION : 0).setListener(mOffScreenAnimationListener);
  }
 else {
    if (DEBUG_WARP)     Log.e(TAG,"String_Node_Str",new Exception());
  }
}

Fixed version (ground truth):
private void animateWarpPageOffScreen(String reason,boolean animate){
  if (DEBUG_WARP)   Log.v(TAG,"String_Node_Str" + reason + "String_Node_Str"+ animate+ "String_Node_Str");
  if (mWarpPageExposed) {
    dispatchOnPageEndWarp();
    KeyguardWidgetFrame v=(KeyguardWidgetFrame)getPageAt(getPageWarpIndex());
    if (DEBUG_WARP)     Log.v(TAG,"String_Node_Str" + v.getTranslationX());
    AccelerateInterpolator interp=new AccelerateInterpolator(1.5f);
    int totalOffset=getCurrentWarpOffset();
    v.animate().translationX(totalOffset).setInterpolator(interp).setDuration(animate ? WARP_PEEK_ANIMATION_DURATION : 0).setListener(mOffScreenAnimationListener);
  }
 else {
    if (DEBUG_WARP)     Log.e(TAG,"String_Node_Str",new Exception());
  }
}
Program: 199937
Project: 199937
Buggy source:
protected int getPageWarpIndex(){
  return mPageWarpIndex;
}

Fixed version (ground truth):
protected int getPageWarpIndex(){
  return getPageCount() - 1;
}
Program: 199938
Project: 199938
Buggy source:
public void handleExternalCameraEvent(MotionEvent event){
  beginCameraEvent();
  int cameraPage=getPageCount() - 1;
  boolean endWarp=false;
  if (isCameraPage(cameraPage) || mCameraEventInProgress) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
      mCameraEventInProgress=true;
    userActivity();
  startPageWarp(cameraPage);
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
mCameraEventInProgress=false;
endWarp=isWarping();
break;
}
dispatchTouchEvent(event);
if (endWarp) stopPageWarp();
}
endCameraEvent();
}

Fixed version (ground truth):
public void handleExternalCameraEvent(MotionEvent event){
  beginCameraEvent();
  int cameraPage=getPageCount() - 1;
  boolean endWarp=false;
  if (isCameraPage(cameraPage) || mCameraEventInProgress) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
      mCameraEventInProgress=true;
    userActivity();
  break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
mCameraEventInProgress=false;
break;
}
dispatchTouchEvent(event);
}
endCameraEvent();
}
Program: 199939
Project: 199939
Buggy source:
protected void pageBeginMoving(){
  if (DEBUG_WARP)   Log.v(TAG,"String_Node_Str" + mIsPageMoving + "String_Node_Str");
  if (!mIsPageMoving) {
    mIsPageMoving=true;
    if (isWarping()) {
      dispatchOnPageBeginWarp();
      if (mPageSwapIndex != -1) {
        swapPages(mPageSwapIndex,mPageWarpIndex);
      }
    }
    onPageBeginMoving();
  }
}

Fixed version (ground truth):
protected void pageBeginMoving(){
  if (DEBUG_WARP)   Log.v(TAG,"String_Node_Str" + mIsPageMoving + "String_Node_Str");
  if (!mIsPageMoving) {
    mIsPageMoving=true;
    if (isWarping()) {
      dispatchOnPageBeginWarp();
    }
    onPageBeginMoving();
  }
}
Program: 199940
Project: 199940
Buggy source:
@Override public void onAnimationEnd(Animator animation){
  mWarpAnimation=null;
  mWarpPageExposed=false;
}

Fixed version (ground truth):
@Override public void onAnimationEnd(Animator animation){
  mWarpAnimation=null;
  mWarpPageExposed=false;
  KeyguardWidgetFrame v=(KeyguardWidgetFrame)getPageAt(getPageWarpIndex());
  v.setTranslationX(0.0f);
}
Program: 199941
Project: 199941
Buggy source:
@Override public void onAnimationCancel(Animator animation){
  mDragView=null;
}

Fixed version (ground truth):
@Override public void onAnimationCancel(Animator animation){
  super.onAnimationCancel(animation);
  mWarpAnimation=null;
}
Program: 199942
Project: 199942
Buggy source:
protected boolean determineScrollingStart(MotionEvent ev){
  final int pointerIndex=ev.findPointerIndex(mActivePointerId);
  if (pointerIndex == -1)   return false;
  final float x=ev.getX(pointerIndex);
  final float y=ev.getY(pointerIndex);
  if (!isTouchPointInViewportWithBuffer((int)x,(int)y))   return false;
  if (mOnlyAllowEdgeSwipes && !mDownEventOnEdge)   return false;
  final int xDiff=(int)Math.abs(x - mLastMotionX);
  final int yDiff=(int)Math.abs(y - mLastMotionY);
  final int touchSlop=Math.round(TOUCH_SLOP_SCALE * mTouchSlop);
  boolean xPaged=xDiff > mPagingTouchSlop;
  boolean xMoved=xDiff > touchSlop;
  boolean yMoved=yDiff > touchSlop;
  return (xMoved || xPaged || yMoved) && (mUsePagingTouchSlop ? xPaged : xMoved);
}

Fixed version (ground truth):
protected boolean determineScrollingStart(MotionEvent ev){
  final int pointerIndex=ev.findPointerIndex(mActivePointerId);
  if (pointerIndex == -1)   return false;
  final float x=ev.getX(pointerIndex);
  final float y=ev.getY(pointerIndex);
  if (!isTouchPointInViewportWithBuffer((int)x,(int)y))   return false;
  if (mOnlyAllowEdgeSwipes && !mDownEventOnEdge)   return false;
  final int xDiff=(int)Math.abs(x - mLastMotionX);
  final int touchSlop=Math.round(TOUCH_SLOP_SCALE * mTouchSlop);
  boolean xPaged=xDiff > mPagingTouchSlop;
  boolean xMoved=xDiff > touchSlop;
  return mUsePagingTouchSlop ? xPaged : xMoved;
}
Program: 199943
Project: 199943
Buggy source:
private void cancelWarpAnimation(String msg,boolean abortAnimation){
  if (DEBUG_WARP)   Log.v(TAG,"String_Node_Str" + msg + "String_Node_Str"+ abortAnimation+ "String_Node_Str");
  if (abortAnimation) {
    KeyguardWidgetFrame v=(KeyguardWidgetFrame)getPageAt(mPageWarpIndex);
    v.animate().cancel();
    scrollBy(Math.round(-v.getTranslationX()),0);
    v.setTranslationX(0);
  }
 else {
    animateWarpPageOffScreen("String_Node_Str",true);
  }
}

Fixed version (ground truth):
private void cancelWarpAnimation(String msg,boolean abortAnimation){
  if (DEBUG_WARP)   Log.v(TAG,"String_Node_Str" + msg + "String_Node_Str"+ abortAnimation+ "String_Node_Str");
  if (abortAnimation) {
    KeyguardWidgetFrame v=(KeyguardWidgetFrame)getPageAt(getPageWarpIndex());
    v.animate().cancel();
    scrollBy(Math.round(-v.getTranslationX()),0);
    v.setTranslationX(0);
  }
 else {
    animateWarpPageOffScreen("String_Node_Str",true);
  }
}
Program: 199944
Project: 199944
Buggy source:
protected void snapToPage(int whichPage,int delta,int duration,boolean immediate){
  if (mPageSwapIndex != -1 && whichPage == mPageSwapIndex) {
    mNextPage=mPageWarpIndex;
    if (DEBUG_WARP)     Log.v(TAG,"String_Node_Str" + whichPage + "String_Node_Str");
  }
 else {
    mNextPage=whichPage;
  }
  if (isWarping()) {
    dispatchOnPageEndWarp();
    notifyPageSwitching(whichPage);
    resetPageWarp();
  }
 else {
    notifyPageSwitching(whichPage);
  }
  View focusedChild=getFocusedChild();
  if (focusedChild != null && whichPage != mCurrentPage && focusedChild == getPageAt(mCurrentPage)) {
    focusedChild.clearFocus();
  }
  pageBeginMoving();
  awakenScrollBars(duration);
  if (immediate) {
    duration=0;
  }
 else   if (duration == 0) {
    duration=Math.abs(delta);
  }
  if (!mScroller.isFinished())   mScroller.abortAnimation();
  mScroller.startScroll(mUnboundedScrollX,0,delta,0,duration);
  notifyPageSwitched();
  if (immediate) {
    computeScroll();
  }
  mForceScreenScrolled=true;
  invalidate();
}

Fixed version (ground truth):
protected void snapToPage(int whichPage,int delta,int duration,boolean immediate){
  if (isWarping() && whichPage == mCurrentPage + 1) {
    mNextPage=getPageWarpIndex();
    if (DEBUG_WARP)     Log.v(TAG,"String_Node_Str" + whichPage + "String_Node_Str");
  }
 else {
    mNextPage=whichPage;
  }
  if (mWarpPageExposed) {
    dispatchOnPageEndWarp();
    mWarpPageExposed=false;
  }
  notifyPageSwitching(whichPage);
  View focusedChild=getFocusedChild();
  if (focusedChild != null && whichPage != mCurrentPage && focusedChild == getPageAt(mCurrentPage)) {
    focusedChild.clearFocus();
  }
  pageBeginMoving();
  awakenScrollBars(duration);
  if (immediate) {
    duration=0;
  }
 else   if (duration == 0) {
    duration=Math.abs(delta);
  }
  if (!mScroller.isFinished())   mScroller.abortAnimation();
  mScroller.startScroll(mUnboundedScrollX,0,delta,0,duration);
  notifyPageSwitched();
  if (immediate) {
    computeScroll();
  }
  mForceScreenScrolled=true;
  invalidate();
}
Program: 199945
Project: 199945
Buggy source:
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  if (!mIsDataReady || getChildCount() == 0) {
    return;
  }
  if (DEBUG)   Log.d(TAG,"String_Node_Str");
  final int childCount=getChildCount();
  int offsetX=getViewportOffsetX();
  int offsetY=getViewportOffsetY();
  mViewport.offset(offsetX,offsetY);
  int childLeft=offsetX + getRelativeChildOffset(0);
  for (int i=0; i < childCount; i++) {
    final View child=getPageAt(i);
    int childTop=offsetY + getPaddingTop();
    if (child.getVisibility() != View.GONE) {
      final int childWidth=getScaledMeasuredWidth(child);
      final int childHeight=child.getMeasuredHeight();
      if (DEBUG)       Log.d(TAG,"String_Node_Str" + i + "String_Node_Str"+ childLeft+ "String_Node_Str"+ childTop);
      child.layout(childLeft,childTop,childLeft + child.getMeasuredWidth(),childTop + childHeight);
      childLeft+=childWidth + mPageSpacing;
    }
  }
  if (mFirstLayout && mCurrentPage >= 0 && mCurrentPage < getChildCount()) {
    setHorizontalScrollBarEnabled(false);
    updateCurrentPageScroll();
    setHorizontalScrollBarEnabled(true);
    mFirstLayout=false;
  }
  if (mPageSwapIndex != -1) {
    if (DEBUG_WARP)     Log.v(TAG,"String_Node_Str");
    swapPages(mPageSwapIndex,mPageWarpIndex);
  }
}

Fixed version (ground truth):
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  if (!mIsDataReady || getChildCount() == 0) {
    return;
  }
  if (DEBUG)   Log.d(TAG,"String_Node_Str");
  final int childCount=getChildCount();
  int offsetX=getViewportOffsetX();
  int offsetY=getViewportOffsetY();
  mViewport.offset(offsetX,offsetY);
  int childLeft=offsetX + getRelativeChildOffset(0);
  for (int i=0; i < childCount; i++) {
    final View child=getPageAt(i);
    int childTop=offsetY + getPaddingTop();
    if (child.getVisibility() != View.GONE) {
      final int childWidth=getScaledMeasuredWidth(child);
      final int childHeight=child.getMeasuredHeight();
      if (DEBUG)       Log.d(TAG,"String_Node_Str" + i + "String_Node_Str"+ childLeft+ "String_Node_Str"+ childTop);
      child.layout(childLeft,childTop,childLeft + child.getMeasuredWidth(),childTop + childHeight);
      childLeft+=childWidth + mPageSpacing;
    }
  }
  if (mFirstLayout && mCurrentPage >= 0 && mCurrentPage < getChildCount()) {
    setHorizontalScrollBarEnabled(false);
    updateCurrentPageScroll();
    setHorizontalScrollBarEnabled(true);
    mFirstLayout=false;
  }
}
Program: 199946
Project: 199946
Buggy source:
protected void pageEndMoving(){
  if (DEBUG_WARP)   Log.v(TAG,"String_Node_Str" + mIsPageMoving + "String_Node_Str");
  if (mIsPageMoving) {
    mIsPageMoving=false;
    if (isWarping()) {
      if (mPageSwapIndex != -1) {
        swapPages(mPageSwapIndex,mPageWarpIndex);
      }
      dispatchOnPageEndWarp();
      resetPageWarp();
    }
    onPageEndMoving();
  }
}

Fixed version (ground truth):
protected void pageEndMoving(){
  if (DEBUG_WARP)   Log.v(TAG,"String_Node_Str" + mIsPageMoving + "String_Node_Str");
  if (mIsPageMoving) {
    mIsPageMoving=false;
    if (isWarping()) {
      dispatchOnPageEndWarp();
      mWarpPageExposed=false;
    }
    onPageEndMoving();
  }
}
Program: 199947
Project: 199947
Buggy source:
private void animateWarpPageOnScreen(String reason){
  if (DEBUG_WARP)   Log.v(TAG,"String_Node_Str" + reason + "String_Node_Str");
  if (isWarping() && !mWarpPageExposed) {
    mWarpPageExposed=true;
    dispatchOnPageBeginWarp();
    KeyguardWidgetFrame v=(KeyguardWidgetFrame)getPageAt(mPageWarpIndex);
    if (DEBUG_WARP)     Log.v(TAG,"String_Node_Str" + v.getTranslationX());
    DecelerateInterpolator interp=new DecelerateInterpolator(1.5f);
    mWarpAnimation=v.animate();
    mWarpAnimation.translationX(mWarpPeekAmount).setInterpolator(interp).setDuration(WARP_PEEK_ANIMATION_DURATION).setListener(mOnScreenAnimationListener);
  }
}

Fixed version (ground truth):
private void animateWarpPageOnScreen(String reason){
  if (DEBUG_WARP)   Log.v(TAG,"String_Node_Str" + reason + "String_Node_Str");
  if (!mWarpPageExposed) {
    mWarpPageExposed=true;
    dispatchOnPageBeginWarp();
    KeyguardWidgetFrame v=(KeyguardWidgetFrame)getPageAt(getPageWarpIndex());
    if (DEBUG_WARP)     Log.v(TAG,"String_Node_Str" + v.getTranslationX());
    DecelerateInterpolator interp=new DecelerateInterpolator(1.5f);
    int totalOffset=getCurrentWarpOffset();
    v.setTranslationX(totalOffset);
    mWarpAnimation=v.animate();
    mWarpAnimation.translationX(mWarpPeekAmount + totalOffset).setInterpolator(interp).setDuration(WARP_PEEK_ANIMATION_DURATION).setListener(mOnScreenAnimationListener);
  }
}
Program: 199949
Project: 199949
Buggy source:
protected boolean isWarping(){
  return mPageWarpIndex != -1;
}

Fixed version (ground truth):
protected boolean isWarping(){
  return mWarpPageExposed;
}
Program: 199950
Project: 199950
Buggy source:
private void animateWarpPageOffScreen(String reason,boolean animate){
  if (DEBUG_WARP)   Log.v(TAG,"String_Node_Str" + reason + "String_Node_Str"+ animate+ "String_Node_Str");
  if (isWarping()) {
    dispatchOnPageEndWarp();
    KeyguardWidgetFrame v=(KeyguardWidgetFrame)getPageAt(mPageWarpIndex);
    if (DEBUG_WARP)     Log.v(TAG,"String_Node_Str" + v.getTranslationX());
    AccelerateInterpolator interp=new AccelerateInterpolator(1.5f);
    v.animate().translationX(0.0f).setInterpolator(interp).setDuration(animate ? WARP_PEEK_ANIMATION_DURATION : 0).setListener(mOffScreenAnimationListener);
  }
 else {
    if (DEBUG_WARP)     Log.e(TAG,"String_Node_Str",new Exception());
  }
}

Fixed version (ground truth):
private void animateWarpPageOffScreen(String reason,boolean animate){
  if (DEBUG_WARP)   Log.v(TAG,"String_Node_Str" + reason + "String_Node_Str"+ animate+ "String_Node_Str");
  if (mWarpPageExposed) {
    dispatchOnPageEndWarp();
    KeyguardWidgetFrame v=(KeyguardWidgetFrame)getPageAt(getPageWarpIndex());
    if (DEBUG_WARP)     Log.v(TAG,"String_Node_Str" + v.getTranslationX());
    AccelerateInterpolator interp=new AccelerateInterpolator(1.5f);
    int totalOffset=getCurrentWarpOffset();
    v.animate().translationX(totalOffset).setInterpolator(interp).setDuration(animate ? WARP_PEEK_ANIMATION_DURATION : 0).setListener(mOffScreenAnimationListener);
  }
 else {
    if (DEBUG_WARP)     Log.e(TAG,"String_Node_Str",new Exception());
  }
}
Program: 199951
Project: 199951
Buggy source:
protected int getPageWarpIndex(){
  return mPageWarpIndex;
}

Fixed version (ground truth):
protected int getPageWarpIndex(){
  return getPageCount() - 1;
}
Program: 199952
Project: 199952
Buggy source:
public void handleExternalCameraEvent(MotionEvent event){
  beginCameraEvent();
  int cameraPage=getPageCount() - 1;
  boolean endWarp=false;
  if (isCameraPage(cameraPage) || mCameraEventInProgress) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
      mCameraEventInProgress=true;
    userActivity();
  startPageWarp(cameraPage);
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
mCameraEventInProgress=false;
endWarp=isWarping();
break;
}
dispatchTouchEvent(event);
if (endWarp) stopPageWarp();
}
endCameraEvent();
}

Fixed version (ground truth):
public void handleExternalCameraEvent(MotionEvent event){
  beginCameraEvent();
  int cameraPage=getPageCount() - 1;
  boolean endWarp=false;
  if (isCameraPage(cameraPage) || mCameraEventInProgress) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
      mCameraEventInProgress=true;
    userActivity();
  break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
mCameraEventInProgress=false;
break;
}
dispatchTouchEvent(event);
}
endCameraEvent();
}
Program: 199953
Project: 199953
Buggy source:
protected void pageBeginMoving(){
  if (DEBUG_WARP)   Log.v(TAG,"String_Node_Str" + mIsPageMoving + "String_Node_Str");
  if (!mIsPageMoving) {
    mIsPageMoving=true;
    if (isWarping()) {
      dispatchOnPageBeginWarp();
      if (mPageSwapIndex != -1) {
        swapPages(mPageSwapIndex,mPageWarpIndex);
      }
    }
    onPageBeginMoving();
  }
}

Fixed version (ground truth):
protected void pageBeginMoving(){
  if (DEBUG_WARP)   Log.v(TAG,"String_Node_Str" + mIsPageMoving + "String_Node_Str");
  if (!mIsPageMoving) {
    mIsPageMoving=true;
    if (isWarping()) {
      dispatchOnPageBeginWarp();
    }
    onPageBeginMoving();
  }
}
Program: 199954
Project: 199954
Buggy source:
@Override public void onAnimationEnd(Animator animation){
  mWarpAnimation=null;
  mWarpPageExposed=false;
}

Fixed version (ground truth):
@Override public void onAnimationEnd(Animator animation){
  mWarpAnimation=null;
  mWarpPageExposed=false;
  KeyguardWidgetFrame v=(KeyguardWidgetFrame)getPageAt(getPageWarpIndex());
  v.setTranslationX(0.0f);
}
Program: 199955
Project: 199955
Buggy source:
@Override public void onAnimationCancel(Animator animation){
  mDragView=null;
}

Fixed version (ground truth):
@Override public void onAnimationCancel(Animator animation){
  super.onAnimationCancel(animation);
  mWarpAnimation=null;
}
Program: 199956
Project: 199956
Buggy source:
protected boolean determineScrollingStart(MotionEvent ev){
  final int pointerIndex=ev.findPointerIndex(mActivePointerId);
  if (pointerIndex == -1)   return false;
  final float x=ev.getX(pointerIndex);
  final float y=ev.getY(pointerIndex);
  if (!isTouchPointInViewportWithBuffer((int)x,(int)y))   return false;
  if (mOnlyAllowEdgeSwipes && !mDownEventOnEdge)   return false;
  final int xDiff=(int)Math.abs(x - mLastMotionX);
  final int yDiff=(int)Math.abs(y - mLastMotionY);
  final int touchSlop=Math.round(TOUCH_SLOP_SCALE * mTouchSlop);
  boolean xPaged=xDiff > mPagingTouchSlop;
  boolean xMoved=xDiff > touchSlop;
  boolean yMoved=yDiff > touchSlop;
  return (xMoved || xPaged || yMoved) && (mUsePagingTouchSlop ? xPaged : xMoved);
}

Fixed version (ground truth):
protected boolean determineScrollingStart(MotionEvent ev){
  final int pointerIndex=ev.findPointerIndex(mActivePointerId);
  if (pointerIndex == -1)   return false;
  final float x=ev.getX(pointerIndex);
  final float y=ev.getY(pointerIndex);
  if (!isTouchPointInViewportWithBuffer((int)x,(int)y))   return false;
  if (mOnlyAllowEdgeSwipes && !mDownEventOnEdge)   return false;
  final int xDiff=(int)Math.abs(x - mLastMotionX);
  final int touchSlop=Math.round(TOUCH_SLOP_SCALE * mTouchSlop);
  boolean xPaged=xDiff > mPagingTouchSlop;
  boolean xMoved=xDiff > touchSlop;
  return mUsePagingTouchSlop ? xPaged : xMoved;
}
Program: 199957
Project: 199957
Buggy source:
private void cancelWarpAnimation(String msg,boolean abortAnimation){
  if (DEBUG_WARP)   Log.v(TAG,"String_Node_Str" + msg + "String_Node_Str"+ abortAnimation+ "String_Node_Str");
  if (abortAnimation) {
    KeyguardWidgetFrame v=(KeyguardWidgetFrame)getPageAt(mPageWarpIndex);
    v.animate().cancel();
    scrollBy(Math.round(-v.getTranslationX()),0);
    v.setTranslationX(0);
  }
 else {
    animateWarpPageOffScreen("String_Node_Str",true);
  }
}

Fixed version (ground truth):
private void cancelWarpAnimation(String msg,boolean abortAnimation){
  if (DEBUG_WARP)   Log.v(TAG,"String_Node_Str" + msg + "String_Node_Str"+ abortAnimation+ "String_Node_Str");
  if (abortAnimation) {
    KeyguardWidgetFrame v=(KeyguardWidgetFrame)getPageAt(getPageWarpIndex());
    v.animate().cancel();
    scrollBy(Math.round(-v.getTranslationX()),0);
    v.setTranslationX(0);
  }
 else {
    animateWarpPageOffScreen("String_Node_Str",true);
  }
}
Program: 199958
Project: 199958
Buggy source:
protected void snapToPage(int whichPage,int delta,int duration,boolean immediate){
  if (mPageSwapIndex != -1 && whichPage == mPageSwapIndex) {
    mNextPage=mPageWarpIndex;
    if (DEBUG_WARP)     Log.v(TAG,"String_Node_Str" + whichPage + "String_Node_Str");
  }
 else {
    mNextPage=whichPage;
  }
  if (isWarping()) {
    dispatchOnPageEndWarp();
    notifyPageSwitching(whichPage);
    resetPageWarp();
  }
 else {
    notifyPageSwitching(whichPage);
  }
  View focusedChild=getFocusedChild();
  if (focusedChild != null && whichPage != mCurrentPage && focusedChild == getPageAt(mCurrentPage)) {
    focusedChild.clearFocus();
  }
  pageBeginMoving();
  awakenScrollBars(duration);
  if (immediate) {
    duration=0;
  }
 else   if (duration == 0) {
    duration=Math.abs(delta);
  }
  if (!mScroller.isFinished())   mScroller.abortAnimation();
  mScroller.startScroll(mUnboundedScrollX,0,delta,0,duration);
  notifyPageSwitched();
  if (immediate) {
    computeScroll();
  }
  mForceScreenScrolled=true;
  invalidate();
}

Fixed version (ground truth):
protected void snapToPage(int whichPage,int delta,int duration,boolean immediate){
  if (isWarping() && whichPage == mCurrentPage + 1) {
    mNextPage=getPageWarpIndex();
    if (DEBUG_WARP)     Log.v(TAG,"String_Node_Str" + whichPage + "String_Node_Str");
  }
 else {
    mNextPage=whichPage;
  }
  if (mWarpPageExposed) {
    dispatchOnPageEndWarp();
    mWarpPageExposed=false;
  }
  notifyPageSwitching(whichPage);
  View focusedChild=getFocusedChild();
  if (focusedChild != null && whichPage != mCurrentPage && focusedChild == getPageAt(mCurrentPage)) {
    focusedChild.clearFocus();
  }
  pageBeginMoving();
  awakenScrollBars(duration);
  if (immediate) {
    duration=0;
  }
 else   if (duration == 0) {
    duration=Math.abs(delta);
  }
  if (!mScroller.isFinished())   mScroller.abortAnimation();
  mScroller.startScroll(mUnboundedScrollX,0,delta,0,duration);
  notifyPageSwitched();
  if (immediate) {
    computeScroll();
  }
  mForceScreenScrolled=true;
  invalidate();
}
Program: 199959
Project: 199959
Buggy source:
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  if (!mIsDataReady || getChildCount() == 0) {
    return;
  }
  if (DEBUG)   Log.d(TAG,"String_Node_Str");
  final int childCount=getChildCount();
  int offsetX=getViewportOffsetX();
  int offsetY=getViewportOffsetY();
  mViewport.offset(offsetX,offsetY);
  int childLeft=offsetX + getRelativeChildOffset(0);
  for (int i=0; i < childCount; i++) {
    final View child=getPageAt(i);
    int childTop=offsetY + getPaddingTop();
    if (child.getVisibility() != View.GONE) {
      final int childWidth=getScaledMeasuredWidth(child);
      final int childHeight=child.getMeasuredHeight();
      if (DEBUG)       Log.d(TAG,"String_Node_Str" + i + "String_Node_Str"+ childLeft+ "String_Node_Str"+ childTop);
      child.layout(childLeft,childTop,childLeft + child.getMeasuredWidth(),childTop + childHeight);
      childLeft+=childWidth + mPageSpacing;
    }
  }
  if (mFirstLayout && mCurrentPage >= 0 && mCurrentPage < getChildCount()) {
    setHorizontalScrollBarEnabled(false);
    updateCurrentPageScroll();
    setHorizontalScrollBarEnabled(true);
    mFirstLayout=false;
  }
  if (mPageSwapIndex != -1) {
    if (DEBUG_WARP)     Log.v(TAG,"String_Node_Str");
    swapPages(mPageSwapIndex,mPageWarpIndex);
  }
}

Fixed version (ground truth):
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  if (!mIsDataReady || getChildCount() == 0) {
    return;
  }
  if (DEBUG)   Log.d(TAG,"String_Node_Str");
  final int childCount=getChildCount();
  int offsetX=getViewportOffsetX();
  int offsetY=getViewportOffsetY();
  mViewport.offset(offsetX,offsetY);
  int childLeft=offsetX + getRelativeChildOffset(0);
  for (int i=0; i < childCount; i++) {
    final View child=getPageAt(i);
    int childTop=offsetY + getPaddingTop();
    if (child.getVisibility() != View.GONE) {
      final int childWidth=getScaledMeasuredWidth(child);
      final int childHeight=child.getMeasuredHeight();
      if (DEBUG)       Log.d(TAG,"String_Node_Str" + i + "String_Node_Str"+ childLeft+ "String_Node_Str"+ childTop);
      child.layout(childLeft,childTop,childLeft + child.getMeasuredWidth(),childTop + childHeight);
      childLeft+=childWidth + mPageSpacing;
    }
  }
  if (mFirstLayout && mCurrentPage >= 0 && mCurrentPage < getChildCount()) {
    setHorizontalScrollBarEnabled(false);
    updateCurrentPageScroll();
    setHorizontalScrollBarEnabled(true);
    mFirstLayout=false;
  }
}
Program: 199960
Project: 199960
Buggy source:
protected void pageEndMoving(){
  if (DEBUG_WARP)   Log.v(TAG,"String_Node_Str" + mIsPageMoving + "String_Node_Str");
  if (mIsPageMoving) {
    mIsPageMoving=false;
    if (isWarping()) {
      if (mPageSwapIndex != -1) {
        swapPages(mPageSwapIndex,mPageWarpIndex);
      }
      dispatchOnPageEndWarp();
      resetPageWarp();
    }
    onPageEndMoving();
  }
}

Fixed version (ground truth):
protected void pageEndMoving(){
  if (DEBUG_WARP)   Log.v(TAG,"String_Node_Str" + mIsPageMoving + "String_Node_Str");
  if (mIsPageMoving) {
    mIsPageMoving=false;
    if (isWarping()) {
      dispatchOnPageEndWarp();
      mWarpPageExposed=false;
    }
    onPageEndMoving();
  }
}
Program: 199961
Project: 199961
Buggy source:
private void animateWarpPageOnScreen(String reason){
  if (DEBUG_WARP)   Log.v(TAG,"String_Node_Str" + reason + "String_Node_Str");
  if (isWarping() && !mWarpPageExposed) {
    mWarpPageExposed=true;
    dispatchOnPageBeginWarp();
    KeyguardWidgetFrame v=(KeyguardWidgetFrame)getPageAt(mPageWarpIndex);
    if (DEBUG_WARP)     Log.v(TAG,"String_Node_Str" + v.getTranslationX());
    DecelerateInterpolator interp=new DecelerateInterpolator(1.5f);
    mWarpAnimation=v.animate();
    mWarpAnimation.translationX(mWarpPeekAmount).setInterpolator(interp).setDuration(WARP_PEEK_ANIMATION_DURATION).setListener(mOnScreenAnimationListener);
  }
}

Fixed version (ground truth):
private void animateWarpPageOnScreen(String reason){
  if (DEBUG_WARP)   Log.v(TAG,"String_Node_Str" + reason + "String_Node_Str");
  if (!mWarpPageExposed) {
    mWarpPageExposed=true;
    dispatchOnPageBeginWarp();
    KeyguardWidgetFrame v=(KeyguardWidgetFrame)getPageAt(getPageWarpIndex());
    if (DEBUG_WARP)     Log.v(TAG,"String_Node_Str" + v.getTranslationX());
    DecelerateInterpolator interp=new DecelerateInterpolator(1.5f);
    int totalOffset=getCurrentWarpOffset();
    v.setTranslationX(totalOffset);
    mWarpAnimation=v.animate();
    mWarpAnimation.translationX(mWarpPeekAmount + totalOffset).setInterpolator(interp).setDuration(WARP_PEEK_ANIMATION_DURATION).setListener(mOnScreenAnimationListener);
  }
}
Program: 199963
Project: 199963
Buggy source:
protected boolean isWarping(){
  return mPageWarpIndex != -1;
}

Fixed version (ground truth):
protected boolean isWarping(){
  return mWarpPageExposed;
}
Program: 199964
Project: 199964
Buggy source:
private void animateWarpPageOffScreen(String reason,boolean animate){
  if (DEBUG_WARP)   Log.v(TAG,"String_Node_Str" + reason + "String_Node_Str"+ animate+ "String_Node_Str");
  if (isWarping()) {
    dispatchOnPageEndWarp();
    KeyguardWidgetFrame v=(KeyguardWidgetFrame)getPageAt(mPageWarpIndex);
    if (DEBUG_WARP)     Log.v(TAG,"String_Node_Str" + v.getTranslationX());
    AccelerateInterpolator interp=new AccelerateInterpolator(1.5f);
    v.animate().translationX(0.0f).setInterpolator(interp).setDuration(animate ? WARP_PEEK_ANIMATION_DURATION : 0).setListener(mOffScreenAnimationListener);
  }
 else {
    if (DEBUG_WARP)     Log.e(TAG,"String_Node_Str",new Exception());
  }
}

Fixed version (ground truth):
private void animateWarpPageOffScreen(String reason,boolean animate){
  if (DEBUG_WARP)   Log.v(TAG,"String_Node_Str" + reason + "String_Node_Str"+ animate+ "String_Node_Str");
  if (mWarpPageExposed) {
    dispatchOnPageEndWarp();
    KeyguardWidgetFrame v=(KeyguardWidgetFrame)getPageAt(getPageWarpIndex());
    if (DEBUG_WARP)     Log.v(TAG,"String_Node_Str" + v.getTranslationX());
    AccelerateInterpolator interp=new AccelerateInterpolator(1.5f);
    int totalOffset=getCurrentWarpOffset();
    v.animate().translationX(totalOffset).setInterpolator(interp).setDuration(animate ? WARP_PEEK_ANIMATION_DURATION : 0).setListener(mOffScreenAnimationListener);
  }
 else {
    if (DEBUG_WARP)     Log.e(TAG,"String_Node_Str",new Exception());
  }
}
Program: 199965
Project: 199965
Buggy source:
protected int getPageWarpIndex(){
  return mPageWarpIndex;
}

Fixed version (ground truth):
protected int getPageWarpIndex(){
  return getPageCount() - 1;
}