nus-yam/ex-repair huggingface dataset:
Program: 199468
Project: 199468
Buggy source:
/** 
 * Perform the common clean-up of an activity record.  This is called both as part of destroyActivityLocked() (when destroying the client-side representation) and cleaning things up as a result of its hosting processing going away, in which case there is no remaining client-side state to destroy so only the cleanup here is needed.
 */
final void cleanUpActivityLocked(ActivityRecord r,boolean cleanServices,boolean setState){
  if (mResumedActivity == r) {
    mResumedActivity=null;
  }
  if (mService.mFocusedActivity == r) {
    mService.mFocusedActivity=null;
  }
  r.configDestroy=false;
  r.frozenBeforeDestroy=false;
  if (setState) {
    if (DEBUG_STATES)     Slog.v(TAG,"String_Node_Str" + r + "String_Node_Str");
    r.state=ActivityState.DESTROYED;
    if (DEBUG_APP)     Slog.v(TAG,"String_Node_Str" + r);
    r.app=null;
  }
  mStackSupervisor.mFinishingActivities.remove(r);
  mStackSupervisor.mWaitingVisibleActivities.remove(r);
  if (r.finishing && r.pendingResults != null) {
    for (    WeakReference<PendingIntentRecord> apr : r.pendingResults) {
      PendingIntentRecord rec=apr.get();
      if (rec != null) {
        mService.cancelIntentSenderLocked(rec,false);
      }
    }
    r.pendingResults=null;
  }
  if (cleanServices) {
    cleanUpActivityServicesLocked(r);
  }
  if (!mService.mPendingThumbnails.isEmpty()) {
    mStackSupervisor.mCancelledThumbnails.add(r);
  }
  removeTimeoutsForActivityLocked(r);
}

Fixed version (ground truth):
/** 
 * Perform the common clean-up of an activity record.  This is called both as part of destroyActivityLocked() (when destroying the client-side representation) and cleaning things up as a result of its hosting processing going away, in which case there is no remaining client-side state to destroy so only the cleanup here is needed.
 */
final void cleanUpActivityLocked(ActivityRecord r,boolean cleanServices,boolean setState){
  if (mResumedActivity == r) {
    mResumedActivity=null;
  }
  if (mPausingActivity == r) {
    mPausingActivity=null;
  }
  if (mService.mFocusedActivity == r) {
    mService.mFocusedActivity=null;
  }
  r.configDestroy=false;
  r.frozenBeforeDestroy=false;
  if (setState) {
    if (DEBUG_STATES)     Slog.v(TAG,"String_Node_Str" + r + "String_Node_Str");
    r.state=ActivityState.DESTROYED;
    if (DEBUG_APP)     Slog.v(TAG,"String_Node_Str" + r);
    r.app=null;
  }
  mStackSupervisor.mFinishingActivities.remove(r);
  mStackSupervisor.mWaitingVisibleActivities.remove(r);
  if (r.finishing && r.pendingResults != null) {
    for (    WeakReference<PendingIntentRecord> apr : r.pendingResults) {
      PendingIntentRecord rec=apr.get();
      if (rec != null) {
        mService.cancelIntentSenderLocked(rec,false);
      }
    }
    r.pendingResults=null;
  }
  if (cleanServices) {
    cleanUpActivityServicesLocked(r);
  }
  if (!mService.mPendingThumbnails.isEmpty()) {
    mStackSupervisor.mCancelledThumbnails.add(r);
  }
  removeTimeoutsForActivityLocked(r);
}
Program: 199469
Project: 199469
Buggy source:
/** 
 * Perform the common clean-up of an activity record.  This is called both as part of destroyActivityLocked() (when destroying the client-side representation) and cleaning things up as a result of its hosting processing going away, in which case there is no remaining client-side state to destroy so only the cleanup here is needed.
 */
final void cleanUpActivityLocked(ActivityRecord r,boolean cleanServices,boolean setState){
  if (mResumedActivity == r) {
    mResumedActivity=null;
  }
  if (mService.mFocusedActivity == r) {
    mService.mFocusedActivity=null;
  }
  r.configDestroy=false;
  r.frozenBeforeDestroy=false;
  if (setState) {
    if (DEBUG_STATES)     Slog.v(TAG,"String_Node_Str" + r + "String_Node_Str");
    r.state=ActivityState.DESTROYED;
    if (DEBUG_APP)     Slog.v(TAG,"String_Node_Str" + r);
    r.app=null;
  }
  mStackSupervisor.mFinishingActivities.remove(r);
  mStackSupervisor.mWaitingVisibleActivities.remove(r);
  if (r.finishing && r.pendingResults != null) {
    for (    WeakReference<PendingIntentRecord> apr : r.pendingResults) {
      PendingIntentRecord rec=apr.get();
      if (rec != null) {
        mService.cancelIntentSenderLocked(rec,false);
      }
    }
    r.pendingResults=null;
  }
  if (cleanServices) {
    cleanUpActivityServicesLocked(r);
  }
  if (!mService.mPendingThumbnails.isEmpty()) {
    mStackSupervisor.mCancelledThumbnails.add(r);
  }
  removeTimeoutsForActivityLocked(r);
}

Fixed version (ground truth):
/** 
 * Perform the common clean-up of an activity record.  This is called both as part of destroyActivityLocked() (when destroying the client-side representation) and cleaning things up as a result of its hosting processing going away, in which case there is no remaining client-side state to destroy so only the cleanup here is needed.
 */
final void cleanUpActivityLocked(ActivityRecord r,boolean cleanServices,boolean setState){
  if (mResumedActivity == r) {
    mResumedActivity=null;
  }
  if (mPausingActivity == r) {
    mPausingActivity=null;
  }
  if (mService.mFocusedActivity == r) {
    mService.mFocusedActivity=null;
  }
  r.configDestroy=false;
  r.frozenBeforeDestroy=false;
  if (setState) {
    if (DEBUG_STATES)     Slog.v(TAG,"String_Node_Str" + r + "String_Node_Str");
    r.state=ActivityState.DESTROYED;
    if (DEBUG_APP)     Slog.v(TAG,"String_Node_Str" + r);
    r.app=null;
  }
  mStackSupervisor.mFinishingActivities.remove(r);
  mStackSupervisor.mWaitingVisibleActivities.remove(r);
  if (r.finishing && r.pendingResults != null) {
    for (    WeakReference<PendingIntentRecord> apr : r.pendingResults) {
      PendingIntentRecord rec=apr.get();
      if (rec != null) {
        mService.cancelIntentSenderLocked(rec,false);
      }
    }
    r.pendingResults=null;
  }
  if (cleanServices) {
    cleanUpActivityServicesLocked(r);
  }
  if (!mService.mPendingThumbnails.isEmpty()) {
    mStackSupervisor.mCancelledThumbnails.add(r);
  }
  removeTimeoutsForActivityLocked(r);
}
Program: 199470
Project: 199470
Buggy source:
@LayoutlibDelegate static void nativeDraw(int canvas_instance,Rect loc,int bitmap_instance,byte[] c,int paint_instance_or_null,int destDensity,int srcDensity){
  draw(canvas_instance,loc.left,loc.top,loc.width(),loc.height(),bitmap_instance,c,paint_instance_or_null,destDensity,srcDensity);
}

Fixed version (ground truth):
@LayoutlibDelegate static void nativeDraw(int canvas_instance,Rect loc,int bitmap_instance,byte[] c,int paint_instance_or_null,int destDensity,int srcDensity){
  draw(canvas_instance,loc.left,loc.top,loc.right,loc.bottom,bitmap_instance,c,paint_instance_or_null,destDensity,srcDensity);
}
Program: 199472
Project: 199472
Buggy source:
@Override public void onBootPhase(int phase){
  if (phase == SystemService.PHASE_SYSTEM_SERVICES_READY) {
    mSystemReady=true;
    mAudioManager=(AudioManager)getContext().getSystemService(Context.AUDIO_SERVICE);
    rebindListenerServices();
  }
}

Fixed version (ground truth):
@Override public void onBootPhase(int phase){
  if (phase == SystemService.PHASE_SYSTEM_SERVICES_READY) {
    mSystemReady=true;
    mAudioManager=(AudioManager)getContext().getSystemService(Context.AUDIO_SERVICE);
  }
 else   if (phase == SystemService.PHASE_THIRD_PARTY_APPS_CAN_START) {
    mSettingsObserver.observe();
  }
}
Program: 199474
Project: 199474
Buggy source:
public Task(int id,Intent intent,String activityTitle,Drawable icon,Bitmap thumbnail){
  this.key=new TaskKey(id,intent);
  this.title=activityTitle;
  this.icon=icon;
  this.thumbnail=thumbnail;
}

Fixed version (ground truth):
public Task(int id,boolean isActive,Intent intent,String activityTitle,Drawable icon,Bitmap thumbnail){
  this.key=new TaskKey(id,intent);
  this.title=activityTitle;
  this.icon=icon;
  this.thumbnail=thumbnail;
  this.isActive=isActive;
}
Program: 199477
Project: 199477
Buggy source:
/** 
 * Reset all of the state associated with being bound to an input method.
 */
void clearBindingLocked(){
  clearConnectionLocked();
  setInputChannelLocked(null);
  mBindSequence=-1;
  mCurId=null;
  mCurMethod=null;
}

Fixed version (ground truth):
/** 
 * Reset all of the state associated with being bound to an input method.
 */
void clearBindingLocked(){
  if (DEBUG)   Log.v(TAG,"String_Node_Str");
  clearConnectionLocked();
  setInputChannelLocked(null);
  mBindSequence=-1;
  mCurId=null;
  mCurMethod=null;
}
Program: 199478
Project: 199478
Buggy source:
@Override public void sessionCreated(IInputMethodSession session){
  mParentIMMS.onSessionCreated(mMethod,session,mChannel);
}

Fixed version (ground truth):
@Override public void sessionCreated(IInputMethodSession session){
  long ident=Binder.clearCallingIdentity();
  try {
    mParentIMMS.onSessionCreated(mMethod,session,mChannel);
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
}
Program: 199479
Project: 199479
Buggy source:
/** 
 * Internal function called to process an animation frame on an animation that is currently sleeping through its <code>startDelay</code> phase. The return value indicates whether it should be woken up and put on the active animations queue.
 * @param currentTime The current animation time, used to calculate whether the animationhas exceeded its <code>startDelay</code> and should be started.
 * @return True if the animation's <code>startDelay</code> has been exceeded and the animationshould be added to the set of active animations.
 */
private boolean delayedAnimationFrame(long currentTime){
  if (!mStartedDelay) {
    mStartedDelay=true;
    mDelayStartTime=currentTime;
  }
 else {
    if (mPaused) {
      if (mPauseTime < 0) {
        mPauseTime=currentTime;
      }
      return false;
    }
 else     if (mResumed) {
      mResumed=false;
      if (mPauseTime > 0) {
        mDelayStartTime+=(currentTime - mPauseTime);
      }
    }
    long deltaTime=currentTime - mDelayStartTime;
    if (deltaTime > mStartDelay) {
      mStartTime=currentTime - (deltaTime - mStartDelay);
      mPlayingState=RUNNING;
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Internal function called to process an animation frame on an animation that is currently sleeping through its <code>startDelay</code> phase. The return value indicates whether it should be woken up and put on the active animations queue.
 * @param currentTime The current animation time, used to calculate whether the animationhas exceeded its <code>startDelay</code> and should be started.
 * @return True if the animation's <code>startDelay</code> has been exceeded and the animationshould be added to the set of active animations.
 */
private boolean delayedAnimationFrame(long currentTime){
  if (!mStartedDelay) {
    mStartedDelay=true;
    mDelayStartTime=currentTime;
  }
  if (mPaused) {
    if (mPauseTime < 0) {
      mPauseTime=currentTime;
    }
    return false;
  }
 else   if (mResumed) {
    mResumed=false;
    if (mPauseTime > 0) {
      mDelayStartTime+=(currentTime - mPauseTime);
    }
  }
  long deltaTime=currentTime - mDelayStartTime;
  if (deltaTime > mStartDelay) {
    mStartTime=currentTime - (deltaTime - mStartDelay);
    mPlayingState=RUNNING;
    return true;
  }
  return false;
}
Program: 199481
Project: 199481
Buggy source:
@Override public void onBootPhase(int phase){
  if (phase == SystemService.PHASE_SYSTEM_SERVICES_READY) {
    mSystemReady=true;
    mAudioManager=(AudioManager)getContext().getSystemService(Context.AUDIO_SERVICE);
    rebindListenerServices();
  }
}

Fixed version (ground truth):
@Override public void onBootPhase(int phase){
  if (phase == SystemService.PHASE_SYSTEM_SERVICES_READY) {
    mSystemReady=true;
    mAudioManager=(AudioManager)getContext().getSystemService(Context.AUDIO_SERVICE);
  }
 else   if (phase == SystemService.PHASE_THIRD_PARTY_APPS_CAN_START) {
    mSettingsObserver.observe();
  }
}
Program: 199483
Project: 199483
Buggy source:
@Override public void onBootPhase(int phase){
  if (phase == SystemService.PHASE_SYSTEM_SERVICES_READY) {
    mSystemReady=true;
    mAudioManager=(AudioManager)getContext().getSystemService(Context.AUDIO_SERVICE);
    rebindListenerServices();
  }
}

Fixed version (ground truth):
@Override public void onBootPhase(int phase){
  if (phase == SystemService.PHASE_SYSTEM_SERVICES_READY) {
    mSystemReady=true;
    mAudioManager=(AudioManager)getContext().getSystemService(Context.AUDIO_SERVICE);
  }
 else   if (phase == SystemService.PHASE_THIRD_PARTY_APPS_CAN_START) {
    mSettingsObserver.observe();
  }
}
Program: 199485
Project: 199485
Buggy source:
@Override public void onBootPhase(int phase){
  if (phase == SystemService.PHASE_SYSTEM_SERVICES_READY) {
    mSystemReady=true;
    mAudioManager=(AudioManager)getContext().getSystemService(Context.AUDIO_SERVICE);
    rebindListenerServices();
  }
}

Fixed version (ground truth):
@Override public void onBootPhase(int phase){
  if (phase == SystemService.PHASE_SYSTEM_SERVICES_READY) {
    mSystemReady=true;
    mAudioManager=(AudioManager)getContext().getSystemService(Context.AUDIO_SERVICE);
  }
 else   if (phase == SystemService.PHASE_THIRD_PARTY_APPS_CAN_START) {
    mSettingsObserver.observe();
  }
}
Program: 199486
Project: 199486
Buggy source:
void systemReady(){
  final Context context=ActivityThread.systemMain().getSystemContext();
  mUserPackageMonitor.register(context,null,UserHandle.ALL,false);
  userForeground(UserHandle.USER_OWNER);
}

Fixed version (ground truth):
void systemReady(){
  mUserPackageMonitor.register(mContext,null,UserHandle.ALL,false);
  userForeground(UserHandle.USER_OWNER);
}
Program: 199488
Project: 199488
Buggy source:
@Override public void onBootPhase(int phase){
  if (phase == SystemService.PHASE_SYSTEM_SERVICES_READY) {
    mSystemReady=true;
    mAudioManager=(AudioManager)getContext().getSystemService(Context.AUDIO_SERVICE);
    rebindListenerServices();
  }
}

Fixed version (ground truth):
@Override public void onBootPhase(int phase){
  if (phase == SystemService.PHASE_SYSTEM_SERVICES_READY) {
    mSystemReady=true;
    mAudioManager=(AudioManager)getContext().getSystemService(Context.AUDIO_SERVICE);
  }
 else   if (phase == SystemService.PHASE_THIRD_PARTY_APPS_CAN_START) {
    mSettingsObserver.observe();
  }
}
Program: 199489
Project: 199489
Buggy source:
void systemReady(){
  final Context context=ActivityThread.systemMain().getSystemContext();
  mUserPackageMonitor.register(context,null,UserHandle.ALL,false);
  userForeground(UserHandle.USER_OWNER);
}

Fixed version (ground truth):
void systemReady(){
  mUserPackageMonitor.register(mContext,null,UserHandle.ALL,false);
  userForeground(UserHandle.USER_OWNER);
}
Program: 199491
Project: 199491
Buggy source:
@Override public void onBootPhase(int phase){
  if (phase == SystemService.PHASE_SYSTEM_SERVICES_READY) {
    mSystemReady=true;
    mAudioManager=(AudioManager)getContext().getSystemService(Context.AUDIO_SERVICE);
    rebindListenerServices();
  }
}

Fixed version (ground truth):
@Override public void onBootPhase(int phase){
  if (phase == SystemService.PHASE_SYSTEM_SERVICES_READY) {
    mSystemReady=true;
    mAudioManager=(AudioManager)getContext().getSystemService(Context.AUDIO_SERVICE);
  }
 else   if (phase == SystemService.PHASE_THIRD_PARTY_APPS_CAN_START) {
    mSettingsObserver.observe();
  }
}
Program: 199492
Project: 199492
Buggy source:
void systemReady(){
  final Context context=ActivityThread.systemMain().getSystemContext();
  mUserPackageMonitor.register(context,null,UserHandle.ALL,false);
  userForeground(UserHandle.USER_OWNER);
}

Fixed version (ground truth):
void systemReady(){
  mUserPackageMonitor.register(mContext,null,UserHandle.ALL,false);
  userForeground(UserHandle.USER_OWNER);
}
Program: 199495
Project: 199495
Buggy source:
public Task(int id,Intent intent,String activityTitle,Drawable icon,Bitmap thumbnail){
  this.key=new TaskKey(id,intent);
  this.title=activityTitle;
  this.icon=icon;
  this.thumbnail=thumbnail;
}

Fixed version (ground truth):
public Task(int id,boolean isActive,Intent intent,String activityTitle,Drawable icon,Bitmap thumbnail){
  this.key=new TaskKey(id,intent);
  this.title=activityTitle;
  this.icon=icon;
  this.thumbnail=thumbnail;
  this.isActive=isActive;
}
Program: 199499
Project: 199499
Buggy source:
public Task(int id,Intent intent,String activityTitle,Drawable icon,Bitmap thumbnail){
  this.key=new TaskKey(id,intent);
  this.title=activityTitle;
  this.icon=icon;
  this.thumbnail=thumbnail;
}

Fixed version (ground truth):
public Task(int id,boolean isActive,Intent intent,String activityTitle,Drawable icon,Bitmap thumbnail){
  this.key=new TaskKey(id,intent);
  this.title=activityTitle;
  this.icon=icon;
  this.thumbnail=thumbnail;
  this.isActive=isActive;
}
Program: 199505
Project: 199505
Buggy source:
public Task(int id,Intent intent,String activityTitle,Drawable icon,Bitmap thumbnail){
  this.key=new TaskKey(id,intent);
  this.title=activityTitle;
  this.icon=icon;
  this.thumbnail=thumbnail;
}

Fixed version (ground truth):
public Task(int id,boolean isActive,Intent intent,String activityTitle,Drawable icon,Bitmap thumbnail){
  this.key=new TaskKey(id,intent);
  this.title=activityTitle;
  this.icon=icon;
  this.thumbnail=thumbnail;
  this.isActive=isActive;
}
Program: 199508
Project: 199508
Buggy source:
/** 
 * Reset all of the state associated with being bound to an input method.
 */
void clearBindingLocked(){
  clearConnectionLocked();
  setInputChannelLocked(null);
  mBindSequence=-1;
  mCurId=null;
  mCurMethod=null;
}

Fixed version (ground truth):
/** 
 * Reset all of the state associated with being bound to an input method.
 */
void clearBindingLocked(){
  if (DEBUG)   Log.v(TAG,"String_Node_Str");
  clearConnectionLocked();
  setInputChannelLocked(null);
  mBindSequence=-1;
  mCurId=null;
  mCurMethod=null;
}
Program: 199509
Project: 199509
Buggy source:
@Override public void sessionCreated(IInputMethodSession session){
  mParentIMMS.onSessionCreated(mMethod,session,mChannel);
}

Fixed version (ground truth):
@Override public void sessionCreated(IInputMethodSession session){
  long ident=Binder.clearCallingIdentity();
  try {
    mParentIMMS.onSessionCreated(mMethod,session,mChannel);
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
}
Program: 199510
Project: 199510
Buggy source:
/** 
 * Reset all of the state associated with being bound to an input method.
 */
void clearBindingLocked(){
  clearConnectionLocked();
  setInputChannelLocked(null);
  mBindSequence=-1;
  mCurId=null;
  mCurMethod=null;
}

Fixed version (ground truth):
/** 
 * Reset all of the state associated with being bound to an input method.
 */
void clearBindingLocked(){
  if (DEBUG)   Log.v(TAG,"String_Node_Str");
  clearConnectionLocked();
  setInputChannelLocked(null);
  mBindSequence=-1;
  mCurId=null;
  mCurMethod=null;
}
Program: 199511
Project: 199511
Buggy source:
@Override public void sessionCreated(IInputMethodSession session){
  mParentIMMS.onSessionCreated(mMethod,session,mChannel);
}

Fixed version (ground truth):
@Override public void sessionCreated(IInputMethodSession session){
  long ident=Binder.clearCallingIdentity();
  try {
    mParentIMMS.onSessionCreated(mMethod,session,mChannel);
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
}
Program: 199512
Project: 199512
Buggy source:
/** 
 * Reset all of the state associated with being bound to an input method.
 */
void clearBindingLocked(){
  clearConnectionLocked();
  setInputChannelLocked(null);
  mBindSequence=-1;
  mCurId=null;
  mCurMethod=null;
}

Fixed version (ground truth):
/** 
 * Reset all of the state associated with being bound to an input method.
 */
void clearBindingLocked(){
  if (DEBUG)   Log.v(TAG,"String_Node_Str");
  clearConnectionLocked();
  setInputChannelLocked(null);
  mBindSequence=-1;
  mCurId=null;
  mCurMethod=null;
}
Program: 199513
Project: 199513
Buggy source:
@Override public void sessionCreated(IInputMethodSession session){
  mParentIMMS.onSessionCreated(mMethod,session,mChannel);
}

Fixed version (ground truth):
@Override public void sessionCreated(IInputMethodSession session){
  long ident=Binder.clearCallingIdentity();
  try {
    mParentIMMS.onSessionCreated(mMethod,session,mChannel);
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
}
Program: 199515
Project: 199515
Buggy source:
@Override public void onBootPhase(int phase){
  if (phase == SystemService.PHASE_SYSTEM_SERVICES_READY) {
    mSystemReady=true;
    mAudioManager=(AudioManager)getContext().getSystemService(Context.AUDIO_SERVICE);
    rebindListenerServices();
  }
}

Fixed version (ground truth):
@Override public void onBootPhase(int phase){
  if (phase == SystemService.PHASE_SYSTEM_SERVICES_READY) {
    mSystemReady=true;
    mAudioManager=(AudioManager)getContext().getSystemService(Context.AUDIO_SERVICE);
  }
 else   if (phase == SystemService.PHASE_THIRD_PARTY_APPS_CAN_START) {
    mSettingsObserver.observe();
  }
}
Program: 199516
Project: 199516
Buggy source:
void systemReady(){
  final Context context=ActivityThread.systemMain().getSystemContext();
  mUserPackageMonitor.register(context,null,UserHandle.ALL,false);
  userForeground(UserHandle.USER_OWNER);
}

Fixed version (ground truth):
void systemReady(){
  mUserPackageMonitor.register(mContext,null,UserHandle.ALL,false);
  userForeground(UserHandle.USER_OWNER);
}
Program: 199519
Project: 199519
Buggy source:
/** 
 * Internal function called to process an animation frame on an animation that is currently sleeping through its <code>startDelay</code> phase. The return value indicates whether it should be woken up and put on the active animations queue.
 * @param currentTime The current animation time, used to calculate whether the animationhas exceeded its <code>startDelay</code> and should be started.
 * @return True if the animation's <code>startDelay</code> has been exceeded and the animationshould be added to the set of active animations.
 */
private boolean delayedAnimationFrame(long currentTime){
  if (!mStartedDelay) {
    mStartedDelay=true;
    mDelayStartTime=currentTime;
  }
 else {
    if (mPaused) {
      if (mPauseTime < 0) {
        mPauseTime=currentTime;
      }
      return false;
    }
 else     if (mResumed) {
      mResumed=false;
      if (mPauseTime > 0) {
        mDelayStartTime+=(currentTime - mPauseTime);
      }
    }
    long deltaTime=currentTime - mDelayStartTime;
    if (deltaTime > mStartDelay) {
      mStartTime=currentTime - (deltaTime - mStartDelay);
      mPlayingState=RUNNING;
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Internal function called to process an animation frame on an animation that is currently sleeping through its <code>startDelay</code> phase. The return value indicates whether it should be woken up and put on the active animations queue.
 * @param currentTime The current animation time, used to calculate whether the animationhas exceeded its <code>startDelay</code> and should be started.
 * @return True if the animation's <code>startDelay</code> has been exceeded and the animationshould be added to the set of active animations.
 */
private boolean delayedAnimationFrame(long currentTime){
  if (!mStartedDelay) {
    mStartedDelay=true;
    mDelayStartTime=currentTime;
  }
  if (mPaused) {
    if (mPauseTime < 0) {
      mPauseTime=currentTime;
    }
    return false;
  }
 else   if (mResumed) {
    mResumed=false;
    if (mPauseTime > 0) {
      mDelayStartTime+=(currentTime - mPauseTime);
    }
  }
  long deltaTime=currentTime - mDelayStartTime;
  if (deltaTime > mStartDelay) {
    mStartTime=currentTime - (deltaTime - mStartDelay);
    mPlayingState=RUNNING;
    return true;
  }
  return false;
}
Program: 199520
Project: 199520
Buggy source:
/** 
 * Internal function called to process an animation frame on an animation that is currently sleeping through its <code>startDelay</code> phase. The return value indicates whether it should be woken up and put on the active animations queue.
 * @param currentTime The current animation time, used to calculate whether the animationhas exceeded its <code>startDelay</code> and should be started.
 * @return True if the animation's <code>startDelay</code> has been exceeded and the animationshould be added to the set of active animations.
 */
private boolean delayedAnimationFrame(long currentTime){
  if (!mStartedDelay) {
    mStartedDelay=true;
    mDelayStartTime=currentTime;
  }
 else {
    if (mPaused) {
      if (mPauseTime < 0) {
        mPauseTime=currentTime;
      }
      return false;
    }
 else     if (mResumed) {
      mResumed=false;
      if (mPauseTime > 0) {
        mDelayStartTime+=(currentTime - mPauseTime);
      }
    }
    long deltaTime=currentTime - mDelayStartTime;
    if (deltaTime > mStartDelay) {
      mStartTime=currentTime - (deltaTime - mStartDelay);
      mPlayingState=RUNNING;
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Internal function called to process an animation frame on an animation that is currently sleeping through its <code>startDelay</code> phase. The return value indicates whether it should be woken up and put on the active animations queue.
 * @param currentTime The current animation time, used to calculate whether the animationhas exceeded its <code>startDelay</code> and should be started.
 * @return True if the animation's <code>startDelay</code> has been exceeded and the animationshould be added to the set of active animations.
 */
private boolean delayedAnimationFrame(long currentTime){
  if (!mStartedDelay) {
    mStartedDelay=true;
    mDelayStartTime=currentTime;
  }
  if (mPaused) {
    if (mPauseTime < 0) {
      mPauseTime=currentTime;
    }
    return false;
  }
 else   if (mResumed) {
    mResumed=false;
    if (mPauseTime > 0) {
      mDelayStartTime+=(currentTime - mPauseTime);
    }
  }
  long deltaTime=currentTime - mDelayStartTime;
  if (deltaTime > mStartDelay) {
    mStartTime=currentTime - (deltaTime - mStartDelay);
    mPlayingState=RUNNING;
    return true;
  }
  return false;
}
Program: 199522
Project: 199522
Buggy source:
/** 
 * Internal function called to process an animation frame on an animation that is currently sleeping through its <code>startDelay</code> phase. The return value indicates whether it should be woken up and put on the active animations queue.
 * @param currentTime The current animation time, used to calculate whether the animationhas exceeded its <code>startDelay</code> and should be started.
 * @return True if the animation's <code>startDelay</code> has been exceeded and the animationshould be added to the set of active animations.
 */
private boolean delayedAnimationFrame(long currentTime){
  if (!mStartedDelay) {
    mStartedDelay=true;
    mDelayStartTime=currentTime;
  }
 else {
    if (mPaused) {
      if (mPauseTime < 0) {
        mPauseTime=currentTime;
      }
      return false;
    }
 else     if (mResumed) {
      mResumed=false;
      if (mPauseTime > 0) {
        mDelayStartTime+=(currentTime - mPauseTime);
      }
    }
    long deltaTime=currentTime - mDelayStartTime;
    if (deltaTime > mStartDelay) {
      mStartTime=currentTime - (deltaTime - mStartDelay);
      mPlayingState=RUNNING;
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Internal function called to process an animation frame on an animation that is currently sleeping through its <code>startDelay</code> phase. The return value indicates whether it should be woken up and put on the active animations queue.
 * @param currentTime The current animation time, used to calculate whether the animationhas exceeded its <code>startDelay</code> and should be started.
 * @return True if the animation's <code>startDelay</code> has been exceeded and the animationshould be added to the set of active animations.
 */
private boolean delayedAnimationFrame(long currentTime){
  if (!mStartedDelay) {
    mStartedDelay=true;
    mDelayStartTime=currentTime;
  }
  if (mPaused) {
    if (mPauseTime < 0) {
      mPauseTime=currentTime;
    }
    return false;
  }
 else   if (mResumed) {
    mResumed=false;
    if (mPauseTime > 0) {
      mDelayStartTime+=(currentTime - mPauseTime);
    }
  }
  long deltaTime=currentTime - mDelayStartTime;
  if (deltaTime > mStartDelay) {
    mStartTime=currentTime - (deltaTime - mStartDelay);
    mPlayingState=RUNNING;
    return true;
  }
  return false;
}
Program: 199523
Project: 199523
Buggy source:
/** 
 * Perform the common clean-up of an activity record.  This is called both as part of destroyActivityLocked() (when destroying the client-side representation) and cleaning things up as a result of its hosting processing going away, in which case there is no remaining client-side state to destroy so only the cleanup here is needed.
 */
final void cleanUpActivityLocked(ActivityRecord r,boolean cleanServices,boolean setState){
  if (mResumedActivity == r) {
    mResumedActivity=null;
  }
  if (mService.mFocusedActivity == r) {
    mService.mFocusedActivity=null;
  }
  r.configDestroy=false;
  r.frozenBeforeDestroy=false;
  if (setState) {
    if (DEBUG_STATES)     Slog.v(TAG,"String_Node_Str" + r + "String_Node_Str");
    r.state=ActivityState.DESTROYED;
    if (DEBUG_APP)     Slog.v(TAG,"String_Node_Str" + r);
    r.app=null;
  }
  mStackSupervisor.mFinishingActivities.remove(r);
  mStackSupervisor.mWaitingVisibleActivities.remove(r);
  if (r.finishing && r.pendingResults != null) {
    for (    WeakReference<PendingIntentRecord> apr : r.pendingResults) {
      PendingIntentRecord rec=apr.get();
      if (rec != null) {
        mService.cancelIntentSenderLocked(rec,false);
      }
    }
    r.pendingResults=null;
  }
  if (cleanServices) {
    cleanUpActivityServicesLocked(r);
  }
  if (!mService.mPendingThumbnails.isEmpty()) {
    mStackSupervisor.mCancelledThumbnails.add(r);
  }
  removeTimeoutsForActivityLocked(r);
}

Fixed version (ground truth):
/** 
 * Perform the common clean-up of an activity record.  This is called both as part of destroyActivityLocked() (when destroying the client-side representation) and cleaning things up as a result of its hosting processing going away, in which case there is no remaining client-side state to destroy so only the cleanup here is needed.
 */
final void cleanUpActivityLocked(ActivityRecord r,boolean cleanServices,boolean setState){
  if (mResumedActivity == r) {
    mResumedActivity=null;
  }
  if (mPausingActivity == r) {
    mPausingActivity=null;
  }
  if (mService.mFocusedActivity == r) {
    mService.mFocusedActivity=null;
  }
  r.configDestroy=false;
  r.frozenBeforeDestroy=false;
  if (setState) {
    if (DEBUG_STATES)     Slog.v(TAG,"String_Node_Str" + r + "String_Node_Str");
    r.state=ActivityState.DESTROYED;
    if (DEBUG_APP)     Slog.v(TAG,"String_Node_Str" + r);
    r.app=null;
  }
  mStackSupervisor.mFinishingActivities.remove(r);
  mStackSupervisor.mWaitingVisibleActivities.remove(r);
  if (r.finishing && r.pendingResults != null) {
    for (    WeakReference<PendingIntentRecord> apr : r.pendingResults) {
      PendingIntentRecord rec=apr.get();
      if (rec != null) {
        mService.cancelIntentSenderLocked(rec,false);
      }
    }
    r.pendingResults=null;
  }
  if (cleanServices) {
    cleanUpActivityServicesLocked(r);
  }
  if (!mService.mPendingThumbnails.isEmpty()) {
    mStackSupervisor.mCancelledThumbnails.add(r);
  }
  removeTimeoutsForActivityLocked(r);
}
Program: 199524
Project: 199524
Buggy source:
@Override public void cleanUp(){
  int count=mAppWidgetContainer.getChildCount();
  for (int i=0; i < count; i++) {
    KeyguardWidgetFrame frame=mAppWidgetContainer.getWidgetPageAt(i);
    frame.removeAllViews();
  }
}

Fixed version (ground truth):
@Override public void cleanUp(){
  int count=mAppWidgetContainer.getChildCount();
  for (int i=0; i < count; i++) {
    KeyguardWidgetFrame frame=mAppWidgetContainer.getWidgetPageAt(i);
    frame.removeAllViews();
  }
  getSecurityContainer().onPause();
}
Program: 199525
Project: 199525
Buggy source:
@Override public void cleanUp(){
  int count=mAppWidgetContainer.getChildCount();
  for (int i=0; i < count; i++) {
    KeyguardWidgetFrame frame=mAppWidgetContainer.getWidgetPageAt(i);
    frame.removeAllViews();
  }
}

Fixed version (ground truth):
@Override public void cleanUp(){
  int count=mAppWidgetContainer.getChildCount();
  for (int i=0; i < count; i++) {
    KeyguardWidgetFrame frame=mAppWidgetContainer.getWidgetPageAt(i);
    frame.removeAllViews();
  }
  getSecurityContainer().onPause();
}
Program: 199526
Project: 199526
Buggy source:
@Override public void cleanUp(){
  int count=mAppWidgetContainer.getChildCount();
  for (int i=0; i < count; i++) {
    KeyguardWidgetFrame frame=mAppWidgetContainer.getWidgetPageAt(i);
    frame.removeAllViews();
  }
}

Fixed version (ground truth):
@Override public void cleanUp(){
  int count=mAppWidgetContainer.getChildCount();
  for (int i=0; i < count; i++) {
    KeyguardWidgetFrame frame=mAppWidgetContainer.getWidgetPageAt(i);
    frame.removeAllViews();
  }
  getSecurityContainer().onPause();
}
Program: 199527
Project: 199527
Buggy source:
@Override public void cleanUp(){
  int count=mAppWidgetContainer.getChildCount();
  for (int i=0; i < count; i++) {
    KeyguardWidgetFrame frame=mAppWidgetContainer.getWidgetPageAt(i);
    frame.removeAllViews();
  }
}

Fixed version (ground truth):
@Override public void cleanUp(){
  int count=mAppWidgetContainer.getChildCount();
  for (int i=0; i < count; i++) {
    KeyguardWidgetFrame frame=mAppWidgetContainer.getWidgetPageAt(i);
    frame.removeAllViews();
  }
  getSecurityContainer().onPause();
}
Program: 199528
Project: 199528
Buggy source:
@Override public void cleanUp(){
  int count=mAppWidgetContainer.getChildCount();
  for (int i=0; i < count; i++) {
    KeyguardWidgetFrame frame=mAppWidgetContainer.getWidgetPageAt(i);
    frame.removeAllViews();
  }
}

Fixed version (ground truth):
@Override public void cleanUp(){
  int count=mAppWidgetContainer.getChildCount();
  for (int i=0; i < count; i++) {
    KeyguardWidgetFrame frame=mAppWidgetContainer.getWidgetPageAt(i);
    frame.removeAllViews();
  }
  getSecurityContainer().onPause();
}
Program: 199529
Project: 199529
Buggy source:
public long getCurrentTimeUs(boolean refreshTime,boolean monotonic) throws IllegalStateException {
synchronized (this) {
    if (mPaused && !refreshTime) {
      return mLastReportedTime;
    }
    long nanoTime=System.nanoTime();
    if (refreshTime || nanoTime >= mLastNanoTime + MAX_NS_WITHOUT_POSITION_CHECK) {
      try {
        mLastTimeUs=mPlayer.getCurrentPosition() * 1000;
        mPaused=!mPlayer.isPlaying();
        if (DEBUG)         Log.v(TAG,(mPaused ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str" + mLastTimeUs);
      }
 catch (      IllegalStateException e) {
        if (mPausing) {
          mPausing=false;
          getEstimatedTime(nanoTime,monotonic);
          mPaused=true;
          if (DEBUG)           Log.d(TAG,"String_Node_Str" + mLastReportedTime);
          return mLastReportedTime;
        }
        throw e;
      }
      mLastNanoTime=nanoTime;
      if (monotonic && mLastTimeUs < mLastReportedTime) {
        mTimeAdjustment=mLastReportedTime - mLastTimeUs;
        if (mTimeAdjustment > 1000000) {
          mStopped=false;
          mSeeking=true;
          scheduleNotification(NOTIFY_SEEK,0);
        }
      }
 else {
        mTimeAdjustment=0;
      }
    }
    return getEstimatedTime(nanoTime,monotonic);
  }
}

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

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

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

Fixed version (ground truth):
public long getCurrentTimeUs(boolean refreshTime,boolean monotonic) throws IllegalStateException {
synchronized (this) {
    if (mPaused && !refreshTime) {
      return mLastReportedTime;
    }
    long nanoTime=System.nanoTime();
    if (refreshTime || nanoTime >= mLastNanoTime + MAX_NS_WITHOUT_POSITION_CHECK) {
      try {
        mLastTimeUs=mPlayer.getCurrentPosition() * 1000L;
        mPaused=!mPlayer.isPlaying();
        if (DEBUG)         Log.v(TAG,(mPaused ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str" + mLastTimeUs);
      }
 catch (      IllegalStateException e) {
        if (mPausing) {
          mPausing=false;
          getEstimatedTime(nanoTime,monotonic);
          mPaused=true;
          if (DEBUG)           Log.d(TAG,"String_Node_Str" + mLastReportedTime);
          return mLastReportedTime;
        }
        throw e;
      }
      mLastNanoTime=nanoTime;
      if (monotonic && mLastTimeUs < mLastReportedTime) {
        mTimeAdjustment=mLastReportedTime - mLastTimeUs;
        if (mTimeAdjustment > 1000000) {
          mStopped=false;
          mSeeking=true;
          scheduleNotification(NOTIFY_SEEK,0);
        }
      }
 else {
        mTimeAdjustment=0;
      }
    }
    return getEstimatedTime(nanoTime,monotonic);
  }
}
Program: 199533
Project: 199533
Buggy source:
private void updateMinScale(int w,int h,TileSource source,boolean resetScale){
synchronized (mLock) {
    if (resetScale) {
      mRenderer.scale=1;
    }
    if (source != null) {
      final float[] imageDims=getImageDims();
      final float imageWidth=imageDims[0];
      final float imageHeight=imageDims[1];
      mMinScale=Math.max(w / imageWidth,h / imageHeight);
      mRenderer.scale=Math.max(mMinScale,mRenderer.scale);
    }
  }
}

Fixed version (ground truth):
private void updateMinScale(int w,int h,TileSource source,boolean resetScale){
synchronized (mLock) {
    if (resetScale) {
      mRenderer.scale=1;
    }
    if (source != null) {
      final float[] imageDims=getImageDims();
      final float imageWidth=imageDims[0];
      final float imageHeight=imageDims[1];
      mMinScale=Math.max(w / imageWidth,h / imageHeight);
      mRenderer.scale=Math.max(mMinScale,resetScale ? Float.MIN_VALUE : mRenderer.scale);
    }
  }
}
Program: 199535
Project: 199535
Buggy source:
public void run(){
  int savedWidth=sharedPrefs.getInt(WALLPAPER_WIDTH_KEY,defaultWallpaperSize.x);
  int savedHeight=sharedPrefs.getInt(WALLPAPER_HEIGHT_KEY,defaultWallpaperSize.y);
  wallpaperManager.suggestDesiredDimensions(savedWidth,savedHeight);
}

Fixed version (ground truth):
public void run(){
  updateWallpaperDimensions(outWidth,outHeight);
  if (finishActivityWhenDone) {
    setResult(Activity.RESULT_OK);
    finish();
  }
}
Program: 199536
Project: 199536
Buggy source:
static public void suggestWallpaperDimension(Resources res,final SharedPreferences sharedPrefs,WindowManager windowManager,final WallpaperManager wallpaperManager){
  final Point defaultWallpaperSize=getDefaultWallpaperSize(res,windowManager);
  new Thread("String_Node_Str"){
    public void run(){
      int savedWidth=sharedPrefs.getInt(WALLPAPER_WIDTH_KEY,defaultWallpaperSize.x);
      int savedHeight=sharedPrefs.getInt(WALLPAPER_HEIGHT_KEY,defaultWallpaperSize.y);
      wallpaperManager.suggestDesiredDimensions(savedWidth,savedHeight);
    }
  }
.start();
}

Fixed version (ground truth):
static public void suggestWallpaperDimension(Resources res,final SharedPreferences sharedPrefs,WindowManager windowManager,final WallpaperManager wallpaperManager){
  final Point defaultWallpaperSize=getDefaultWallpaperSize(res,windowManager);
  new AsyncTask<Void,Void,Void>(){
    public Void doInBackground(    Void... args){
      int savedWidth=sharedPrefs.getInt(WALLPAPER_WIDTH_KEY,defaultWallpaperSize.x);
      int savedHeight=sharedPrefs.getInt(WALLPAPER_HEIGHT_KEY,defaultWallpaperSize.y);
      wallpaperManager.suggestDesiredDimensions(savedWidth,savedHeight);
      return null;
    }
  }
.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR,(Void)null);
}
Program: 199537
Project: 199537
Buggy source:
@Override protected Boolean doInBackground(Void... params){
  return cropBitmap();
}

Fixed version (ground truth):
public Void doInBackground(Void... args){
  int savedWidth=sharedPrefs.getInt(WALLPAPER_WIDTH_KEY,defaultWallpaperSize.x);
  int savedHeight=sharedPrefs.getInt(WALLPAPER_HEIGHT_KEY,defaultWallpaperSize.y);
  wallpaperManager.suggestDesiredDimensions(savedWidth,savedHeight);
  return null;
}