nus-yam/ex-repair huggingface dataset:
Program: 199737
Project: 199737
Buggy source:
private void displayDefaultSecurityMessage(){
  if (KeyguardUpdateMonitor.getInstance(mContext).getMaxBiometricUnlockAttemptsReached()) {
    mSecurityMessageDisplay.setMessage(R.string.faceunlock_multiple_failures,true);
  }
 else {
    mSecurityMessageDisplay.setMessage(R.string.kg_pattern_instructions,false);
  }
}

Fixed version (ground truth):
private void displayDefaultSecurityMessage(){
  if (mKeyguardUpdateMonitor.getMaxBiometricUnlockAttemptsReached()) {
    mSecurityMessageDisplay.setMessage(R.string.faceunlock_multiple_failures,true);
  }
 else {
    mSecurityMessageDisplay.setMessage(R.string.kg_pattern_instructions,false);
  }
}
Program: 199738
Project: 199738
Buggy source:
public void reset(){
  mLockPatternView.enableInput();
  mLockPatternView.setEnabled(true);
  mLockPatternView.clearPattern();
  long deadline=mLockPatternUtils.getLockoutAttemptDeadline();
  if (deadline != 0) {
    handleAttemptLockout(deadline);
  }
 else {
    displayDefaultSecurityMessage();
  }
  if (mCallback.isVerifyUnlockOnly()) {
    updateFooter(FooterMode.VerifyUnlocked);
  }
 else   if (mEnableFallback && (mTotalFailedPatternAttempts >= LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT)) {
    updateFooter(FooterMode.ForgotLockPattern);
  }
 else {
    updateFooter(FooterMode.Normal);
  }
}

Fixed version (ground truth):
public void reset(){
  mLockPatternView.enableInput();
  mLockPatternView.setEnabled(true);
  mLockPatternView.clearPattern();
  long deadline=mLockPatternUtils.getLockoutAttemptDeadline();
  if (deadline != 0) {
    handleAttemptLockout(deadline);
  }
 else {
    displayDefaultSecurityMessage();
  }
  if (mCallback.isVerifyUnlockOnly()) {
    updateFooter(FooterMode.VerifyUnlocked);
  }
 else   if (mEnableFallback && (mKeyguardUpdateMonitor.getFailedUnlockAttempts() >= LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT)) {
    updateFooter(FooterMode.ForgotLockPattern);
  }
 else {
    updateFooter(FooterMode.Normal);
  }
}
Program: 199739
Project: 199739
Buggy source:
private void handleAttemptLockout(long elapsedRealtimeDeadline){
  mLockPatternView.clearPattern();
  mLockPatternView.setEnabled(false);
  final long elapsedRealtime=SystemClock.elapsedRealtime();
  if (mEnableFallback) {
    updateFooter(FooterMode.ForgotLockPattern);
  }
  mCountdownTimer=new CountDownTimer(elapsedRealtimeDeadline - elapsedRealtime,1000){
    @Override public void onTick(    long millisUntilFinished){
      final int secondsRemaining=(int)(millisUntilFinished / 1000);
      mSecurityMessageDisplay.setMessage(R.string.kg_too_many_failed_attempts_countdown,true,secondsRemaining);
    }
    @Override public void onFinish(){
      mLockPatternView.setEnabled(true);
      displayDefaultSecurityMessage();
      mFailedPatternAttemptsSinceLastTimeout=0;
      if (mEnableFallback) {
        updateFooter(FooterMode.ForgotLockPattern);
      }
 else {
        updateFooter(FooterMode.Normal);
      }
    }
  }
.start();
}

Fixed version (ground truth):
private void handleAttemptLockout(long elapsedRealtimeDeadline){
  mLockPatternView.clearPattern();
  mLockPatternView.setEnabled(false);
  final long elapsedRealtime=SystemClock.elapsedRealtime();
  if (mEnableFallback) {
    updateFooter(FooterMode.ForgotLockPattern);
  }
  mCountdownTimer=new CountDownTimer(elapsedRealtimeDeadline - elapsedRealtime,1000){
    @Override public void onTick(    long millisUntilFinished){
      final int secondsRemaining=(int)(millisUntilFinished / 1000);
      mSecurityMessageDisplay.setMessage(R.string.kg_too_many_failed_attempts_countdown,true,secondsRemaining);
    }
    @Override public void onFinish(){
      mLockPatternView.setEnabled(true);
      displayDefaultSecurityMessage();
      if (mEnableFallback) {
        updateFooter(FooterMode.ForgotLockPattern);
      }
 else {
        updateFooter(FooterMode.Normal);
      }
    }
  }
.start();
}
Program: 199740
Project: 199740
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: 199741
Project: 199741
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: 199742
Project: 199742
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);
  }
}
Program: 199743
Project: 199743
Buggy source:
private void displayDefaultSecurityMessage(){
  if (KeyguardUpdateMonitor.getInstance(mContext).getMaxBiometricUnlockAttemptsReached()) {
    mSecurityMessageDisplay.setMessage(R.string.faceunlock_multiple_failures,true);
  }
 else {
    mSecurityMessageDisplay.setMessage(R.string.kg_pattern_instructions,false);
  }
}

Fixed version (ground truth):
private void displayDefaultSecurityMessage(){
  if (mKeyguardUpdateMonitor.getMaxBiometricUnlockAttemptsReached()) {
    mSecurityMessageDisplay.setMessage(R.string.faceunlock_multiple_failures,true);
  }
 else {
    mSecurityMessageDisplay.setMessage(R.string.kg_pattern_instructions,false);
  }
}
Program: 199744
Project: 199744
Buggy source:
public void reset(){
  mLockPatternView.enableInput();
  mLockPatternView.setEnabled(true);
  mLockPatternView.clearPattern();
  long deadline=mLockPatternUtils.getLockoutAttemptDeadline();
  if (deadline != 0) {
    handleAttemptLockout(deadline);
  }
 else {
    displayDefaultSecurityMessage();
  }
  if (mCallback.isVerifyUnlockOnly()) {
    updateFooter(FooterMode.VerifyUnlocked);
  }
 else   if (mEnableFallback && (mTotalFailedPatternAttempts >= LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT)) {
    updateFooter(FooterMode.ForgotLockPattern);
  }
 else {
    updateFooter(FooterMode.Normal);
  }
}

Fixed version (ground truth):
public void reset(){
  mLockPatternView.enableInput();
  mLockPatternView.setEnabled(true);
  mLockPatternView.clearPattern();
  long deadline=mLockPatternUtils.getLockoutAttemptDeadline();
  if (deadline != 0) {
    handleAttemptLockout(deadline);
  }
 else {
    displayDefaultSecurityMessage();
  }
  if (mCallback.isVerifyUnlockOnly()) {
    updateFooter(FooterMode.VerifyUnlocked);
  }
 else   if (mEnableFallback && (mKeyguardUpdateMonitor.getFailedUnlockAttempts() >= LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT)) {
    updateFooter(FooterMode.ForgotLockPattern);
  }
 else {
    updateFooter(FooterMode.Normal);
  }
}
Program: 199745
Project: 199745
Buggy source:
private void handleAttemptLockout(long elapsedRealtimeDeadline){
  mLockPatternView.clearPattern();
  mLockPatternView.setEnabled(false);
  final long elapsedRealtime=SystemClock.elapsedRealtime();
  if (mEnableFallback) {
    updateFooter(FooterMode.ForgotLockPattern);
  }
  mCountdownTimer=new CountDownTimer(elapsedRealtimeDeadline - elapsedRealtime,1000){
    @Override public void onTick(    long millisUntilFinished){
      final int secondsRemaining=(int)(millisUntilFinished / 1000);
      mSecurityMessageDisplay.setMessage(R.string.kg_too_many_failed_attempts_countdown,true,secondsRemaining);
    }
    @Override public void onFinish(){
      mLockPatternView.setEnabled(true);
      displayDefaultSecurityMessage();
      mFailedPatternAttemptsSinceLastTimeout=0;
      if (mEnableFallback) {
        updateFooter(FooterMode.ForgotLockPattern);
      }
 else {
        updateFooter(FooterMode.Normal);
      }
    }
  }
.start();
}

Fixed version (ground truth):
private void handleAttemptLockout(long elapsedRealtimeDeadline){
  mLockPatternView.clearPattern();
  mLockPatternView.setEnabled(false);
  final long elapsedRealtime=SystemClock.elapsedRealtime();
  if (mEnableFallback) {
    updateFooter(FooterMode.ForgotLockPattern);
  }
  mCountdownTimer=new CountDownTimer(elapsedRealtimeDeadline - elapsedRealtime,1000){
    @Override public void onTick(    long millisUntilFinished){
      final int secondsRemaining=(int)(millisUntilFinished / 1000);
      mSecurityMessageDisplay.setMessage(R.string.kg_too_many_failed_attempts_countdown,true,secondsRemaining);
    }
    @Override public void onFinish(){
      mLockPatternView.setEnabled(true);
      displayDefaultSecurityMessage();
      if (mEnableFallback) {
        updateFooter(FooterMode.ForgotLockPattern);
      }
 else {
        updateFooter(FooterMode.Normal);
      }
    }
  }
.start();
}
Program: 199746
Project: 199746
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: 199747
Project: 199747
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: 199748
Project: 199748
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: 199749
Project: 199749
Buggy source:
@Override public void onServiceConnected(ComponentName name,IBinder service){
synchronized (mLock) {
    if (mWallpaper.connection == this) {
      mWallpaper.lastDiedTime=SystemClock.uptimeMillis();
      mService=IWallpaperService.Stub.asInterface(service);
      attachServiceLocked(this,mWallpaper);
      saveSettingsLocked(mWallpaper);
    }
  }
}

Fixed version (ground truth):
@Override public void onServiceConnected(ComponentName name,IBinder service){
synchronized (mLock) {
    if (mWallpaper.connection == this) {
      mService=IWallpaperService.Stub.asInterface(service);
      attachServiceLocked(this,mWallpaper);
      saveSettingsLocked(mWallpaper);
    }
  }
}
Program: 199751
Project: 199751
Buggy source:
@Override public void onServiceDisconnected(ComponentName name){
synchronized (mLock) {
    mService=null;
    mEngine=null;
    if (mWallpaper.connection == this) {
      Slog.w(TAG,"String_Node_Str" + mWallpaper.wallpaperComponent);
      if (!mWallpaper.wallpaperUpdating && (mWallpaper.lastDiedTime + MIN_WALLPAPER_CRASH_TIME) > SystemClock.uptimeMillis() && mWallpaper.userId == mCurrentUserId) {
        Slog.w(TAG,"String_Node_Str");
        clearWallpaperLocked(true,mWallpaper.userId,null);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void onServiceDisconnected(ComponentName name){
synchronized (mLock) {
    mService=null;
    mEngine=null;
    if (mWallpaper.connection == this) {
      Slog.w(TAG,"String_Node_Str" + mWallpaper.wallpaperComponent);
      if (!mWallpaper.wallpaperUpdating && mWallpaper.userId == mCurrentUserId) {
        if (mWallpaper.lastDiedTime != 0 && mWallpaper.lastDiedTime + MIN_WALLPAPER_CRASH_TIME > SystemClock.uptimeMillis()) {
          Slog.w(TAG,"String_Node_Str");
          clearWallpaperLocked(true,mWallpaper.userId,null);
        }
 else {
          mWallpaper.lastDiedTime=SystemClock.uptimeMillis();
        }
      }
    }
  }
}
Program: 199752
Project: 199752
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: 199753
Project: 199753
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: 199754
Project: 199754
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);
  }
}
Program: 199755
Project: 199755
Buggy source:
private void displayDefaultSecurityMessage(){
  if (KeyguardUpdateMonitor.getInstance(mContext).getMaxBiometricUnlockAttemptsReached()) {
    mSecurityMessageDisplay.setMessage(R.string.faceunlock_multiple_failures,true);
  }
 else {
    mSecurityMessageDisplay.setMessage(R.string.kg_pattern_instructions,false);
  }
}

Fixed version (ground truth):
private void displayDefaultSecurityMessage(){
  if (mKeyguardUpdateMonitor.getMaxBiometricUnlockAttemptsReached()) {
    mSecurityMessageDisplay.setMessage(R.string.faceunlock_multiple_failures,true);
  }
 else {
    mSecurityMessageDisplay.setMessage(R.string.kg_pattern_instructions,false);
  }
}
Program: 199756
Project: 199756
Buggy source:
public void reset(){
  mLockPatternView.enableInput();
  mLockPatternView.setEnabled(true);
  mLockPatternView.clearPattern();
  long deadline=mLockPatternUtils.getLockoutAttemptDeadline();
  if (deadline != 0) {
    handleAttemptLockout(deadline);
  }
 else {
    displayDefaultSecurityMessage();
  }
  if (mCallback.isVerifyUnlockOnly()) {
    updateFooter(FooterMode.VerifyUnlocked);
  }
 else   if (mEnableFallback && (mTotalFailedPatternAttempts >= LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT)) {
    updateFooter(FooterMode.ForgotLockPattern);
  }
 else {
    updateFooter(FooterMode.Normal);
  }
}

Fixed version (ground truth):
public void reset(){
  mLockPatternView.enableInput();
  mLockPatternView.setEnabled(true);
  mLockPatternView.clearPattern();
  long deadline=mLockPatternUtils.getLockoutAttemptDeadline();
  if (deadline != 0) {
    handleAttemptLockout(deadline);
  }
 else {
    displayDefaultSecurityMessage();
  }
  if (mCallback.isVerifyUnlockOnly()) {
    updateFooter(FooterMode.VerifyUnlocked);
  }
 else   if (mEnableFallback && (mKeyguardUpdateMonitor.getFailedUnlockAttempts() >= LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT)) {
    updateFooter(FooterMode.ForgotLockPattern);
  }
 else {
    updateFooter(FooterMode.Normal);
  }
}
Program: 199757
Project: 199757
Buggy source:
private void handleAttemptLockout(long elapsedRealtimeDeadline){
  mLockPatternView.clearPattern();
  mLockPatternView.setEnabled(false);
  final long elapsedRealtime=SystemClock.elapsedRealtime();
  if (mEnableFallback) {
    updateFooter(FooterMode.ForgotLockPattern);
  }
  mCountdownTimer=new CountDownTimer(elapsedRealtimeDeadline - elapsedRealtime,1000){
    @Override public void onTick(    long millisUntilFinished){
      final int secondsRemaining=(int)(millisUntilFinished / 1000);
      mSecurityMessageDisplay.setMessage(R.string.kg_too_many_failed_attempts_countdown,true,secondsRemaining);
    }
    @Override public void onFinish(){
      mLockPatternView.setEnabled(true);
      displayDefaultSecurityMessage();
      mFailedPatternAttemptsSinceLastTimeout=0;
      if (mEnableFallback) {
        updateFooter(FooterMode.ForgotLockPattern);
      }
 else {
        updateFooter(FooterMode.Normal);
      }
    }
  }
.start();
}

Fixed version (ground truth):
private void handleAttemptLockout(long elapsedRealtimeDeadline){
  mLockPatternView.clearPattern();
  mLockPatternView.setEnabled(false);
  final long elapsedRealtime=SystemClock.elapsedRealtime();
  if (mEnableFallback) {
    updateFooter(FooterMode.ForgotLockPattern);
  }
  mCountdownTimer=new CountDownTimer(elapsedRealtimeDeadline - elapsedRealtime,1000){
    @Override public void onTick(    long millisUntilFinished){
      final int secondsRemaining=(int)(millisUntilFinished / 1000);
      mSecurityMessageDisplay.setMessage(R.string.kg_too_many_failed_attempts_countdown,true,secondsRemaining);
    }
    @Override public void onFinish(){
      mLockPatternView.setEnabled(true);
      displayDefaultSecurityMessage();
      if (mEnableFallback) {
        updateFooter(FooterMode.ForgotLockPattern);
      }
 else {
        updateFooter(FooterMode.Normal);
      }
    }
  }
.start();
}
Program: 199758
Project: 199758
Buggy source:
@Override public void onServiceConnected(ComponentName name,IBinder service){
synchronized (mLock) {
    if (mWallpaper.connection == this) {
      mWallpaper.lastDiedTime=SystemClock.uptimeMillis();
      mService=IWallpaperService.Stub.asInterface(service);
      attachServiceLocked(this,mWallpaper);
      saveSettingsLocked(mWallpaper);
    }
  }
}

Fixed version (ground truth):
@Override public void onServiceConnected(ComponentName name,IBinder service){
synchronized (mLock) {
    if (mWallpaper.connection == this) {
      mService=IWallpaperService.Stub.asInterface(service);
      attachServiceLocked(this,mWallpaper);
      saveSettingsLocked(mWallpaper);
    }
  }
}
Program: 199760
Project: 199760
Buggy source:
@Override public void onServiceDisconnected(ComponentName name){
synchronized (mLock) {
    mService=null;
    mEngine=null;
    if (mWallpaper.connection == this) {
      Slog.w(TAG,"String_Node_Str" + mWallpaper.wallpaperComponent);
      if (!mWallpaper.wallpaperUpdating && (mWallpaper.lastDiedTime + MIN_WALLPAPER_CRASH_TIME) > SystemClock.uptimeMillis() && mWallpaper.userId == mCurrentUserId) {
        Slog.w(TAG,"String_Node_Str");
        clearWallpaperLocked(true,mWallpaper.userId,null);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void onServiceDisconnected(ComponentName name){
synchronized (mLock) {
    mService=null;
    mEngine=null;
    if (mWallpaper.connection == this) {
      Slog.w(TAG,"String_Node_Str" + mWallpaper.wallpaperComponent);
      if (!mWallpaper.wallpaperUpdating && mWallpaper.userId == mCurrentUserId) {
        if (mWallpaper.lastDiedTime != 0 && mWallpaper.lastDiedTime + MIN_WALLPAPER_CRASH_TIME > SystemClock.uptimeMillis()) {
          Slog.w(TAG,"String_Node_Str");
          clearWallpaperLocked(true,mWallpaper.userId,null);
        }
 else {
          mWallpaper.lastDiedTime=SystemClock.uptimeMillis();
        }
      }
    }
  }
}
Program: 199761
Project: 199761
Buggy source:
@Override public View getItemView(final MenuItemImpl item,View convertView,ViewGroup parent){
  View actionView=item.getActionView();
  if (actionView == null || item.hasCollapsibleActionView()) {
    actionView=super.getItemView(item,convertView,parent);
  }
  actionView.setVisibility(item.isActionViewExpanded() ? View.GONE : View.VISIBLE);
  if (item.hasSubMenu()) {
    actionView.setOnTouchListener(new ForwardingListener(actionView){
      @Override public ListPopupWindow getPopup(){
        return mActionButtonPopup != null ? mActionButtonPopup.getPopup() : null;
      }
      @Override protected boolean onForwardingStarted(){
        return onSubMenuSelected((SubMenuBuilder)item.getSubMenu());
      }
      @Override protected boolean onForwardingStopped(){
        return dismissPopupMenus();
      }
    }
);
  }
 else {
    actionView.setOnTouchListener(null);
  }
  final ActionMenuView menuParent=(ActionMenuView)parent;
  final ViewGroup.LayoutParams lp=actionView.getLayoutParams();
  if (!menuParent.checkLayoutParams(lp)) {
    actionView.setLayoutParams(menuParent.generateLayoutParams(lp));
  }
  return actionView;
}

Fixed version (ground truth):
@Override public View getItemView(final MenuItemImpl item,View convertView,ViewGroup parent){
  View actionView=item.getActionView();
  if (actionView == null || item.hasCollapsibleActionView()) {
    actionView=super.getItemView(item,convertView,parent);
  }
  actionView.setVisibility(item.isActionViewExpanded() ? View.GONE : View.VISIBLE);
  final ActionMenuView menuParent=(ActionMenuView)parent;
  final ViewGroup.LayoutParams lp=actionView.getLayoutParams();
  if (!menuParent.checkLayoutParams(lp)) {
    actionView.setLayoutParams(menuParent.generateLayoutParams(lp));
  }
  return actionView;
}
Program: 199762
Project: 199762
Buggy source:
@Override public void bindItemView(MenuItemImpl item,MenuView.ItemView itemView){
  itemView.initialize(item,0);
  final ActionMenuView menuView=(ActionMenuView)mMenuView;
  ActionMenuItemView actionItemView=(ActionMenuItemView)itemView;
  actionItemView.setItemInvoker(menuView);
}

Fixed version (ground truth):
@Override public void bindItemView(final MenuItemImpl item,MenuView.ItemView itemView){
  itemView.initialize(item,0);
  final ActionMenuView menuView=(ActionMenuView)mMenuView;
  final ActionMenuItemView actionItemView=(ActionMenuItemView)itemView;
  actionItemView.setItemInvoker(menuView);
  if (item.hasSubMenu()) {
    actionItemView.setOnTouchListener(new ForwardingListener(actionItemView){
      @Override public ListPopupWindow getPopup(){
        return mActionButtonPopup != null ? mActionButtonPopup.getPopup() : null;
      }
      @Override protected boolean onForwardingStarted(){
        return onSubMenuSelected((SubMenuBuilder)item.getSubMenu());
      }
      @Override protected boolean onForwardingStopped(){
        return dismissPopupMenus();
      }
    }
);
  }
 else {
    actionItemView.setOnTouchListener(null);
  }
}
Program: 199763
Project: 199763
Buggy source:
@Override public View getItemView(final MenuItemImpl item,View convertView,ViewGroup parent){
  View actionView=item.getActionView();
  if (actionView == null || item.hasCollapsibleActionView()) {
    actionView=super.getItemView(item,convertView,parent);
  }
  actionView.setVisibility(item.isActionViewExpanded() ? View.GONE : View.VISIBLE);
  if (item.hasSubMenu()) {
    actionView.setOnTouchListener(new ForwardingListener(actionView){
      @Override public ListPopupWindow getPopup(){
        return mActionButtonPopup != null ? mActionButtonPopup.getPopup() : null;
      }
      @Override protected boolean onForwardingStarted(){
        return onSubMenuSelected((SubMenuBuilder)item.getSubMenu());
      }
      @Override protected boolean onForwardingStopped(){
        return dismissPopupMenus();
      }
    }
);
  }
 else {
    actionView.setOnTouchListener(null);
  }
  final ActionMenuView menuParent=(ActionMenuView)parent;
  final ViewGroup.LayoutParams lp=actionView.getLayoutParams();
  if (!menuParent.checkLayoutParams(lp)) {
    actionView.setLayoutParams(menuParent.generateLayoutParams(lp));
  }
  return actionView;
}

Fixed version (ground truth):
@Override public View getItemView(final MenuItemImpl item,View convertView,ViewGroup parent){
  View actionView=item.getActionView();
  if (actionView == null || item.hasCollapsibleActionView()) {
    actionView=super.getItemView(item,convertView,parent);
  }
  actionView.setVisibility(item.isActionViewExpanded() ? View.GONE : View.VISIBLE);
  final ActionMenuView menuParent=(ActionMenuView)parent;
  final ViewGroup.LayoutParams lp=actionView.getLayoutParams();
  if (!menuParent.checkLayoutParams(lp)) {
    actionView.setLayoutParams(menuParent.generateLayoutParams(lp));
  }
  return actionView;
}
Program: 199764
Project: 199764
Buggy source:
@Override public void bindItemView(MenuItemImpl item,MenuView.ItemView itemView){
  itemView.initialize(item,0);
  final ActionMenuView menuView=(ActionMenuView)mMenuView;
  ActionMenuItemView actionItemView=(ActionMenuItemView)itemView;
  actionItemView.setItemInvoker(menuView);
}

Fixed version (ground truth):
@Override public void bindItemView(final MenuItemImpl item,MenuView.ItemView itemView){
  itemView.initialize(item,0);
  final ActionMenuView menuView=(ActionMenuView)mMenuView;
  final ActionMenuItemView actionItemView=(ActionMenuItemView)itemView;
  actionItemView.setItemInvoker(menuView);
  if (item.hasSubMenu()) {
    actionItemView.setOnTouchListener(new ForwardingListener(actionItemView){
      @Override public ListPopupWindow getPopup(){
        return mActionButtonPopup != null ? mActionButtonPopup.getPopup() : null;
      }
      @Override protected boolean onForwardingStarted(){
        return onSubMenuSelected((SubMenuBuilder)item.getSubMenu());
      }
      @Override protected boolean onForwardingStopped(){
        return dismissPopupMenus();
      }
    }
);
  }
 else {
    actionItemView.setOnTouchListener(null);
  }
}
Program: 199765
Project: 199765
Buggy source:
@Override public View getItemView(final MenuItemImpl item,View convertView,ViewGroup parent){
  View actionView=item.getActionView();
  if (actionView == null || item.hasCollapsibleActionView()) {
    actionView=super.getItemView(item,convertView,parent);
  }
  actionView.setVisibility(item.isActionViewExpanded() ? View.GONE : View.VISIBLE);
  if (item.hasSubMenu()) {
    actionView.setOnTouchListener(new ForwardingListener(actionView){
      @Override public ListPopupWindow getPopup(){
        return mActionButtonPopup != null ? mActionButtonPopup.getPopup() : null;
      }
      @Override protected boolean onForwardingStarted(){
        return onSubMenuSelected((SubMenuBuilder)item.getSubMenu());
      }
      @Override protected boolean onForwardingStopped(){
        return dismissPopupMenus();
      }
    }
);
  }
 else {
    actionView.setOnTouchListener(null);
  }
  final ActionMenuView menuParent=(ActionMenuView)parent;
  final ViewGroup.LayoutParams lp=actionView.getLayoutParams();
  if (!menuParent.checkLayoutParams(lp)) {
    actionView.setLayoutParams(menuParent.generateLayoutParams(lp));
  }
  return actionView;
}

Fixed version (ground truth):
@Override public View getItemView(final MenuItemImpl item,View convertView,ViewGroup parent){
  View actionView=item.getActionView();
  if (actionView == null || item.hasCollapsibleActionView()) {
    actionView=super.getItemView(item,convertView,parent);
  }
  actionView.setVisibility(item.isActionViewExpanded() ? View.GONE : View.VISIBLE);
  final ActionMenuView menuParent=(ActionMenuView)parent;
  final ViewGroup.LayoutParams lp=actionView.getLayoutParams();
  if (!menuParent.checkLayoutParams(lp)) {
    actionView.setLayoutParams(menuParent.generateLayoutParams(lp));
  }
  return actionView;
}
Program: 199766
Project: 199766
Buggy source:
@Override public void bindItemView(MenuItemImpl item,MenuView.ItemView itemView){
  itemView.initialize(item,0);
  final ActionMenuView menuView=(ActionMenuView)mMenuView;
  ActionMenuItemView actionItemView=(ActionMenuItemView)itemView;
  actionItemView.setItemInvoker(menuView);
}

Fixed version (ground truth):
@Override public void bindItemView(final MenuItemImpl item,MenuView.ItemView itemView){
  itemView.initialize(item,0);
  final ActionMenuView menuView=(ActionMenuView)mMenuView;
  final ActionMenuItemView actionItemView=(ActionMenuItemView)itemView;
  actionItemView.setItemInvoker(menuView);
  if (item.hasSubMenu()) {
    actionItemView.setOnTouchListener(new ForwardingListener(actionItemView){
      @Override public ListPopupWindow getPopup(){
        return mActionButtonPopup != null ? mActionButtonPopup.getPopup() : null;
      }
      @Override protected boolean onForwardingStarted(){
        return onSubMenuSelected((SubMenuBuilder)item.getSubMenu());
      }
      @Override protected boolean onForwardingStopped(){
        return dismissPopupMenus();
      }
    }
);
  }
 else {
    actionItemView.setOnTouchListener(null);
  }
}
Program: 199767
Project: 199767
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: 199768
Project: 199768
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: 199771
Project: 199771
Buggy source:
AnimationInfo(View view,String name,TransitionValues values){
  this.view=view;
  this.name=name;
  this.values=values;
}

Fixed version (ground truth):
AnimationInfo(View view,String name,WindowId windowId,TransitionValues values){
  this.view=view;
  this.name=name;
  this.values=values;
  this.windowId=windowId;
}
Program: 199772
Project: 199772
Buggy source:
/** 
 * Pauses this transition, sending out calls to   {@link TransitionListener#onTransitionPause(Transition)} to all listenersand pausing all running animators started by this transition.
 * @hide
 */
public void pause(){
  if (!mEnded) {
    ArrayMap<Animator,AnimationInfo> runningAnimators=getRunningAnimators();
    int numOldAnims=runningAnimators.size();
    for (int i=numOldAnims - 1; i >= 0; i--) {
      Animator anim=runningAnimators.keyAt(i);
      anim.pause();
    }
    if (mListeners != null && mListeners.size() > 0) {
      ArrayList<TransitionListener> tmpListeners=(ArrayList<TransitionListener>)mListeners.clone();
      int numListeners=tmpListeners.size();
      for (int i=0; i < numListeners; ++i) {
        tmpListeners.get(i).onTransitionPause(this);
      }
    }
    mPaused=true;
  }
}

Fixed version (ground truth):
/** 
 * Pauses this transition, sending out calls to   {@link TransitionListener#onTransitionPause(Transition)} to all listenersand pausing all running animators started by this transition.
 * @hide
 */
public void pause(View sceneRoot){
  if (!mEnded) {
    ArrayMap<Animator,AnimationInfo> runningAnimators=getRunningAnimators();
    int numOldAnims=runningAnimators.size();
    WindowId windowId=sceneRoot.getWindowId();
    for (int i=numOldAnims - 1; i >= 0; i--) {
      AnimationInfo info=runningAnimators.valueAt(i);
      if (info.view != null && windowId.equals(info.windowId)) {
        Animator anim=runningAnimators.keyAt(i);
        anim.pause();
      }
    }
    if (mListeners != null && mListeners.size() > 0) {
      ArrayList<TransitionListener> tmpListeners=(ArrayList<TransitionListener>)mListeners.clone();
      int numListeners=tmpListeners.size();
      for (int i=0; i < numListeners; ++i) {
        tmpListeners.get(i).onTransitionPause(this);
      }
    }
    mPaused=true;
  }
}
Program: 199773
Project: 199773
Buggy source:
/** 
 * Resumes this transition, sending out calls to   {@link TransitionListener#onTransitionPause(Transition)} to all listenersand pausing all running animators started by this transition.
 * @hide
 */
public void resume(){
  if (mPaused) {
    if (!mEnded) {
      ArrayMap<Animator,AnimationInfo> runningAnimators=getRunningAnimators();
      int numOldAnims=runningAnimators.size();
      for (int i=numOldAnims - 1; i >= 0; i--) {
        Animator anim=runningAnimators.keyAt(i);
        anim.resume();
      }
      if (mListeners != null && mListeners.size() > 0) {
        ArrayList<TransitionListener> tmpListeners=(ArrayList<TransitionListener>)mListeners.clone();
        int numListeners=tmpListeners.size();
        for (int i=0; i < numListeners; ++i) {
          tmpListeners.get(i).onTransitionResume(this);
        }
      }
    }
    mPaused=false;
  }
}

Fixed version (ground truth):
/** 
 * Resumes this transition, sending out calls to   {@link TransitionListener#onTransitionPause(Transition)} to all listenersand pausing all running animators started by this transition.
 * @hide
 */
public void resume(View sceneRoot){
  if (mPaused) {
    if (!mEnded) {
      ArrayMap<Animator,AnimationInfo> runningAnimators=getRunningAnimators();
      int numOldAnims=runningAnimators.size();
      WindowId windowId=sceneRoot.getWindowId();
      for (int i=numOldAnims - 1; i >= 0; i--) {
        AnimationInfo info=runningAnimators.valueAt(i);
        if (info.view != null && windowId.equals(info.windowId)) {
          Animator anim=runningAnimators.keyAt(i);
          anim.resume();
        }
      }
      if (mListeners != null && mListeners.size() > 0) {
        ArrayList<TransitionListener> tmpListeners=(ArrayList<TransitionListener>)mListeners.clone();
        int numListeners=tmpListeners.size();
        for (int i=0; i < numListeners; ++i) {
          tmpListeners.get(i).onTransitionResume(this);
        }
      }
    }
    mPaused=false;
  }
}
Program: 199774
Project: 199774
Buggy source:
private static void sceneChangeSetup(ViewGroup sceneRoot,Transition transition){
  ArrayList<Transition> runningTransitions=getRunningTransitions().get(sceneRoot);
  if (runningTransitions != null && runningTransitions.size() > 0) {
    for (    Transition runningTransition : runningTransitions) {
      runningTransition.pause();
    }
  }
  if (transition != null) {
    transition.captureValues(sceneRoot,true);
  }
  Scene previousScene=Scene.getCurrentScene(sceneRoot);
  if (previousScene != null) {
    previousScene.exit();
  }
}

Fixed version (ground truth):
private static void sceneChangeSetup(ViewGroup sceneRoot,Transition transition){
  ArrayList<Transition> runningTransitions=getRunningTransitions().get(sceneRoot);
  if (runningTransitions != null && runningTransitions.size() > 0) {
    for (    Transition runningTransition : runningTransitions) {
      runningTransition.pause(sceneRoot);
    }
  }
  if (transition != null) {
    transition.captureValues(sceneRoot,true);
  }
  Scene previousScene=Scene.getCurrentScene(sceneRoot);
  if (previousScene != null) {
    previousScene.exit();
  }
}
Program: 199775
Project: 199775
Buggy source:
@Override public boolean onPreDraw(){
  removeListeners();
  sPendingTransitions.remove(mSceneRoot);
  final ArrayMap<ViewGroup,ArrayList<Transition>> runningTransitions=getRunningTransitions();
  ArrayList<Transition> currentTransitions=runningTransitions.get(mSceneRoot);
  ArrayList<Transition> previousRunningTransitions=null;
  if (currentTransitions == null) {
    currentTransitions=new ArrayList<Transition>();
    runningTransitions.put(mSceneRoot,currentTransitions);
  }
 else   if (currentTransitions.size() > 0) {
    previousRunningTransitions=new ArrayList<Transition>(currentTransitions);
  }
  currentTransitions.add(mTransition);
  mTransition.addListener(new Transition.TransitionListenerAdapter(){
    @Override public void onTransitionEnd(    Transition transition){
      ArrayList<Transition> currentTransitions=runningTransitions.get(mSceneRoot);
      currentTransitions.remove(transition);
    }
  }
);
  mTransition.captureValues(mSceneRoot,false);
  if (previousRunningTransitions != null) {
    for (    Transition runningTransition : previousRunningTransitions) {
      runningTransition.resume();
    }
  }
  mTransition.playTransition(mSceneRoot);
  return true;
}

Fixed version (ground truth):
@Override public boolean onPreDraw(){
  removeListeners();
  sPendingTransitions.remove(mSceneRoot);
  final ArrayMap<ViewGroup,ArrayList<Transition>> runningTransitions=getRunningTransitions();
  ArrayList<Transition> currentTransitions=runningTransitions.get(mSceneRoot);
  ArrayList<Transition> previousRunningTransitions=null;
  if (currentTransitions == null) {
    currentTransitions=new ArrayList<Transition>();
    runningTransitions.put(mSceneRoot,currentTransitions);
  }
 else   if (currentTransitions.size() > 0) {
    previousRunningTransitions=new ArrayList<Transition>(currentTransitions);
  }
  currentTransitions.add(mTransition);
  mTransition.addListener(new Transition.TransitionListenerAdapter(){
    @Override public void onTransitionEnd(    Transition transition){
      ArrayList<Transition> currentTransitions=runningTransitions.get(mSceneRoot);
      currentTransitions.remove(transition);
    }
  }
);
  mTransition.captureValues(mSceneRoot,false);
  if (previousRunningTransitions != null) {
    for (    Transition runningTransition : previousRunningTransitions) {
      runningTransition.resume(mSceneRoot);
    }
  }
  mTransition.playTransition(mSceneRoot);
  return true;
}
Program: 199776
Project: 199776
Buggy source:
@Override public void onViewDetachedFromWindow(View v){
  removeListeners();
  sPendingTransitions.remove(mSceneRoot);
  ArrayList<Transition> runningTransitions=getRunningTransitions().get(mSceneRoot);
  if (runningTransitions != null && runningTransitions.size() > 0) {
    for (    Transition runningTransition : runningTransitions) {
      runningTransition.resume();
    }
  }
  mTransition.clearValues(true);
}

Fixed version (ground truth):
@Override public void onViewDetachedFromWindow(View v){
  removeListeners();
  sPendingTransitions.remove(mSceneRoot);
  ArrayList<Transition> runningTransitions=getRunningTransitions().get(mSceneRoot);
  if (runningTransitions != null && runningTransitions.size() > 0) {
    for (    Transition runningTransition : runningTransitions) {
      runningTransition.resume(mSceneRoot);
    }
  }
  mTransition.clearValues(true);
}
Program: 199777
Project: 199777
Buggy source:
/** 
 * @hide 
 */
@Override public void resume(){
  super.resume();
  int numTransitions=mTransitions.size();
  for (int i=0; i < numTransitions; ++i) {
    mTransitions.get(i).resume();
  }
}

Fixed version (ground truth):
/** 
 * @hide 
 */
@Override public void resume(View sceneRoot){
  super.resume(sceneRoot);
  int numTransitions=mTransitions.size();
  for (int i=0; i < numTransitions; ++i) {
    mTransitions.get(i).resume(sceneRoot);
  }
}
Program: 199778
Project: 199778
Buggy source:
/** 
 * @hide 
 */
@Override public void pause(){
  super.pause();
  int numTransitions=mTransitions.size();
  for (int i=0; i < numTransitions; ++i) {
    mTransitions.get(i).pause();
  }
}

Fixed version (ground truth):
/** 
 * @hide 
 */
@Override public void pause(View sceneRoot){
  super.pause(sceneRoot);
  int numTransitions=mTransitions.size();
  for (int i=0; i < numTransitions; ++i) {
    mTransitions.get(i).pause(sceneRoot);
  }
}
Program: 199780
Project: 199780
Buggy source:
AnimationInfo(View view,String name,TransitionValues values){
  this.view=view;
  this.name=name;
  this.values=values;
}

Fixed version (ground truth):
AnimationInfo(View view,String name,WindowId windowId,TransitionValues values){
  this.view=view;
  this.name=name;
  this.values=values;
  this.windowId=windowId;
}
Program: 199781
Project: 199781
Buggy source:
/** 
 * Pauses this transition, sending out calls to   {@link TransitionListener#onTransitionPause(Transition)} to all listenersand pausing all running animators started by this transition.
 * @hide
 */
public void pause(){
  if (!mEnded) {
    ArrayMap<Animator,AnimationInfo> runningAnimators=getRunningAnimators();
    int numOldAnims=runningAnimators.size();
    for (int i=numOldAnims - 1; i >= 0; i--) {
      Animator anim=runningAnimators.keyAt(i);
      anim.pause();
    }
    if (mListeners != null && mListeners.size() > 0) {
      ArrayList<TransitionListener> tmpListeners=(ArrayList<TransitionListener>)mListeners.clone();
      int numListeners=tmpListeners.size();
      for (int i=0; i < numListeners; ++i) {
        tmpListeners.get(i).onTransitionPause(this);
      }
    }
    mPaused=true;
  }
}

Fixed version (ground truth):
/** 
 * Pauses this transition, sending out calls to   {@link TransitionListener#onTransitionPause(Transition)} to all listenersand pausing all running animators started by this transition.
 * @hide
 */
public void pause(View sceneRoot){
  if (!mEnded) {
    ArrayMap<Animator,AnimationInfo> runningAnimators=getRunningAnimators();
    int numOldAnims=runningAnimators.size();
    WindowId windowId=sceneRoot.getWindowId();
    for (int i=numOldAnims - 1; i >= 0; i--) {
      AnimationInfo info=runningAnimators.valueAt(i);
      if (info.view != null && windowId.equals(info.windowId)) {
        Animator anim=runningAnimators.keyAt(i);
        anim.pause();
      }
    }
    if (mListeners != null && mListeners.size() > 0) {
      ArrayList<TransitionListener> tmpListeners=(ArrayList<TransitionListener>)mListeners.clone();
      int numListeners=tmpListeners.size();
      for (int i=0; i < numListeners; ++i) {
        tmpListeners.get(i).onTransitionPause(this);
      }
    }
    mPaused=true;
  }
}