nus-yam/ex-repair huggingface dataset:
Program: 199708
Project: 199708
Buggy source:
public long getCurrentTimeUs(boolean refreshTime,boolean monotonic) throws IllegalStateException {
synchronized (this) {
    if (mPaused && !refreshTime) {
      return mLastReportedTime;
    }
    long nanoTime=System.nanoTime();
    if (refreshTime || nanoTime >= mLastNanoTime + MAX_NS_WITHOUT_POSITION_CHECK) {
      try {
        mLastTimeUs=mPlayer.getCurrentPosition() * 1000;
        mPaused=!mPlayer.isPlaying();
        if (DEBUG)         Log.v(TAG,(mPaused ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str" + mLastTimeUs);
      }
 catch (      IllegalStateException e) {
        if (mPausing) {
          mPausing=false;
          getEstimatedTime(nanoTime,monotonic);
          mPaused=true;
          if (DEBUG)           Log.d(TAG,"String_Node_Str" + mLastReportedTime);
          return mLastReportedTime;
        }
        throw e;
      }
      mLastNanoTime=nanoTime;
      if (monotonic && mLastTimeUs < mLastReportedTime) {
        mTimeAdjustment=mLastReportedTime - mLastTimeUs;
        if (mTimeAdjustment > 1000000) {
          mStopped=false;
          mSeeking=true;
          scheduleNotification(NOTIFY_SEEK,0);
        }
      }
 else {
        mTimeAdjustment=0;
      }
    }
    return getEstimatedTime(nanoTime,monotonic);
  }
}

Fixed version (ground truth):
public long getCurrentTimeUs(boolean refreshTime,boolean monotonic) throws IllegalStateException {
synchronized (this) {
    if (mPaused && !refreshTime) {
      return mLastReportedTime;
    }
    long nanoTime=System.nanoTime();
    if (refreshTime || nanoTime >= mLastNanoTime + MAX_NS_WITHOUT_POSITION_CHECK) {
      try {
        mLastTimeUs=mPlayer.getCurrentPosition() * 1000L;
        mPaused=!mPlayer.isPlaying();
        if (DEBUG)         Log.v(TAG,(mPaused ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str" + mLastTimeUs);
      }
 catch (      IllegalStateException e) {
        if (mPausing) {
          mPausing=false;
          getEstimatedTime(nanoTime,monotonic);
          mPaused=true;
          if (DEBUG)           Log.d(TAG,"String_Node_Str" + mLastReportedTime);
          return mLastReportedTime;
        }
        throw e;
      }
      mLastNanoTime=nanoTime;
      if (monotonic && mLastTimeUs < mLastReportedTime) {
        mTimeAdjustment=mLastReportedTime - mLastTimeUs;
        if (mTimeAdjustment > 1000000) {
          mStopped=false;
          mSeeking=true;
          scheduleNotification(NOTIFY_SEEK,0);
        }
      }
 else {
        mTimeAdjustment=0;
      }
    }
    return getEstimatedTime(nanoTime,monotonic);
  }
}
Program: 199709
Project: 199709
Buggy source:
/** 
 * Implement this to handle requests to delete one or more rows. The implementation should apply the selection clause when performing deletion, allowing the operation to affect multiple rows in a directory. As a courtesy, call   {@link ContentResolver#notifyChange(android.net.Uri,android.database.ContentObserver) notifyDelete()}after deleting. This method can be called from multiple threads, as described in <a href="  {@docRoot}guide/topics/fundamentals/processes-and-threads.html#Threads">Processes and Threads</a>. <p>The implementation is responsible for parsing out a row ID at the end of the URI, if a specific row is being deleted. That is, the client would pass in <code>content://contacts/people/22</code> and the implementation is responsible for parsing the record number (22) when creating a SQL statement.
 * @param uri The full URI to query, including a row ID (if a specific record is requested).
 * @param selection An optional restriction to apply to rows when deleting.
 * @return The number of rows affected.
 * @throws SQLException
 */
public abstract int delete(Uri uri,String selection,String[] selectionArgs);

Fixed version (ground truth):
/** 
 * Implement this to handle requests to delete one or more rows. The implementation should apply the selection clause when performing deletion, allowing the operation to affect multiple rows in a directory. As a courtesy, call   {@link ContentResolver#notifyChange(android.net.Uri,android.database.ContentObserver) notifyChange()}after deleting. This method can be called from multiple threads, as described in <a href="  {@docRoot}guide/topics/fundamentals/processes-and-threads.html#Threads">Processes and Threads</a>. <p>The implementation is responsible for parsing out a row ID at the end of the URI, if a specific row is being deleted. That is, the client would pass in <code>content://contacts/people/22</code> and the implementation is responsible for parsing the record number (22) when creating a SQL statement.
 * @param uri The full URI to query, including a row ID (if a specific record is requested).
 * @param selection An optional restriction to apply to rows when deleting.
 * @return The number of rows affected.
 * @throws SQLException
 */
public abstract int delete(Uri uri,String selection,String[] selectionArgs);
Program: 199710
Project: 199710
Buggy source:
/** 
 * Sets the right position of this view relative to its parent. This method is meant to be called by the layout system and should not generally be called otherwise, because the property may be changed at any time by the layout.
 * @param right The bottom of this view, in pixels.
 */
public final void setRight(int right){
  if (right != mRight) {
    updateMatrix();
    final boolean matrixIsIdentity=mTransformationInfo == null || mTransformationInfo.mMatrixIsIdentity;
    if (matrixIsIdentity) {
      if (mAttachInfo != null) {
        int maxRight;
        if (right < mRight) {
          maxRight=mRight;
        }
 else {
          maxRight=right;
        }
        invalidate(0,0,maxRight - mLeft,mBottom - mTop);
      }
    }
 else {
      invalidate(true);
    }
    int oldWidth=mRight - mLeft;
    int height=mBottom - mTop;
    mRight=right;
    if (mDisplayList != null) {
      mDisplayList.setRight(mRight);
    }
    sizeChange(mRight - mLeft,height,oldWidth,height);
    if (!matrixIsIdentity) {
      if ((mPrivateFlags & PFLAG_PIVOT_EXPLICITLY_SET) == 0) {
        mTransformationInfo.mMatrixDirty=true;
      }
      mPrivateFlags|=PFLAG_DRAWN;
      invalidate(true);
    }
    mBackgroundSizeChanged=true;
    invalidateParentIfNeeded();
    if ((mPrivateFlags2 & PFLAG2_VIEW_QUICK_REJECTED) == PFLAG2_VIEW_QUICK_REJECTED) {
      invalidateParentIfNeeded();
    }
  }
}

Fixed version (ground truth):
/** 
 * Sets the right position of this view relative to its parent. This method is meant to be called by the layout system and should not generally be called otherwise, because the property may be changed at any time by the layout.
 * @param right The right of this view, in pixels.
 */
public final void setRight(int right){
  if (right != mRight) {
    updateMatrix();
    final boolean matrixIsIdentity=mTransformationInfo == null || mTransformationInfo.mMatrixIsIdentity;
    if (matrixIsIdentity) {
      if (mAttachInfo != null) {
        int maxRight;
        if (right < mRight) {
          maxRight=mRight;
        }
 else {
          maxRight=right;
        }
        invalidate(0,0,maxRight - mLeft,mBottom - mTop);
      }
    }
 else {
      invalidate(true);
    }
    int oldWidth=mRight - mLeft;
    int height=mBottom - mTop;
    mRight=right;
    if (mDisplayList != null) {
      mDisplayList.setRight(mRight);
    }
    sizeChange(mRight - mLeft,height,oldWidth,height);
    if (!matrixIsIdentity) {
      if ((mPrivateFlags & PFLAG_PIVOT_EXPLICITLY_SET) == 0) {
        mTransformationInfo.mMatrixDirty=true;
      }
      mPrivateFlags|=PFLAG_DRAWN;
      invalidate(true);
    }
    mBackgroundSizeChanged=true;
    invalidateParentIfNeeded();
    if ((mPrivateFlags2 & PFLAG2_VIEW_QUICK_REJECTED) == PFLAG2_VIEW_QUICK_REJECTED) {
      invalidateParentIfNeeded();
    }
  }
}
Program: 199711
Project: 199711
Buggy source:
/** 
 * Sets the left position of this view relative to its parent. This method is meant to be called by the layout system and should not generally be called otherwise, because the property may be changed at any time by the layout.
 * @param left The bottom of this view, in pixels.
 */
public final void setLeft(int left){
  if (left != mLeft) {
    updateMatrix();
    final boolean matrixIsIdentity=mTransformationInfo == null || mTransformationInfo.mMatrixIsIdentity;
    if (matrixIsIdentity) {
      if (mAttachInfo != null) {
        int minLeft;
        int xLoc;
        if (left < mLeft) {
          minLeft=left;
          xLoc=left - mLeft;
        }
 else {
          minLeft=mLeft;
          xLoc=0;
        }
        invalidate(xLoc,0,mRight - minLeft,mBottom - mTop);
      }
    }
 else {
      invalidate(true);
    }
    int oldWidth=mRight - mLeft;
    int height=mBottom - mTop;
    mLeft=left;
    if (mDisplayList != null) {
      mDisplayList.setLeft(left);
    }
    sizeChange(mRight - mLeft,height,oldWidth,height);
    if (!matrixIsIdentity) {
      if ((mPrivateFlags & PFLAG_PIVOT_EXPLICITLY_SET) == 0) {
        mTransformationInfo.mMatrixDirty=true;
      }
      mPrivateFlags|=PFLAG_DRAWN;
      invalidate(true);
    }
    mBackgroundSizeChanged=true;
    invalidateParentIfNeeded();
    if ((mPrivateFlags2 & PFLAG2_VIEW_QUICK_REJECTED) == PFLAG2_VIEW_QUICK_REJECTED) {
      invalidateParentIfNeeded();
    }
  }
}

Fixed version (ground truth):
/** 
 * Sets the left position of this view relative to its parent. This method is meant to be called by the layout system and should not generally be called otherwise, because the property may be changed at any time by the layout.
 * @param left The left of this view, in pixels.
 */
public final void setLeft(int left){
  if (left != mLeft) {
    updateMatrix();
    final boolean matrixIsIdentity=mTransformationInfo == null || mTransformationInfo.mMatrixIsIdentity;
    if (matrixIsIdentity) {
      if (mAttachInfo != null) {
        int minLeft;
        int xLoc;
        if (left < mLeft) {
          minLeft=left;
          xLoc=left - mLeft;
        }
 else {
          minLeft=mLeft;
          xLoc=0;
        }
        invalidate(xLoc,0,mRight - minLeft,mBottom - mTop);
      }
    }
 else {
      invalidate(true);
    }
    int oldWidth=mRight - mLeft;
    int height=mBottom - mTop;
    mLeft=left;
    if (mDisplayList != null) {
      mDisplayList.setLeft(left);
    }
    sizeChange(mRight - mLeft,height,oldWidth,height);
    if (!matrixIsIdentity) {
      if ((mPrivateFlags & PFLAG_PIVOT_EXPLICITLY_SET) == 0) {
        mTransformationInfo.mMatrixDirty=true;
      }
      mPrivateFlags|=PFLAG_DRAWN;
      invalidate(true);
    }
    mBackgroundSizeChanged=true;
    invalidateParentIfNeeded();
    if ((mPrivateFlags2 & PFLAG2_VIEW_QUICK_REJECTED) == PFLAG2_VIEW_QUICK_REJECTED) {
      invalidateParentIfNeeded();
    }
  }
}
Program: 199712
Project: 199712
Buggy source:
/** 
 * Implement this to handle requests to delete one or more rows. The implementation should apply the selection clause when performing deletion, allowing the operation to affect multiple rows in a directory. As a courtesy, call   {@link ContentResolver#notifyChange(android.net.Uri,android.database.ContentObserver) notifyDelete()}after deleting. This method can be called from multiple threads, as described in <a href="  {@docRoot}guide/topics/fundamentals/processes-and-threads.html#Threads">Processes and Threads</a>. <p>The implementation is responsible for parsing out a row ID at the end of the URI, if a specific row is being deleted. That is, the client would pass in <code>content://contacts/people/22</code> and the implementation is responsible for parsing the record number (22) when creating a SQL statement.
 * @param uri The full URI to query, including a row ID (if a specific record is requested).
 * @param selection An optional restriction to apply to rows when deleting.
 * @return The number of rows affected.
 * @throws SQLException
 */
public abstract int delete(Uri uri,String selection,String[] selectionArgs);

Fixed version (ground truth):
/** 
 * Implement this to handle requests to delete one or more rows. The implementation should apply the selection clause when performing deletion, allowing the operation to affect multiple rows in a directory. As a courtesy, call   {@link ContentResolver#notifyChange(android.net.Uri,android.database.ContentObserver) notifyChange()}after deleting. This method can be called from multiple threads, as described in <a href="  {@docRoot}guide/topics/fundamentals/processes-and-threads.html#Threads">Processes and Threads</a>. <p>The implementation is responsible for parsing out a row ID at the end of the URI, if a specific row is being deleted. That is, the client would pass in <code>content://contacts/people/22</code> and the implementation is responsible for parsing the record number (22) when creating a SQL statement.
 * @param uri The full URI to query, including a row ID (if a specific record is requested).
 * @param selection An optional restriction to apply to rows when deleting.
 * @return The number of rows affected.
 * @throws SQLException
 */
public abstract int delete(Uri uri,String selection,String[] selectionArgs);
Program: 199713
Project: 199713
Buggy source:
/** 
 * Sets the right position of this view relative to its parent. This method is meant to be called by the layout system and should not generally be called otherwise, because the property may be changed at any time by the layout.
 * @param right The bottom of this view, in pixels.
 */
public final void setRight(int right){
  if (right != mRight) {
    updateMatrix();
    final boolean matrixIsIdentity=mTransformationInfo == null || mTransformationInfo.mMatrixIsIdentity;
    if (matrixIsIdentity) {
      if (mAttachInfo != null) {
        int maxRight;
        if (right < mRight) {
          maxRight=mRight;
        }
 else {
          maxRight=right;
        }
        invalidate(0,0,maxRight - mLeft,mBottom - mTop);
      }
    }
 else {
      invalidate(true);
    }
    int oldWidth=mRight - mLeft;
    int height=mBottom - mTop;
    mRight=right;
    if (mDisplayList != null) {
      mDisplayList.setRight(mRight);
    }
    sizeChange(mRight - mLeft,height,oldWidth,height);
    if (!matrixIsIdentity) {
      if ((mPrivateFlags & PFLAG_PIVOT_EXPLICITLY_SET) == 0) {
        mTransformationInfo.mMatrixDirty=true;
      }
      mPrivateFlags|=PFLAG_DRAWN;
      invalidate(true);
    }
    mBackgroundSizeChanged=true;
    invalidateParentIfNeeded();
    if ((mPrivateFlags2 & PFLAG2_VIEW_QUICK_REJECTED) == PFLAG2_VIEW_QUICK_REJECTED) {
      invalidateParentIfNeeded();
    }
  }
}

Fixed version (ground truth):
/** 
 * Sets the right position of this view relative to its parent. This method is meant to be called by the layout system and should not generally be called otherwise, because the property may be changed at any time by the layout.
 * @param right The right of this view, in pixels.
 */
public final void setRight(int right){
  if (right != mRight) {
    updateMatrix();
    final boolean matrixIsIdentity=mTransformationInfo == null || mTransformationInfo.mMatrixIsIdentity;
    if (matrixIsIdentity) {
      if (mAttachInfo != null) {
        int maxRight;
        if (right < mRight) {
          maxRight=mRight;
        }
 else {
          maxRight=right;
        }
        invalidate(0,0,maxRight - mLeft,mBottom - mTop);
      }
    }
 else {
      invalidate(true);
    }
    int oldWidth=mRight - mLeft;
    int height=mBottom - mTop;
    mRight=right;
    if (mDisplayList != null) {
      mDisplayList.setRight(mRight);
    }
    sizeChange(mRight - mLeft,height,oldWidth,height);
    if (!matrixIsIdentity) {
      if ((mPrivateFlags & PFLAG_PIVOT_EXPLICITLY_SET) == 0) {
        mTransformationInfo.mMatrixDirty=true;
      }
      mPrivateFlags|=PFLAG_DRAWN;
      invalidate(true);
    }
    mBackgroundSizeChanged=true;
    invalidateParentIfNeeded();
    if ((mPrivateFlags2 & PFLAG2_VIEW_QUICK_REJECTED) == PFLAG2_VIEW_QUICK_REJECTED) {
      invalidateParentIfNeeded();
    }
  }
}
Program: 199714
Project: 199714
Buggy source:
/** 
 * Sets the left position of this view relative to its parent. This method is meant to be called by the layout system and should not generally be called otherwise, because the property may be changed at any time by the layout.
 * @param left The bottom of this view, in pixels.
 */
public final void setLeft(int left){
  if (left != mLeft) {
    updateMatrix();
    final boolean matrixIsIdentity=mTransformationInfo == null || mTransformationInfo.mMatrixIsIdentity;
    if (matrixIsIdentity) {
      if (mAttachInfo != null) {
        int minLeft;
        int xLoc;
        if (left < mLeft) {
          minLeft=left;
          xLoc=left - mLeft;
        }
 else {
          minLeft=mLeft;
          xLoc=0;
        }
        invalidate(xLoc,0,mRight - minLeft,mBottom - mTop);
      }
    }
 else {
      invalidate(true);
    }
    int oldWidth=mRight - mLeft;
    int height=mBottom - mTop;
    mLeft=left;
    if (mDisplayList != null) {
      mDisplayList.setLeft(left);
    }
    sizeChange(mRight - mLeft,height,oldWidth,height);
    if (!matrixIsIdentity) {
      if ((mPrivateFlags & PFLAG_PIVOT_EXPLICITLY_SET) == 0) {
        mTransformationInfo.mMatrixDirty=true;
      }
      mPrivateFlags|=PFLAG_DRAWN;
      invalidate(true);
    }
    mBackgroundSizeChanged=true;
    invalidateParentIfNeeded();
    if ((mPrivateFlags2 & PFLAG2_VIEW_QUICK_REJECTED) == PFLAG2_VIEW_QUICK_REJECTED) {
      invalidateParentIfNeeded();
    }
  }
}

Fixed version (ground truth):
/** 
 * Sets the left position of this view relative to its parent. This method is meant to be called by the layout system and should not generally be called otherwise, because the property may be changed at any time by the layout.
 * @param left The left of this view, in pixels.
 */
public final void setLeft(int left){
  if (left != mLeft) {
    updateMatrix();
    final boolean matrixIsIdentity=mTransformationInfo == null || mTransformationInfo.mMatrixIsIdentity;
    if (matrixIsIdentity) {
      if (mAttachInfo != null) {
        int minLeft;
        int xLoc;
        if (left < mLeft) {
          minLeft=left;
          xLoc=left - mLeft;
        }
 else {
          minLeft=mLeft;
          xLoc=0;
        }
        invalidate(xLoc,0,mRight - minLeft,mBottom - mTop);
      }
    }
 else {
      invalidate(true);
    }
    int oldWidth=mRight - mLeft;
    int height=mBottom - mTop;
    mLeft=left;
    if (mDisplayList != null) {
      mDisplayList.setLeft(left);
    }
    sizeChange(mRight - mLeft,height,oldWidth,height);
    if (!matrixIsIdentity) {
      if ((mPrivateFlags & PFLAG_PIVOT_EXPLICITLY_SET) == 0) {
        mTransformationInfo.mMatrixDirty=true;
      }
      mPrivateFlags|=PFLAG_DRAWN;
      invalidate(true);
    }
    mBackgroundSizeChanged=true;
    invalidateParentIfNeeded();
    if ((mPrivateFlags2 & PFLAG2_VIEW_QUICK_REJECTED) == PFLAG2_VIEW_QUICK_REJECTED) {
      invalidateParentIfNeeded();
    }
  }
}
Program: 199715
Project: 199715
Buggy source:
static public AllocationAdapter create2D(RenderScript rs,Allocation a){
  android.util.Log.e("String_Node_Str","String_Node_Str" + a);
  rs.validate();
  AllocationAdapter aa=new AllocationAdapter(0,rs,a);
  aa.mConstrainedLOD=true;
  aa.mConstrainedFace=true;
  aa.mConstrainedY=false;
  aa.mConstrainedZ=true;
  aa.initLOD(0);
  return aa;
}

Fixed version (ground truth):
static public AllocationAdapter create2D(RenderScript rs,Allocation a){
  rs.validate();
  AllocationAdapter aa=new AllocationAdapter(0,rs,a);
  aa.mConstrainedLOD=true;
  aa.mConstrainedFace=true;
  aa.mConstrainedY=false;
  aa.mConstrainedZ=true;
  aa.initLOD(0);
  return aa;
}
Program: 199716
Project: 199716
Buggy source:
private void helpDestroy(){
  boolean shouldDestroy=false;
synchronized (this) {
    if (!mDestroyed) {
      shouldDestroy=true;
      mDestroyed=true;
    }
  }
  if (shouldDestroy) {
    ReentrantReadWriteLock.ReadLock rlock=mRS.mRWLock.readLock();
    rlock.lock();
    if (mRS.isAlive()) {
      mRS.nObjDestroy(mID);
    }
    rlock.unlock();
    mRS=null;
    mID=0;
  }
}

Fixed version (ground truth):
private void helpDestroy(){
  boolean shouldDestroy=false;
synchronized (this) {
    if (!mDestroyed) {
      shouldDestroy=true;
      mDestroyed=true;
    }
  }
  if (shouldDestroy) {
    ReentrantReadWriteLock.ReadLock rlock=mRS.mRWLock.readLock();
    rlock.lock();
    if (mRS.isAlive() && mID != 0) {
      mRS.nObjDestroy(mID);
    }
    rlock.unlock();
    mRS=null;
    mID=0;
  }
}
Program: 199717
Project: 199717
Buggy source:
@Override public void onItemClick(AdapterView<?> parent,View view,int position,long id){
  mMenu.performItemAction(mAdapter.getItem(position),0);
}

Fixed version (ground truth):
@Override public void onItemClick(AdapterView<?> parent,View view,int position,long id){
  mMenu.performItemAction(mAdapter.getItem(position),this,0);
}
Program: 199718
Project: 199718
Buggy source:
private boolean dispatchSubMenuSelected(SubMenuBuilder subMenu){
  if (mPresenters.isEmpty())   return false;
  boolean result=false;
  for (  WeakReference<MenuPresenter> ref : mPresenters) {
    final MenuPresenter presenter=ref.get();
    if (presenter == null) {
      mPresenters.remove(ref);
    }
 else     if (!result) {
      result=presenter.onSubMenuSelected(subMenu);
    }
  }
  return result;
}

Fixed version (ground truth):
private boolean dispatchSubMenuSelected(SubMenuBuilder subMenu,MenuPresenter preferredPresenter){
  if (mPresenters.isEmpty())   return false;
  boolean result=false;
  if (preferredPresenter != null) {
    result=preferredPresenter.onSubMenuSelected(subMenu);
  }
  for (  WeakReference<MenuPresenter> ref : mPresenters) {
    final MenuPresenter presenter=ref.get();
    if (presenter == null) {
      mPresenters.remove(ref);
    }
 else     if (!result) {
      result=presenter.onSubMenuSelected(subMenu);
    }
  }
  return result;
}
Program: 199719
Project: 199719
Buggy source:
public boolean performItemAction(MenuItem item,int flags){
  MenuItemImpl itemImpl=(MenuItemImpl)item;
  if (itemImpl == null || !itemImpl.isEnabled()) {
    return false;
  }
  boolean invoked=itemImpl.invoke();
  final ActionProvider provider=item.getActionProvider();
  final boolean providerHasSubMenu=provider != null && provider.hasSubMenu();
  if (itemImpl.hasCollapsibleActionView()) {
    invoked|=itemImpl.expandActionView();
    if (invoked)     close(true);
  }
 else   if (itemImpl.hasSubMenu() || providerHasSubMenu) {
    close(false);
    if (!itemImpl.hasSubMenu()) {
      itemImpl.setSubMenu(new SubMenuBuilder(getContext(),this,itemImpl));
    }
    final SubMenuBuilder subMenu=(SubMenuBuilder)itemImpl.getSubMenu();
    if (providerHasSubMenu) {
      provider.onPrepareSubMenu(subMenu);
    }
    invoked|=dispatchSubMenuSelected(subMenu);
    if (!invoked)     close(true);
  }
 else {
    if ((flags & FLAG_PERFORM_NO_CLOSE) == 0) {
      close(true);
    }
  }
  return invoked;
}

Fixed version (ground truth):
public boolean performItemAction(MenuItem item,MenuPresenter preferredPresenter,int flags){
  MenuItemImpl itemImpl=(MenuItemImpl)item;
  if (itemImpl == null || !itemImpl.isEnabled()) {
    return false;
  }
  boolean invoked=itemImpl.invoke();
  final ActionProvider provider=item.getActionProvider();
  final boolean providerHasSubMenu=provider != null && provider.hasSubMenu();
  if (itemImpl.hasCollapsibleActionView()) {
    invoked|=itemImpl.expandActionView();
    if (invoked)     close(true);
  }
 else   if (itemImpl.hasSubMenu() || providerHasSubMenu) {
    close(false);
    if (!itemImpl.hasSubMenu()) {
      itemImpl.setSubMenu(new SubMenuBuilder(getContext(),this,itemImpl));
    }
    final SubMenuBuilder subMenu=(SubMenuBuilder)itemImpl.getSubMenu();
    if (providerHasSubMenu) {
      provider.onPrepareSubMenu(subMenu);
    }
    invoked|=dispatchSubMenuSelected(subMenu,preferredPresenter);
    if (!invoked)     close(true);
  }
 else {
    if ((flags & FLAG_PERFORM_NO_CLOSE) == 0) {
      close(true);
    }
  }
  return invoked;
}
Program: 199720
Project: 199720
Buggy source:
/** 
 * Implement this to handle requests to delete one or more rows. The implementation should apply the selection clause when performing deletion, allowing the operation to affect multiple rows in a directory. As a courtesy, call   {@link ContentResolver#notifyChange(android.net.Uri,android.database.ContentObserver) notifyDelete()}after deleting. This method can be called from multiple threads, as described in <a href="  {@docRoot}guide/topics/fundamentals/processes-and-threads.html#Threads">Processes and Threads</a>. <p>The implementation is responsible for parsing out a row ID at the end of the URI, if a specific row is being deleted. That is, the client would pass in <code>content://contacts/people/22</code> and the implementation is responsible for parsing the record number (22) when creating a SQL statement.
 * @param uri The full URI to query, including a row ID (if a specific record is requested).
 * @param selection An optional restriction to apply to rows when deleting.
 * @return The number of rows affected.
 * @throws SQLException
 */
public abstract int delete(Uri uri,String selection,String[] selectionArgs);

Fixed version (ground truth):
/** 
 * Implement this to handle requests to delete one or more rows. The implementation should apply the selection clause when performing deletion, allowing the operation to affect multiple rows in a directory. As a courtesy, call   {@link ContentResolver#notifyChange(android.net.Uri,android.database.ContentObserver) notifyChange()}after deleting. This method can be called from multiple threads, as described in <a href="  {@docRoot}guide/topics/fundamentals/processes-and-threads.html#Threads">Processes and Threads</a>. <p>The implementation is responsible for parsing out a row ID at the end of the URI, if a specific row is being deleted. That is, the client would pass in <code>content://contacts/people/22</code> and the implementation is responsible for parsing the record number (22) when creating a SQL statement.
 * @param uri The full URI to query, including a row ID (if a specific record is requested).
 * @param selection An optional restriction to apply to rows when deleting.
 * @return The number of rows affected.
 * @throws SQLException
 */
public abstract int delete(Uri uri,String selection,String[] selectionArgs);
Program: 199721
Project: 199721
Buggy source:
/** 
 * Sets the right position of this view relative to its parent. This method is meant to be called by the layout system and should not generally be called otherwise, because the property may be changed at any time by the layout.
 * @param right The bottom of this view, in pixels.
 */
public final void setRight(int right){
  if (right != mRight) {
    updateMatrix();
    final boolean matrixIsIdentity=mTransformationInfo == null || mTransformationInfo.mMatrixIsIdentity;
    if (matrixIsIdentity) {
      if (mAttachInfo != null) {
        int maxRight;
        if (right < mRight) {
          maxRight=mRight;
        }
 else {
          maxRight=right;
        }
        invalidate(0,0,maxRight - mLeft,mBottom - mTop);
      }
    }
 else {
      invalidate(true);
    }
    int oldWidth=mRight - mLeft;
    int height=mBottom - mTop;
    mRight=right;
    if (mDisplayList != null) {
      mDisplayList.setRight(mRight);
    }
    sizeChange(mRight - mLeft,height,oldWidth,height);
    if (!matrixIsIdentity) {
      if ((mPrivateFlags & PFLAG_PIVOT_EXPLICITLY_SET) == 0) {
        mTransformationInfo.mMatrixDirty=true;
      }
      mPrivateFlags|=PFLAG_DRAWN;
      invalidate(true);
    }
    mBackgroundSizeChanged=true;
    invalidateParentIfNeeded();
    if ((mPrivateFlags2 & PFLAG2_VIEW_QUICK_REJECTED) == PFLAG2_VIEW_QUICK_REJECTED) {
      invalidateParentIfNeeded();
    }
  }
}

Fixed version (ground truth):
/** 
 * Sets the right position of this view relative to its parent. This method is meant to be called by the layout system and should not generally be called otherwise, because the property may be changed at any time by the layout.
 * @param right The right of this view, in pixels.
 */
public final void setRight(int right){
  if (right != mRight) {
    updateMatrix();
    final boolean matrixIsIdentity=mTransformationInfo == null || mTransformationInfo.mMatrixIsIdentity;
    if (matrixIsIdentity) {
      if (mAttachInfo != null) {
        int maxRight;
        if (right < mRight) {
          maxRight=mRight;
        }
 else {
          maxRight=right;
        }
        invalidate(0,0,maxRight - mLeft,mBottom - mTop);
      }
    }
 else {
      invalidate(true);
    }
    int oldWidth=mRight - mLeft;
    int height=mBottom - mTop;
    mRight=right;
    if (mDisplayList != null) {
      mDisplayList.setRight(mRight);
    }
    sizeChange(mRight - mLeft,height,oldWidth,height);
    if (!matrixIsIdentity) {
      if ((mPrivateFlags & PFLAG_PIVOT_EXPLICITLY_SET) == 0) {
        mTransformationInfo.mMatrixDirty=true;
      }
      mPrivateFlags|=PFLAG_DRAWN;
      invalidate(true);
    }
    mBackgroundSizeChanged=true;
    invalidateParentIfNeeded();
    if ((mPrivateFlags2 & PFLAG2_VIEW_QUICK_REJECTED) == PFLAG2_VIEW_QUICK_REJECTED) {
      invalidateParentIfNeeded();
    }
  }
}
Program: 199722
Project: 199722
Buggy source:
/** 
 * Sets the left position of this view relative to its parent. This method is meant to be called by the layout system and should not generally be called otherwise, because the property may be changed at any time by the layout.
 * @param left The bottom of this view, in pixels.
 */
public final void setLeft(int left){
  if (left != mLeft) {
    updateMatrix();
    final boolean matrixIsIdentity=mTransformationInfo == null || mTransformationInfo.mMatrixIsIdentity;
    if (matrixIsIdentity) {
      if (mAttachInfo != null) {
        int minLeft;
        int xLoc;
        if (left < mLeft) {
          minLeft=left;
          xLoc=left - mLeft;
        }
 else {
          minLeft=mLeft;
          xLoc=0;
        }
        invalidate(xLoc,0,mRight - minLeft,mBottom - mTop);
      }
    }
 else {
      invalidate(true);
    }
    int oldWidth=mRight - mLeft;
    int height=mBottom - mTop;
    mLeft=left;
    if (mDisplayList != null) {
      mDisplayList.setLeft(left);
    }
    sizeChange(mRight - mLeft,height,oldWidth,height);
    if (!matrixIsIdentity) {
      if ((mPrivateFlags & PFLAG_PIVOT_EXPLICITLY_SET) == 0) {
        mTransformationInfo.mMatrixDirty=true;
      }
      mPrivateFlags|=PFLAG_DRAWN;
      invalidate(true);
    }
    mBackgroundSizeChanged=true;
    invalidateParentIfNeeded();
    if ((mPrivateFlags2 & PFLAG2_VIEW_QUICK_REJECTED) == PFLAG2_VIEW_QUICK_REJECTED) {
      invalidateParentIfNeeded();
    }
  }
}

Fixed version (ground truth):
/** 
 * Sets the left position of this view relative to its parent. This method is meant to be called by the layout system and should not generally be called otherwise, because the property may be changed at any time by the layout.
 * @param left The left of this view, in pixels.
 */
public final void setLeft(int left){
  if (left != mLeft) {
    updateMatrix();
    final boolean matrixIsIdentity=mTransformationInfo == null || mTransformationInfo.mMatrixIsIdentity;
    if (matrixIsIdentity) {
      if (mAttachInfo != null) {
        int minLeft;
        int xLoc;
        if (left < mLeft) {
          minLeft=left;
          xLoc=left - mLeft;
        }
 else {
          minLeft=mLeft;
          xLoc=0;
        }
        invalidate(xLoc,0,mRight - minLeft,mBottom - mTop);
      }
    }
 else {
      invalidate(true);
    }
    int oldWidth=mRight - mLeft;
    int height=mBottom - mTop;
    mLeft=left;
    if (mDisplayList != null) {
      mDisplayList.setLeft(left);
    }
    sizeChange(mRight - mLeft,height,oldWidth,height);
    if (!matrixIsIdentity) {
      if ((mPrivateFlags & PFLAG_PIVOT_EXPLICITLY_SET) == 0) {
        mTransformationInfo.mMatrixDirty=true;
      }
      mPrivateFlags|=PFLAG_DRAWN;
      invalidate(true);
    }
    mBackgroundSizeChanged=true;
    invalidateParentIfNeeded();
    if ((mPrivateFlags2 & PFLAG2_VIEW_QUICK_REJECTED) == PFLAG2_VIEW_QUICK_REJECTED) {
      invalidateParentIfNeeded();
    }
  }
}
Program: 199723
Project: 199723
Buggy source:
static public AllocationAdapter create2D(RenderScript rs,Allocation a){
  android.util.Log.e("String_Node_Str","String_Node_Str" + a);
  rs.validate();
  AllocationAdapter aa=new AllocationAdapter(0,rs,a);
  aa.mConstrainedLOD=true;
  aa.mConstrainedFace=true;
  aa.mConstrainedY=false;
  aa.mConstrainedZ=true;
  aa.initLOD(0);
  return aa;
}

Fixed version (ground truth):
static public AllocationAdapter create2D(RenderScript rs,Allocation a){
  rs.validate();
  AllocationAdapter aa=new AllocationAdapter(0,rs,a);
  aa.mConstrainedLOD=true;
  aa.mConstrainedFace=true;
  aa.mConstrainedY=false;
  aa.mConstrainedZ=true;
  aa.initLOD(0);
  return aa;
}
Program: 199724
Project: 199724
Buggy source:
private void helpDestroy(){
  boolean shouldDestroy=false;
synchronized (this) {
    if (!mDestroyed) {
      shouldDestroy=true;
      mDestroyed=true;
    }
  }
  if (shouldDestroy) {
    ReentrantReadWriteLock.ReadLock rlock=mRS.mRWLock.readLock();
    rlock.lock();
    if (mRS.isAlive()) {
      mRS.nObjDestroy(mID);
    }
    rlock.unlock();
    mRS=null;
    mID=0;
  }
}

Fixed version (ground truth):
private void helpDestroy(){
  boolean shouldDestroy=false;
synchronized (this) {
    if (!mDestroyed) {
      shouldDestroy=true;
      mDestroyed=true;
    }
  }
  if (shouldDestroy) {
    ReentrantReadWriteLock.ReadLock rlock=mRS.mRWLock.readLock();
    rlock.lock();
    if (mRS.isAlive() && mID != 0) {
      mRS.nObjDestroy(mID);
    }
    rlock.unlock();
    mRS=null;
    mID=0;
  }
}
Program: 199725
Project: 199725
Buggy source:
/** 
 * Frees any native resources associated with this object.  The primary use is to force immediate cleanup of resources when it is believed the GC will not respond quickly enough.
 */
synchronized public void destroy(){
  if (mDestroyed) {
    throw new RSInvalidStateException("String_Node_Str");
  }
  mDestroyed=true;
  mRS.nObjDestroy(mID);
}

Fixed version (ground truth):
/** 
 * Frees any native resources associated with this object.  The primary use is to force immediate cleanup of resources when it is believed the GC will not respond quickly enough.
 */
public void destroy(){
  if (mDestroyed) {
    throw new RSInvalidStateException("String_Node_Str");
  }
  helpDestroy();
}
Program: 199726
Project: 199726
Buggy source:
protected void finalize() throws Throwable {
  if (!mDestroyed) {
    if (mID != 0 && mRS.isAlive()) {
      mRS.nObjDestroy(mID);
    }
    mRS=null;
    mID=0;
    mDestroyed=true;
  }
  super.finalize();
}

Fixed version (ground truth):
protected void finalize() throws Throwable {
  helpDestroy();
  super.finalize();
}
Program: 199727
Project: 199727
Buggy source:
synchronized void nContextDestroy(){
  validate();
  rsnContextDestroy(mContext);
}

Fixed version (ground truth):
synchronized void nContextDestroy(){
  validate();
  ReentrantReadWriteLock.WriteLock wlock=mRWLock.writeLock();
  wlock.lock();
  int curCon=mContext;
  mContext=0;
  wlock.unlock();
  rsnContextDestroy(curCon);
}
Program: 199728
Project: 199728
Buggy source:
synchronized void nObjDestroy(int id){
  if (mContext != 0) {
    rsnObjDestroy(mContext,id);
  }
}

Fixed version (ground truth):
void nObjDestroy(int id){
  if (mContext != 0) {
    rsnObjDestroy(mContext,id);
  }
}
Program: 199729
Project: 199729
Buggy source:
/** 
 * Destroys this RenderScript context.  Once this function is called, using this context or any objects belonging to this context is illegal.
 */
public void destroy(){
  validate();
  nContextDeinitToClient(mContext);
  mMessageThread.mRun=false;
  try {
    mMessageThread.join();
  }
 catch (  InterruptedException e) {
  }
  nContextDestroy();
  mContext=0;
  nDeviceDestroy(mDev);
  mDev=0;
}

Fixed version (ground truth):
/** 
 * Destroys this RenderScript context.  Once this function is called, using this context or any objects belonging to this context is illegal.
 */
public void destroy(){
  validate();
  nContextFinish();
  nContextDeinitToClient(mContext);
  mMessageThread.mRun=false;
  try {
    mMessageThread.join();
  }
 catch (  InterruptedException e) {
  }
  nContextDestroy();
  nDeviceDestroy(mDev);
  mDev=0;
}
Program: 199730
Project: 199730
Buggy source:
RenderScript(Context ctx){
  mContextType=ContextType.NORMAL;
  if (ctx != null) {
    mApplicationContext=ctx.getApplicationContext();
  }
}

Fixed version (ground truth):
RenderScript(Context ctx){
  mContextType=ContextType.NORMAL;
  if (ctx != null) {
    mApplicationContext=ctx.getApplicationContext();
  }
  mRWLock=new ReentrantReadWriteLock();
}
Program: 199731
Project: 199731
Buggy source:
/** 
 * Implement this to handle requests to delete one or more rows. The implementation should apply the selection clause when performing deletion, allowing the operation to affect multiple rows in a directory. As a courtesy, call   {@link ContentResolver#notifyChange(android.net.Uri,android.database.ContentObserver) notifyDelete()}after deleting. This method can be called from multiple threads, as described in <a href="  {@docRoot}guide/topics/fundamentals/processes-and-threads.html#Threads">Processes and Threads</a>. <p>The implementation is responsible for parsing out a row ID at the end of the URI, if a specific row is being deleted. That is, the client would pass in <code>content://contacts/people/22</code> and the implementation is responsible for parsing the record number (22) when creating a SQL statement.
 * @param uri The full URI to query, including a row ID (if a specific record is requested).
 * @param selection An optional restriction to apply to rows when deleting.
 * @return The number of rows affected.
 * @throws SQLException
 */
public abstract int delete(Uri uri,String selection,String[] selectionArgs);

Fixed version (ground truth):
/** 
 * Implement this to handle requests to delete one or more rows. The implementation should apply the selection clause when performing deletion, allowing the operation to affect multiple rows in a directory. As a courtesy, call   {@link ContentResolver#notifyChange(android.net.Uri,android.database.ContentObserver) notifyChange()}after deleting. This method can be called from multiple threads, as described in <a href="  {@docRoot}guide/topics/fundamentals/processes-and-threads.html#Threads">Processes and Threads</a>. <p>The implementation is responsible for parsing out a row ID at the end of the URI, if a specific row is being deleted. That is, the client would pass in <code>content://contacts/people/22</code> and the implementation is responsible for parsing the record number (22) when creating a SQL statement.
 * @param uri The full URI to query, including a row ID (if a specific record is requested).
 * @param selection An optional restriction to apply to rows when deleting.
 * @return The number of rows affected.
 * @throws SQLException
 */
public abstract int delete(Uri uri,String selection,String[] selectionArgs);
Program: 199732
Project: 199732
Buggy source:
/** 
 * Sets the right position of this view relative to its parent. This method is meant to be called by the layout system and should not generally be called otherwise, because the property may be changed at any time by the layout.
 * @param right The bottom of this view, in pixels.
 */
public final void setRight(int right){
  if (right != mRight) {
    updateMatrix();
    final boolean matrixIsIdentity=mTransformationInfo == null || mTransformationInfo.mMatrixIsIdentity;
    if (matrixIsIdentity) {
      if (mAttachInfo != null) {
        int maxRight;
        if (right < mRight) {
          maxRight=mRight;
        }
 else {
          maxRight=right;
        }
        invalidate(0,0,maxRight - mLeft,mBottom - mTop);
      }
    }
 else {
      invalidate(true);
    }
    int oldWidth=mRight - mLeft;
    int height=mBottom - mTop;
    mRight=right;
    if (mDisplayList != null) {
      mDisplayList.setRight(mRight);
    }
    sizeChange(mRight - mLeft,height,oldWidth,height);
    if (!matrixIsIdentity) {
      if ((mPrivateFlags & PFLAG_PIVOT_EXPLICITLY_SET) == 0) {
        mTransformationInfo.mMatrixDirty=true;
      }
      mPrivateFlags|=PFLAG_DRAWN;
      invalidate(true);
    }
    mBackgroundSizeChanged=true;
    invalidateParentIfNeeded();
    if ((mPrivateFlags2 & PFLAG2_VIEW_QUICK_REJECTED) == PFLAG2_VIEW_QUICK_REJECTED) {
      invalidateParentIfNeeded();
    }
  }
}

Fixed version (ground truth):
/** 
 * Sets the right position of this view relative to its parent. This method is meant to be called by the layout system and should not generally be called otherwise, because the property may be changed at any time by the layout.
 * @param right The right of this view, in pixels.
 */
public final void setRight(int right){
  if (right != mRight) {
    updateMatrix();
    final boolean matrixIsIdentity=mTransformationInfo == null || mTransformationInfo.mMatrixIsIdentity;
    if (matrixIsIdentity) {
      if (mAttachInfo != null) {
        int maxRight;
        if (right < mRight) {
          maxRight=mRight;
        }
 else {
          maxRight=right;
        }
        invalidate(0,0,maxRight - mLeft,mBottom - mTop);
      }
    }
 else {
      invalidate(true);
    }
    int oldWidth=mRight - mLeft;
    int height=mBottom - mTop;
    mRight=right;
    if (mDisplayList != null) {
      mDisplayList.setRight(mRight);
    }
    sizeChange(mRight - mLeft,height,oldWidth,height);
    if (!matrixIsIdentity) {
      if ((mPrivateFlags & PFLAG_PIVOT_EXPLICITLY_SET) == 0) {
        mTransformationInfo.mMatrixDirty=true;
      }
      mPrivateFlags|=PFLAG_DRAWN;
      invalidate(true);
    }
    mBackgroundSizeChanged=true;
    invalidateParentIfNeeded();
    if ((mPrivateFlags2 & PFLAG2_VIEW_QUICK_REJECTED) == PFLAG2_VIEW_QUICK_REJECTED) {
      invalidateParentIfNeeded();
    }
  }
}
Program: 199733
Project: 199733
Buggy source:
/** 
 * Sets the left position of this view relative to its parent. This method is meant to be called by the layout system and should not generally be called otherwise, because the property may be changed at any time by the layout.
 * @param left The bottom of this view, in pixels.
 */
public final void setLeft(int left){
  if (left != mLeft) {
    updateMatrix();
    final boolean matrixIsIdentity=mTransformationInfo == null || mTransformationInfo.mMatrixIsIdentity;
    if (matrixIsIdentity) {
      if (mAttachInfo != null) {
        int minLeft;
        int xLoc;
        if (left < mLeft) {
          minLeft=left;
          xLoc=left - mLeft;
        }
 else {
          minLeft=mLeft;
          xLoc=0;
        }
        invalidate(xLoc,0,mRight - minLeft,mBottom - mTop);
      }
    }
 else {
      invalidate(true);
    }
    int oldWidth=mRight - mLeft;
    int height=mBottom - mTop;
    mLeft=left;
    if (mDisplayList != null) {
      mDisplayList.setLeft(left);
    }
    sizeChange(mRight - mLeft,height,oldWidth,height);
    if (!matrixIsIdentity) {
      if ((mPrivateFlags & PFLAG_PIVOT_EXPLICITLY_SET) == 0) {
        mTransformationInfo.mMatrixDirty=true;
      }
      mPrivateFlags|=PFLAG_DRAWN;
      invalidate(true);
    }
    mBackgroundSizeChanged=true;
    invalidateParentIfNeeded();
    if ((mPrivateFlags2 & PFLAG2_VIEW_QUICK_REJECTED) == PFLAG2_VIEW_QUICK_REJECTED) {
      invalidateParentIfNeeded();
    }
  }
}

Fixed version (ground truth):
/** 
 * Sets the left position of this view relative to its parent. This method is meant to be called by the layout system and should not generally be called otherwise, because the property may be changed at any time by the layout.
 * @param left The left of this view, in pixels.
 */
public final void setLeft(int left){
  if (left != mLeft) {
    updateMatrix();
    final boolean matrixIsIdentity=mTransformationInfo == null || mTransformationInfo.mMatrixIsIdentity;
    if (matrixIsIdentity) {
      if (mAttachInfo != null) {
        int minLeft;
        int xLoc;
        if (left < mLeft) {
          minLeft=left;
          xLoc=left - mLeft;
        }
 else {
          minLeft=mLeft;
          xLoc=0;
        }
        invalidate(xLoc,0,mRight - minLeft,mBottom - mTop);
      }
    }
 else {
      invalidate(true);
    }
    int oldWidth=mRight - mLeft;
    int height=mBottom - mTop;
    mLeft=left;
    if (mDisplayList != null) {
      mDisplayList.setLeft(left);
    }
    sizeChange(mRight - mLeft,height,oldWidth,height);
    if (!matrixIsIdentity) {
      if ((mPrivateFlags & PFLAG_PIVOT_EXPLICITLY_SET) == 0) {
        mTransformationInfo.mMatrixDirty=true;
      }
      mPrivateFlags|=PFLAG_DRAWN;
      invalidate(true);
    }
    mBackgroundSizeChanged=true;
    invalidateParentIfNeeded();
    if ((mPrivateFlags2 & PFLAG2_VIEW_QUICK_REJECTED) == PFLAG2_VIEW_QUICK_REJECTED) {
      invalidateParentIfNeeded();
    }
  }
}
Program: 199734
Project: 199734
Buggy source:
public KeyguardPatternView(Context context,AttributeSet attrs){
  super(context,attrs);
}

Fixed version (ground truth):
public KeyguardPatternView(Context context,AttributeSet attrs){
  super(context,attrs);
  mKeyguardUpdateMonitor=KeyguardUpdateMonitor.getInstance(mContext);
}
Program: 199735
Project: 199735
Buggy source:
public void onPatternDetected(List<LockPatternView.Cell> pattern){
  if (mLockPatternUtils.checkPattern(pattern)) {
    mCallback.reportUnlockAttempt(true);
    mLockPatternView.setDisplayMode(LockPatternView.DisplayMode.Correct);
    mTotalFailedPatternAttempts=0;
    mCallback.dismiss(true);
  }
 else {
    if (pattern.size() > MIN_PATTERN_BEFORE_POKE_WAKELOCK) {
      mCallback.userActivity(UNLOCK_PATTERN_WAKE_INTERVAL_MS);
    }
    mLockPatternView.setDisplayMode(LockPatternView.DisplayMode.Wrong);
    if (pattern.size() >= LockPatternUtils.MIN_PATTERN_REGISTER_FAIL) {
      mTotalFailedPatternAttempts++;
      mFailedPatternAttemptsSinceLastTimeout++;
      mCallback.reportUnlockAttempt(false);
    }
    if (mFailedPatternAttemptsSinceLastTimeout >= LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT) {
      long deadline=mLockPatternUtils.setLockoutAttemptDeadline();
      handleAttemptLockout(deadline);
    }
 else {
      mSecurityMessageDisplay.setMessage(R.string.kg_wrong_pattern,true);
      mLockPatternView.postDelayed(mCancelPatternRunnable,PATTERN_CLEAR_TIMEOUT_MS);
    }
  }
}

Fixed version (ground truth):
public void onPatternDetected(List<LockPatternView.Cell> pattern){
  if (mLockPatternUtils.checkPattern(pattern)) {
    mCallback.reportUnlockAttempt(true);
    mLockPatternView.setDisplayMode(LockPatternView.DisplayMode.Correct);
    mCallback.dismiss(true);
  }
 else {
    if (pattern.size() > MIN_PATTERN_BEFORE_POKE_WAKELOCK) {
      mCallback.userActivity(UNLOCK_PATTERN_WAKE_INTERVAL_MS);
    }
    mLockPatternView.setDisplayMode(LockPatternView.DisplayMode.Wrong);
    boolean registeredAttempt=pattern.size() >= LockPatternUtils.MIN_PATTERN_REGISTER_FAIL;
    if (registeredAttempt) {
      mCallback.reportUnlockAttempt(false);
    }
    int attempts=mKeyguardUpdateMonitor.getFailedUnlockAttempts();
    if (registeredAttempt && 0 == (attempts % LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT)) {
      long deadline=mLockPatternUtils.setLockoutAttemptDeadline();
      handleAttemptLockout(deadline);
    }
 else {
      mSecurityMessageDisplay.setMessage(R.string.kg_wrong_pattern,true);
      mLockPatternView.postDelayed(mCancelPatternRunnable,PATTERN_CLEAR_TIMEOUT_MS);
    }
  }
}
Program: 199736
Project: 199736
Buggy source:
@Override public void onFinish(){
  mLockPatternView.setEnabled(true);
  displayDefaultSecurityMessage();
  mFailedPatternAttemptsSinceLastTimeout=0;
  if (mEnableFallback) {
    updateFooter(FooterMode.ForgotLockPattern);
  }
 else {
    updateFooter(FooterMode.Normal);
  }
}

Fixed version (ground truth):
@Override public void onFinish(){
  mLockPatternView.setEnabled(true);
  displayDefaultSecurityMessage();
  if (mEnableFallback) {
    updateFooter(FooterMode.ForgotLockPattern);
  }
 else {
    updateFooter(FooterMode.Normal);
  }
}