nus-yam/ex-repair huggingface dataset:
Program: 199580
Project: 199580
Buggy source:
public void onPatternDetected(List<LockPatternView.Cell> pattern){
  if (mLockPatternUtils.checkPattern(pattern)) {
    mCallback.reportSuccessfulUnlockAttempt();
    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.reportFailedUnlockAttempt();
    }
    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.reportSuccessfulUnlockAttempt();
    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.reportFailedUnlockAttempt();
    }
    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: 199581
Project: 199581
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: 199582
Project: 199582
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: 199583
Project: 199583
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: 199584
Project: 199584
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: 199585
Project: 199585
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: 199586
Project: 199586
Buggy source:
public void onPatternDetected(List<LockPatternView.Cell> pattern){
  if (mLockPatternUtils.checkPattern(pattern)) {
    mCallback.reportSuccessfulUnlockAttempt();
    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.reportFailedUnlockAttempt();
    }
    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.reportSuccessfulUnlockAttempt();
    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.reportFailedUnlockAttempt();
    }
    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: 199587
Project: 199587
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: 199588
Project: 199588
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: 199589
Project: 199589
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: 199590
Project: 199590
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: 199591
Project: 199591
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: 199592
Project: 199592
Buggy source:
public void onPatternDetected(List<LockPatternView.Cell> pattern){
  if (mLockPatternUtils.checkPattern(pattern)) {
    mCallback.reportSuccessfulUnlockAttempt();
    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.reportFailedUnlockAttempt();
    }
    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.reportSuccessfulUnlockAttempt();
    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.reportFailedUnlockAttempt();
    }
    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: 199593
Project: 199593
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: 199594
Project: 199594
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: 199595
Project: 199595
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: 199596
Project: 199596
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: 199597
Project: 199597
Buggy source:
@Override public void handleMessage(Message msg){
  Console.log(Constants.DebugFlags.App.SystemUIHandshake,"String_Node_Str",msg);
  Context context=mContext.get();
  if (context == null)   return;
  if (msg.what == RecentsService.MSG_UPDATE_RECENTS_FOR_CONFIGURATION) {
    RecentsTaskLoader.initialize(context);
    RecentsConfiguration.reinitialize(context);
    try {
      Bundle data=msg.getData();
      Rect windowRect=(Rect)data.getParcelable("String_Node_Str");
      Rect systemInsets=(Rect)data.getParcelable("String_Node_Str");
      RecentsConfiguration.getInstance().updateSystemInsets(systemInsets);
      TaskStack stack=new TaskStack(context);
      TaskStackView tsv=new TaskStackView(context,stack);
      tsv.computeRects(windowRect.width(),windowRect.height() - systemInsets.top);
      tsv.boundScroll();
      TaskViewTransform transform=tsv.getStackTransform(0);
      Rect taskRect=new Rect(transform.rect);
      data.putParcelable("String_Node_Str",taskRect);
      Message reply=Message.obtain(null,RecentsService.MSG_UPDATE_RECENTS_FOR_CONFIGURATION,0,0);
      reply.setData(data);
      msg.replyTo.send(reply);
    }
 catch (    RemoteException re) {
      re.printStackTrace();
    }
  }
 else   if (msg.what == RecentsService.MSG_CLOSE_RECENTS) {
  }
 else   if (msg.what == RecentsService.MSG_TOGGLE_RECENTS) {
    Intent intent=new Intent(RecentsService.ACTION_TOGGLE_RECENTS_ACTIVITY);
    intent.setPackage(context.getPackageName());
    context.sendBroadcast(intent);
  }
}

Fixed version (ground truth):
@Override public void handleMessage(Message msg){
  Console.log(Constants.DebugFlags.App.SystemUIHandshake,"String_Node_Str",msg);
  Context context=mContext.get();
  if (context == null)   return;
  if (msg.what == RecentsService.MSG_UPDATE_RECENTS_FOR_CONFIGURATION) {
    RecentsTaskLoader.initialize(context);
    RecentsConfiguration.reinitialize(context);
    try {
      Bundle data=msg.getData();
      Rect windowRect=(Rect)data.getParcelable("String_Node_Str");
      Rect systemInsets=(Rect)data.getParcelable("String_Node_Str");
      TaskStack stack=new TaskStack(context);
      TaskStackView tsv=new TaskStackView(context,stack);
      tsv.computeRects(windowRect.width(),windowRect.height() - systemInsets.top,0);
      tsv.boundScroll();
      TaskViewTransform transform=tsv.getStackTransform(0);
      Rect taskRect=new Rect(transform.rect);
      data.putParcelable("String_Node_Str",taskRect);
      Message reply=Message.obtain(null,RecentsService.MSG_UPDATE_RECENTS_FOR_CONFIGURATION,0,0);
      reply.setData(data);
      msg.replyTo.send(reply);
    }
 catch (    RemoteException re) {
      re.printStackTrace();
    }
  }
 else   if (msg.what == RecentsService.MSG_CLOSE_RECENTS) {
  }
 else   if (msg.what == RecentsService.MSG_TOGGLE_RECENTS) {
    Intent intent=new Intent(RecentsService.ACTION_TOGGLE_RECENTS_ACTIVITY);
    intent.setPackage(context.getPackageName());
    context.sendBroadcast(intent);
  }
}
Program: 199598
Project: 199598
Buggy source:
/** 
 * Computes the stack and task rects 
 */
public void computeRects(int width,int height){
  RecentsConfiguration config=RecentsConfiguration.getInstance();
  mRect.set(0,0,width,height);
  mStackRect.set(mRect);
  mStackRect.bottom-=config.systemInsets.bottom;
  int smallestDimension=Math.min(width,height);
  int padding=(int)(Constants.Values.TaskStackView.StackPaddingPct * smallestDimension / 2f);
  mStackRect.inset(padding,padding);
  mStackRectSansPeek.set(mStackRect);
  mStackRectSansPeek.top+=Constants.Values.TaskStackView.StackPeekHeightPct * mStackRect.height();
  int minHeight=(int)(mStackRect.height() - (Constants.Values.TaskStackView.StackPeekHeightPct * mStackRect.height()));
  int size=Math.min(minHeight,Math.min(mStackRect.width(),mStackRect.height()));
  int centerX=mStackRect.centerX();
  mTaskRect.set(centerX - size / 2,mStackRectSansPeek.top,centerX + size / 2,mStackRectSansPeek.top + size);
  updateMinMaxScroll(false);
}

Fixed version (ground truth):
/** 
 * Computes the stack and task rects 
 */
public void computeRects(int width,int height,int insetBottom){
  mRect.set(0,0,width,height);
  mStackRect.set(mRect);
  mStackRect.bottom-=insetBottom;
  int smallestDimension=Math.min(width,height);
  int padding=(int)(Constants.Values.TaskStackView.StackPaddingPct * smallestDimension / 2f);
  mStackRect.inset(padding,padding);
  mStackRectSansPeek.set(mStackRect);
  mStackRectSansPeek.top+=Constants.Values.TaskStackView.StackPeekHeightPct * mStackRect.height();
  int minHeight=(int)(mStackRect.height() - (Constants.Values.TaskStackView.StackPeekHeightPct * mStackRect.height()));
  int size=Math.min(minHeight,Math.min(mStackRect.width(),mStackRect.height()));
  int centerX=mStackRect.centerX();
  mTaskRect.set(centerX - size / 2,mStackRectSansPeek.top,centerX + size / 2,mStackRectSansPeek.top + size);
  updateMinMaxScroll(false);
}
Program: 199599
Project: 199599
Buggy source:
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  int width=MeasureSpec.getSize(widthMeasureSpec);
  int height=MeasureSpec.getSize(heightMeasureSpec);
  Console.log(Constants.DebugFlags.UI.MeasureAndLayout,"String_Node_Str","String_Node_Str" + width + "String_Node_Str"+ height+ "String_Node_Str"+ mAwaitingFirstLayout,Console.AnsiGreen);
  computeRects(width,height);
  if (Constants.DebugFlags.UI.MeasureAndLayout) {
    Console.log("String_Node_Str" + mRect);
    Console.log("String_Node_Str" + mStackRect);
    Console.log("String_Node_Str" + mStackRectSansPeek);
    Console.log("String_Node_Str" + mTaskRect);
  }
  if (mAwaitingFirstLayout) {
    setStackScroll(mMaxScroll);
    requestSynchronizeStackViewsWithModel();
    synchronizeStackViewsWithModel();
    if (Constants.Values.TaskView.AnimateFrontTaskIconOnEnterRecents) {
      TaskView tv=(TaskView)getChildAt(getChildCount() - 1);
      if (tv != null) {
        tv.animateOnEnterRecents();
      }
    }
  }
  int childCount=getChildCount();
  for (int i=0; i < childCount; i++) {
    TaskView t=(TaskView)getChildAt(i);
    t.measure(MeasureSpec.makeMeasureSpec(mTaskRect.width(),MeasureSpec.EXACTLY),MeasureSpec.makeMeasureSpec(mTaskRect.height(),MeasureSpec.EXACTLY));
  }
  setMeasuredDimension(width,height);
}

Fixed version (ground truth):
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  int width=MeasureSpec.getSize(widthMeasureSpec);
  int height=MeasureSpec.getSize(heightMeasureSpec);
  Console.log(Constants.DebugFlags.UI.MeasureAndLayout,"String_Node_Str","String_Node_Str" + width + "String_Node_Str"+ height+ "String_Node_Str"+ mAwaitingFirstLayout,Console.AnsiGreen);
  RecentsConfiguration config=RecentsConfiguration.getInstance();
  computeRects(width,height,config.systemInsets.bottom);
  if (Constants.DebugFlags.UI.MeasureAndLayout) {
    Console.log("String_Node_Str" + mRect);
    Console.log("String_Node_Str" + mStackRect);
    Console.log("String_Node_Str" + mStackRectSansPeek);
    Console.log("String_Node_Str" + mTaskRect);
  }
  if (mAwaitingFirstLayout) {
    setStackScroll(mMaxScroll);
    requestSynchronizeStackViewsWithModel();
    synchronizeStackViewsWithModel();
    if (Constants.Values.TaskView.AnimateFrontTaskIconOnEnterRecents) {
      TaskView tv=(TaskView)getChildAt(getChildCount() - 1);
      if (tv != null) {
        tv.animateOnEnterRecents();
      }
    }
  }
  int childCount=getChildCount();
  for (int i=0; i < childCount; i++) {
    TaskView t=(TaskView)getChildAt(i);
    t.measure(MeasureSpec.makeMeasureSpec(mTaskRect.width(),MeasureSpec.EXACTLY),MeasureSpec.makeMeasureSpec(mTaskRect.height(),MeasureSpec.EXACTLY));
  }
  setMeasuredDimension(width,height);
}
Program: 199600
Project: 199600
Buggy source:
@Override protected void onDetachedFromWindow(){
  if (mIndeterminate) {
    stopAnimation();
  }
  if (mRefreshProgressRunnable != null) {
    removeCallbacks(mRefreshProgressRunnable);
  }
  if (mRefreshProgressRunnable != null && mRefreshIsPosted) {
    removeCallbacks(mRefreshProgressRunnable);
  }
  if (mAccessibilityEventSender != null) {
    removeCallbacks(mAccessibilityEventSender);
  }
  super.onDetachedFromWindow();
  mAttached=false;
}

Fixed version (ground truth):
@Override protected void onDetachedFromWindow(){
  if (mIndeterminate) {
    stopAnimation();
  }
  if (mRefreshProgressRunnable != null) {
    removeCallbacks(mRefreshProgressRunnable);
    mRefreshIsPosted=false;
  }
  if (mAccessibilityEventSender != null) {
    removeCallbacks(mAccessibilityEventSender);
  }
  super.onDetachedFromWindow();
  mAttached=false;
}
Program: 199601
Project: 199601
Buggy source:
@Override public void handleMessage(Message msg){
  Console.log(Constants.DebugFlags.App.SystemUIHandshake,"String_Node_Str",msg);
  Context context=mContext.get();
  if (context == null)   return;
  if (msg.what == RecentsService.MSG_UPDATE_RECENTS_FOR_CONFIGURATION) {
    RecentsTaskLoader.initialize(context);
    RecentsConfiguration.reinitialize(context);
    try {
      Bundle data=msg.getData();
      Rect windowRect=(Rect)data.getParcelable("String_Node_Str");
      Rect systemInsets=(Rect)data.getParcelable("String_Node_Str");
      RecentsConfiguration.getInstance().updateSystemInsets(systemInsets);
      TaskStack stack=new TaskStack(context);
      TaskStackView tsv=new TaskStackView(context,stack);
      tsv.computeRects(windowRect.width(),windowRect.height() - systemInsets.top);
      tsv.boundScroll();
      TaskViewTransform transform=tsv.getStackTransform(0);
      Rect taskRect=new Rect(transform.rect);
      data.putParcelable("String_Node_Str",taskRect);
      Message reply=Message.obtain(null,RecentsService.MSG_UPDATE_RECENTS_FOR_CONFIGURATION,0,0);
      reply.setData(data);
      msg.replyTo.send(reply);
    }
 catch (    RemoteException re) {
      re.printStackTrace();
    }
  }
 else   if (msg.what == RecentsService.MSG_CLOSE_RECENTS) {
  }
 else   if (msg.what == RecentsService.MSG_TOGGLE_RECENTS) {
    Intent intent=new Intent(RecentsService.ACTION_TOGGLE_RECENTS_ACTIVITY);
    intent.setPackage(context.getPackageName());
    context.sendBroadcast(intent);
  }
}

Fixed version (ground truth):
@Override public void handleMessage(Message msg){
  Console.log(Constants.DebugFlags.App.SystemUIHandshake,"String_Node_Str",msg);
  Context context=mContext.get();
  if (context == null)   return;
  if (msg.what == RecentsService.MSG_UPDATE_RECENTS_FOR_CONFIGURATION) {
    RecentsTaskLoader.initialize(context);
    RecentsConfiguration.reinitialize(context);
    try {
      Bundle data=msg.getData();
      Rect windowRect=(Rect)data.getParcelable("String_Node_Str");
      Rect systemInsets=(Rect)data.getParcelable("String_Node_Str");
      TaskStack stack=new TaskStack(context);
      TaskStackView tsv=new TaskStackView(context,stack);
      tsv.computeRects(windowRect.width(),windowRect.height() - systemInsets.top,0);
      tsv.boundScroll();
      TaskViewTransform transform=tsv.getStackTransform(0);
      Rect taskRect=new Rect(transform.rect);
      data.putParcelable("String_Node_Str",taskRect);
      Message reply=Message.obtain(null,RecentsService.MSG_UPDATE_RECENTS_FOR_CONFIGURATION,0,0);
      reply.setData(data);
      msg.replyTo.send(reply);
    }
 catch (    RemoteException re) {
      re.printStackTrace();
    }
  }
 else   if (msg.what == RecentsService.MSG_CLOSE_RECENTS) {
  }
 else   if (msg.what == RecentsService.MSG_TOGGLE_RECENTS) {
    Intent intent=new Intent(RecentsService.ACTION_TOGGLE_RECENTS_ACTIVITY);
    intent.setPackage(context.getPackageName());
    context.sendBroadcast(intent);
  }
}
Program: 199602
Project: 199602
Buggy source:
/** 
 * Computes the stack and task rects 
 */
public void computeRects(int width,int height){
  RecentsConfiguration config=RecentsConfiguration.getInstance();
  mRect.set(0,0,width,height);
  mStackRect.set(mRect);
  mStackRect.bottom-=config.systemInsets.bottom;
  int smallestDimension=Math.min(width,height);
  int padding=(int)(Constants.Values.TaskStackView.StackPaddingPct * smallestDimension / 2f);
  mStackRect.inset(padding,padding);
  mStackRectSansPeek.set(mStackRect);
  mStackRectSansPeek.top+=Constants.Values.TaskStackView.StackPeekHeightPct * mStackRect.height();
  int minHeight=(int)(mStackRect.height() - (Constants.Values.TaskStackView.StackPeekHeightPct * mStackRect.height()));
  int size=Math.min(minHeight,Math.min(mStackRect.width(),mStackRect.height()));
  int centerX=mStackRect.centerX();
  mTaskRect.set(centerX - size / 2,mStackRectSansPeek.top,centerX + size / 2,mStackRectSansPeek.top + size);
  updateMinMaxScroll(false);
}

Fixed version (ground truth):
/** 
 * Computes the stack and task rects 
 */
public void computeRects(int width,int height,int insetBottom){
  mRect.set(0,0,width,height);
  mStackRect.set(mRect);
  mStackRect.bottom-=insetBottom;
  int smallestDimension=Math.min(width,height);
  int padding=(int)(Constants.Values.TaskStackView.StackPaddingPct * smallestDimension / 2f);
  mStackRect.inset(padding,padding);
  mStackRectSansPeek.set(mStackRect);
  mStackRectSansPeek.top+=Constants.Values.TaskStackView.StackPeekHeightPct * mStackRect.height();
  int minHeight=(int)(mStackRect.height() - (Constants.Values.TaskStackView.StackPeekHeightPct * mStackRect.height()));
  int size=Math.min(minHeight,Math.min(mStackRect.width(),mStackRect.height()));
  int centerX=mStackRect.centerX();
  mTaskRect.set(centerX - size / 2,mStackRectSansPeek.top,centerX + size / 2,mStackRectSansPeek.top + size);
  updateMinMaxScroll(false);
}
Program: 199603
Project: 199603
Buggy source:
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  int width=MeasureSpec.getSize(widthMeasureSpec);
  int height=MeasureSpec.getSize(heightMeasureSpec);
  Console.log(Constants.DebugFlags.UI.MeasureAndLayout,"String_Node_Str","String_Node_Str" + width + "String_Node_Str"+ height+ "String_Node_Str"+ mAwaitingFirstLayout,Console.AnsiGreen);
  computeRects(width,height);
  if (Constants.DebugFlags.UI.MeasureAndLayout) {
    Console.log("String_Node_Str" + mRect);
    Console.log("String_Node_Str" + mStackRect);
    Console.log("String_Node_Str" + mStackRectSansPeek);
    Console.log("String_Node_Str" + mTaskRect);
  }
  if (mAwaitingFirstLayout) {
    setStackScroll(mMaxScroll);
    requestSynchronizeStackViewsWithModel();
    synchronizeStackViewsWithModel();
    if (Constants.Values.TaskView.AnimateFrontTaskIconOnEnterRecents) {
      TaskView tv=(TaskView)getChildAt(getChildCount() - 1);
      if (tv != null) {
        tv.animateOnEnterRecents();
      }
    }
  }
  int childCount=getChildCount();
  for (int i=0; i < childCount; i++) {
    TaskView t=(TaskView)getChildAt(i);
    t.measure(MeasureSpec.makeMeasureSpec(mTaskRect.width(),MeasureSpec.EXACTLY),MeasureSpec.makeMeasureSpec(mTaskRect.height(),MeasureSpec.EXACTLY));
  }
  setMeasuredDimension(width,height);
}

Fixed version (ground truth):
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  int width=MeasureSpec.getSize(widthMeasureSpec);
  int height=MeasureSpec.getSize(heightMeasureSpec);
  Console.log(Constants.DebugFlags.UI.MeasureAndLayout,"String_Node_Str","String_Node_Str" + width + "String_Node_Str"+ height+ "String_Node_Str"+ mAwaitingFirstLayout,Console.AnsiGreen);
  RecentsConfiguration config=RecentsConfiguration.getInstance();
  computeRects(width,height,config.systemInsets.bottom);
  if (Constants.DebugFlags.UI.MeasureAndLayout) {
    Console.log("String_Node_Str" + mRect);
    Console.log("String_Node_Str" + mStackRect);
    Console.log("String_Node_Str" + mStackRectSansPeek);
    Console.log("String_Node_Str" + mTaskRect);
  }
  if (mAwaitingFirstLayout) {
    setStackScroll(mMaxScroll);
    requestSynchronizeStackViewsWithModel();
    synchronizeStackViewsWithModel();
    if (Constants.Values.TaskView.AnimateFrontTaskIconOnEnterRecents) {
      TaskView tv=(TaskView)getChildAt(getChildCount() - 1);
      if (tv != null) {
        tv.animateOnEnterRecents();
      }
    }
  }
  int childCount=getChildCount();
  for (int i=0; i < childCount; i++) {
    TaskView t=(TaskView)getChildAt(i);
    t.measure(MeasureSpec.makeMeasureSpec(mTaskRect.width(),MeasureSpec.EXACTLY),MeasureSpec.makeMeasureSpec(mTaskRect.height(),MeasureSpec.EXACTLY));
  }
  setMeasuredDimension(width,height);
}
Program: 199604
Project: 199604
Buggy source:
@Override public void handleMessage(Message msg){
  Console.log(Constants.DebugFlags.App.SystemUIHandshake,"String_Node_Str",msg);
  Context context=mContext.get();
  if (context == null)   return;
  if (msg.what == RecentsService.MSG_UPDATE_RECENTS_FOR_CONFIGURATION) {
    RecentsTaskLoader.initialize(context);
    RecentsConfiguration.reinitialize(context);
    try {
      Bundle data=msg.getData();
      Rect windowRect=(Rect)data.getParcelable("String_Node_Str");
      Rect systemInsets=(Rect)data.getParcelable("String_Node_Str");
      RecentsConfiguration.getInstance().updateSystemInsets(systemInsets);
      TaskStack stack=new TaskStack(context);
      TaskStackView tsv=new TaskStackView(context,stack);
      tsv.computeRects(windowRect.width(),windowRect.height() - systemInsets.top);
      tsv.boundScroll();
      TaskViewTransform transform=tsv.getStackTransform(0);
      Rect taskRect=new Rect(transform.rect);
      data.putParcelable("String_Node_Str",taskRect);
      Message reply=Message.obtain(null,RecentsService.MSG_UPDATE_RECENTS_FOR_CONFIGURATION,0,0);
      reply.setData(data);
      msg.replyTo.send(reply);
    }
 catch (    RemoteException re) {
      re.printStackTrace();
    }
  }
 else   if (msg.what == RecentsService.MSG_CLOSE_RECENTS) {
  }
 else   if (msg.what == RecentsService.MSG_TOGGLE_RECENTS) {
    Intent intent=new Intent(RecentsService.ACTION_TOGGLE_RECENTS_ACTIVITY);
    intent.setPackage(context.getPackageName());
    context.sendBroadcast(intent);
  }
}

Fixed version (ground truth):
@Override public void handleMessage(Message msg){
  Console.log(Constants.DebugFlags.App.SystemUIHandshake,"String_Node_Str",msg);
  Context context=mContext.get();
  if (context == null)   return;
  if (msg.what == RecentsService.MSG_UPDATE_RECENTS_FOR_CONFIGURATION) {
    RecentsTaskLoader.initialize(context);
    RecentsConfiguration.reinitialize(context);
    try {
      Bundle data=msg.getData();
      Rect windowRect=(Rect)data.getParcelable("String_Node_Str");
      Rect systemInsets=(Rect)data.getParcelable("String_Node_Str");
      TaskStack stack=new TaskStack(context);
      TaskStackView tsv=new TaskStackView(context,stack);
      tsv.computeRects(windowRect.width(),windowRect.height() - systemInsets.top,0);
      tsv.boundScroll();
      TaskViewTransform transform=tsv.getStackTransform(0);
      Rect taskRect=new Rect(transform.rect);
      data.putParcelable("String_Node_Str",taskRect);
      Message reply=Message.obtain(null,RecentsService.MSG_UPDATE_RECENTS_FOR_CONFIGURATION,0,0);
      reply.setData(data);
      msg.replyTo.send(reply);
    }
 catch (    RemoteException re) {
      re.printStackTrace();
    }
  }
 else   if (msg.what == RecentsService.MSG_CLOSE_RECENTS) {
  }
 else   if (msg.what == RecentsService.MSG_TOGGLE_RECENTS) {
    Intent intent=new Intent(RecentsService.ACTION_TOGGLE_RECENTS_ACTIVITY);
    intent.setPackage(context.getPackageName());
    context.sendBroadcast(intent);
  }
}
Program: 199605
Project: 199605
Buggy source:
/** 
 * Computes the stack and task rects 
 */
public void computeRects(int width,int height){
  RecentsConfiguration config=RecentsConfiguration.getInstance();
  mRect.set(0,0,width,height);
  mStackRect.set(mRect);
  mStackRect.bottom-=config.systemInsets.bottom;
  int smallestDimension=Math.min(width,height);
  int padding=(int)(Constants.Values.TaskStackView.StackPaddingPct * smallestDimension / 2f);
  mStackRect.inset(padding,padding);
  mStackRectSansPeek.set(mStackRect);
  mStackRectSansPeek.top+=Constants.Values.TaskStackView.StackPeekHeightPct * mStackRect.height();
  int minHeight=(int)(mStackRect.height() - (Constants.Values.TaskStackView.StackPeekHeightPct * mStackRect.height()));
  int size=Math.min(minHeight,Math.min(mStackRect.width(),mStackRect.height()));
  int centerX=mStackRect.centerX();
  mTaskRect.set(centerX - size / 2,mStackRectSansPeek.top,centerX + size / 2,mStackRectSansPeek.top + size);
  updateMinMaxScroll(false);
}

Fixed version (ground truth):
/** 
 * Computes the stack and task rects 
 */
public void computeRects(int width,int height,int insetBottom){
  mRect.set(0,0,width,height);
  mStackRect.set(mRect);
  mStackRect.bottom-=insetBottom;
  int smallestDimension=Math.min(width,height);
  int padding=(int)(Constants.Values.TaskStackView.StackPaddingPct * smallestDimension / 2f);
  mStackRect.inset(padding,padding);
  mStackRectSansPeek.set(mStackRect);
  mStackRectSansPeek.top+=Constants.Values.TaskStackView.StackPeekHeightPct * mStackRect.height();
  int minHeight=(int)(mStackRect.height() - (Constants.Values.TaskStackView.StackPeekHeightPct * mStackRect.height()));
  int size=Math.min(minHeight,Math.min(mStackRect.width(),mStackRect.height()));
  int centerX=mStackRect.centerX();
  mTaskRect.set(centerX - size / 2,mStackRectSansPeek.top,centerX + size / 2,mStackRectSansPeek.top + size);
  updateMinMaxScroll(false);
}
Program: 199606
Project: 199606
Buggy source:
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  int width=MeasureSpec.getSize(widthMeasureSpec);
  int height=MeasureSpec.getSize(heightMeasureSpec);
  Console.log(Constants.DebugFlags.UI.MeasureAndLayout,"String_Node_Str","String_Node_Str" + width + "String_Node_Str"+ height+ "String_Node_Str"+ mAwaitingFirstLayout,Console.AnsiGreen);
  computeRects(width,height);
  if (Constants.DebugFlags.UI.MeasureAndLayout) {
    Console.log("String_Node_Str" + mRect);
    Console.log("String_Node_Str" + mStackRect);
    Console.log("String_Node_Str" + mStackRectSansPeek);
    Console.log("String_Node_Str" + mTaskRect);
  }
  if (mAwaitingFirstLayout) {
    setStackScroll(mMaxScroll);
    requestSynchronizeStackViewsWithModel();
    synchronizeStackViewsWithModel();
    if (Constants.Values.TaskView.AnimateFrontTaskIconOnEnterRecents) {
      TaskView tv=(TaskView)getChildAt(getChildCount() - 1);
      if (tv != null) {
        tv.animateOnEnterRecents();
      }
    }
  }
  int childCount=getChildCount();
  for (int i=0; i < childCount; i++) {
    TaskView t=(TaskView)getChildAt(i);
    t.measure(MeasureSpec.makeMeasureSpec(mTaskRect.width(),MeasureSpec.EXACTLY),MeasureSpec.makeMeasureSpec(mTaskRect.height(),MeasureSpec.EXACTLY));
  }
  setMeasuredDimension(width,height);
}

Fixed version (ground truth):
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  int width=MeasureSpec.getSize(widthMeasureSpec);
  int height=MeasureSpec.getSize(heightMeasureSpec);
  Console.log(Constants.DebugFlags.UI.MeasureAndLayout,"String_Node_Str","String_Node_Str" + width + "String_Node_Str"+ height+ "String_Node_Str"+ mAwaitingFirstLayout,Console.AnsiGreen);
  RecentsConfiguration config=RecentsConfiguration.getInstance();
  computeRects(width,height,config.systemInsets.bottom);
  if (Constants.DebugFlags.UI.MeasureAndLayout) {
    Console.log("String_Node_Str" + mRect);
    Console.log("String_Node_Str" + mStackRect);
    Console.log("String_Node_Str" + mStackRectSansPeek);
    Console.log("String_Node_Str" + mTaskRect);
  }
  if (mAwaitingFirstLayout) {
    setStackScroll(mMaxScroll);
    requestSynchronizeStackViewsWithModel();
    synchronizeStackViewsWithModel();
    if (Constants.Values.TaskView.AnimateFrontTaskIconOnEnterRecents) {
      TaskView tv=(TaskView)getChildAt(getChildCount() - 1);
      if (tv != null) {
        tv.animateOnEnterRecents();
      }
    }
  }
  int childCount=getChildCount();
  for (int i=0; i < childCount; i++) {
    TaskView t=(TaskView)getChildAt(i);
    t.measure(MeasureSpec.makeMeasureSpec(mTaskRect.width(),MeasureSpec.EXACTLY),MeasureSpec.makeMeasureSpec(mTaskRect.height(),MeasureSpec.EXACTLY));
  }
  setMeasuredDimension(width,height);
}
Program: 199612
Project: 199612
Buggy source:
private void unblockScreenOn(){
  if (mScreenOnWasBlocked) {
    mScreenOnWasBlocked=false;
    if (DEBUG) {
      Slog.d(TAG,"String_Node_Str" + (SystemClock.elapsedRealtime() - mScreenOnBlockStartRealTime) + "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
private void unblockScreenOn(){
  if (mScreenOnWasBlocked) {
    mScreenOnWasBlocked=false;
    long delay=SystemClock.elapsedRealtime() - mScreenOnBlockStartRealTime;
    if (delay > 1000 || DEBUG) {
      Slog.d(TAG,"String_Node_Str" + delay + "String_Node_Str");
    }
  }
}
Program: 199613
Project: 199613
Buggy source:
private void setScreenOn(boolean on){
  if (!mPowerState.isScreenOn() == on) {
    mPowerState.setScreenOn(on);
    if (on) {
      mNotifier.onScreenOn();
    }
 else {
      mNotifier.onScreenOff();
    }
  }
}

Fixed version (ground truth):
private void setScreenOn(boolean on){
  if (mPowerState.isScreenOn() != on) {
    mPowerState.setScreenOn(on);
    if (on) {
      mNotifier.onScreenOn();
    }
 else {
      mNotifier.onScreenOff();
    }
  }
}
Program: 199614
Project: 199614
Buggy source:
public boolean setState(boolean on,int backlight){
synchronized (mLock) {
    if (on != mPendingOn || backlight != mPendingBacklight) {
      if (DEBUG) {
        Slog.d(TAG,"String_Node_Str" + on + "String_Node_Str"+ backlight);
      }
      mPendingOn=on;
      mPendingBacklight=backlight;
      if (!mChangeInProgress) {
        mChangeInProgress=true;
        AsyncTask.THREAD_POOL_EXECUTOR.execute(mTask);
      }
    }
    return mChangeInProgress;
  }
}

Fixed version (ground truth):
public boolean setState(boolean on,int backlight){
synchronized (mLock) {
    if (on != mPendingOn || backlight != mPendingBacklight) {
      if (DEBUG) {
        Slog.d(TAG,"String_Node_Str" + on + "String_Node_Str"+ backlight);
      }
      mPendingOn=on;
      mPendingBacklight=backlight;
      if (!mChangeInProgress) {
        mChangeInProgress=true;
        AsyncTask.THREAD_POOL_EXECUTOR.execute(mTask);
      }
    }
    return !mChangeInProgress;
  }
}