nus-yam/ex-repair huggingface dataset:
Program: 192766
Project: 192766
Buggy source:
void onResourcesLoaded(DecorView decorView,Drawable resizingBackgroundDrawable,Drawable captionBackgroundDrawableDrawable,Drawable userCaptionBackgroundDrawable,int statusBarColor){
  mDecorView=decorView;
  mResizingBackgroundDrawable=resizingBackgroundDrawable;
  mCaptionBackgroundDrawable=captionBackgroundDrawableDrawable;
  mUserCaptionBackgroundDrawable=userCaptionBackgroundDrawable;
  if (mCaptionBackgroundDrawable == null) {
    mCaptionBackgroundDrawable=mResizingBackgroundDrawable;
  }
  if (statusBarColor != 0) {
    mStatusBarColor=new ColorDrawable(statusBarColor);
    addSystemBarNodeIfNeeded();
  }
 else {
    mStatusBarColor=null;
  }
}

Fixed version (ground truth):
void onResourcesLoaded(DecorView decorView,Drawable resizingBackgroundDrawable,Drawable captionBackgroundDrawableDrawable,Drawable userCaptionBackgroundDrawable,int statusBarColor,int navigationBarColor){
  mDecorView=decorView;
  mResizingBackgroundDrawable=resizingBackgroundDrawable;
  mCaptionBackgroundDrawable=captionBackgroundDrawableDrawable;
  mUserCaptionBackgroundDrawable=userCaptionBackgroundDrawable;
  if (mCaptionBackgroundDrawable == null) {
    mCaptionBackgroundDrawable=mResizingBackgroundDrawable;
  }
  if (statusBarColor != 0) {
    mStatusBarColor=new ColorDrawable(statusBarColor);
    addSystemBarNodeIfNeeded();
  }
 else {
    mStatusBarColor=null;
  }
  if (navigationBarColor != 0) {
    mNavigationBarColor=new ColorDrawable(navigationBarColor);
    addSystemBarNodeIfNeeded();
  }
 else {
    mNavigationBarColor=null;
  }
}
Program: 192767
Project: 192767
Buggy source:
/** 
 * The content is about to be drawn and we got the location of where it will be shown. If a "changeWindowSizeLocked" call has already been processed, we will re-issue the call if the previous call was ignored since the size was unknown.
 * @param xOffset The x offset where the content is drawn to.
 * @param yOffset The y offset where the content is drawn to.
 * @param xSize The width size of the content. This should not be 0.
 * @param ySize The height of the content.
 * @return true if a frame should be requested after the content is drawn; false otherwise.
 */
public boolean onContentDrawn(int xOffset,int yOffset,int xSize,int ySize){
synchronized (this) {
    final boolean firstCall=mLastContentWidth == 0;
    mLastContentWidth=xSize;
    mLastContentHeight=ySize - mLastCaptionHeight;
    mLastXOffset=xOffset;
    mLastYOffset=yOffset;
    mRenderer.setContentDrawBounds(mLastXOffset,mLastYOffset,mLastXOffset + mLastContentWidth,mLastYOffset + mLastCaptionHeight + mLastContentHeight);
    return firstCall && (mLastCaptionHeight != 0 || !mDecorView.isShowingCaption());
  }
}

Fixed version (ground truth):
/** 
 * The content is about to be drawn and we got the location of where it will be shown. If a "redrawLocked" call has already been processed, we will re-issue the call if the previous call was ignored since the size was unknown.
 * @param xOffset The x offset where the content is drawn to.
 * @param yOffset The y offset where the content is drawn to.
 * @param xSize The width size of the content. This should not be 0.
 * @param ySize The height of the content.
 * @return true if a frame should be requested after the content is drawn; false otherwise.
 */
public boolean onContentDrawn(int xOffset,int yOffset,int xSize,int ySize){
synchronized (this) {
    final boolean firstCall=mLastContentWidth == 0;
    mLastContentWidth=xSize;
    mLastContentHeight=ySize - mLastCaptionHeight;
    mLastXOffset=xOffset;
    mLastYOffset=yOffset;
    mRenderer.setContentDrawBounds(mLastXOffset,mLastYOffset,mLastXOffset + mLastContentWidth,mLastYOffset + mLastCaptionHeight + mLastContentHeight);
    return firstCall && (mLastCaptionHeight != 0 || !mDecorView.isShowingCaption());
  }
}
Program: 192768
Project: 192768
Buggy source:
/** 
 * The implementation of the FrameCallback.
 * @param frameTimeNanos The time in nanoseconds when the frame started being rendered,in the  {@link System#nanoTime()} timebase.  Divide this value by {@code 1000000}
 */
@Override public void doFrame(long frameTimeNanos){
synchronized (this) {
    if (mRenderer == null) {
      reportDrawIfNeeded();
      Looper.myLooper().quit();
      return;
    }
    mNewTargetRect.set(mTargetRect);
    if (!mNewTargetRect.equals(mOldTargetRect) || mReportNextDraw) {
      mOldTargetRect.set(mNewTargetRect);
      changeWindowSizeLocked(mNewTargetRect);
    }
  }
}

Fixed version (ground truth):
/** 
 * The implementation of the FrameCallback.
 * @param frameTimeNanos The time in nanoseconds when the frame started being rendered,in the  {@link System#nanoTime()} timebase.  Divide this value by {@code 1000000}
 */
@Override public void doFrame(long frameTimeNanos){
synchronized (this) {
    if (mRenderer == null) {
      reportDrawIfNeeded();
      Looper.myLooper().quit();
      return;
    }
    mNewTargetRect.set(mTargetRect);
    if (!mNewTargetRect.equals(mOldTargetRect) || mOldFullscreen != mFullscreen || !mStableInsets.equals(mOldStableInsets) || !mSystemInsets.equals(mOldSystemInsets) || mReportNextDraw) {
      mOldFullscreen=mFullscreen;
      mOldTargetRect.set(mNewTargetRect);
      mOldSystemInsets.set(mSystemInsets);
      mOldStableInsets.set(mStableInsets);
      redrawLocked(mNewTargetRect,mFullscreen,mSystemInsets,mStableInsets);
    }
  }
}
Program: 192769
Project: 192769
Buggy source:
public BackdropFrameRenderer(DecorView decorView,ThreadedRenderer renderer,Rect initialBounds,Drawable resizingBackgroundDrawable,Drawable captionBackgroundDrawable,Drawable userCaptionBackgroundDrawable,int statusBarColor){
  setName("String_Node_Str");
  mRenderer=renderer;
  onResourcesLoaded(decorView,resizingBackgroundDrawable,captionBackgroundDrawable,userCaptionBackgroundDrawable,statusBarColor);
  mFrameAndBackdropNode=RenderNode.create("String_Node_Str",null);
  mRenderer.addRenderNode(mFrameAndBackdropNode,true);
  mTargetRect.set(initialBounds);
synchronized (this) {
    changeWindowSizeLocked(initialBounds);
  }
  start();
}

Fixed version (ground truth):
public BackdropFrameRenderer(DecorView decorView,ThreadedRenderer renderer,Rect initialBounds,Drawable resizingBackgroundDrawable,Drawable captionBackgroundDrawable,Drawable userCaptionBackgroundDrawable,int statusBarColor,int navigationBarColor,boolean fullscreen,Rect systemInsets,Rect stableInsets){
  setName("String_Node_Str");
  mRenderer=renderer;
  onResourcesLoaded(decorView,resizingBackgroundDrawable,captionBackgroundDrawable,userCaptionBackgroundDrawable,statusBarColor,navigationBarColor);
  mFrameAndBackdropNode=RenderNode.create("String_Node_Str",null);
  mRenderer.addRenderNode(mFrameAndBackdropNode,true);
  mTargetRect.set(initialBounds);
  mFullscreen=fullscreen;
  mOldFullscreen=fullscreen;
  mSystemInsets.set(systemInsets);
  mStableInsets.set(stableInsets);
  mOldSystemInsets.set(systemInsets);
  mOldStableInsets.set(stableInsets);
synchronized (this) {
    redrawLocked(initialBounds,fullscreen,mSystemInsets,mStableInsets);
  }
  start();
}
Program: 192770
Project: 192770
Buggy source:
/** 
 * Call this function asynchronously when the window size has been changed. The change will be picked up once per frame and the frame will be re-rendered accordingly.
 * @param newTargetBounds The new target bounds.
 */
public void setTargetRect(Rect newTargetBounds){
synchronized (this) {
    mTargetRect.set(newTargetBounds);
    pingRenderLocked();
  }
}

Fixed version (ground truth):
/** 
 * Call this function asynchronously when the window size has been changed or when the insets have changed or whether window switched between a fullscreen or non-fullscreen layout. The change will be picked up once per frame and the frame will be re-rendered accordingly.
 * @param newTargetBounds The new target bounds.
 * @param fullscreen Whether the window is currently drawing in fullscreen.
 * @param systemInsets The current visible system insets for the window.
 * @param stableInsets The stable insets for the window.
 */
public void setTargetRect(Rect newTargetBounds,boolean fullscreen,Rect systemInsets,Rect stableInsets){
synchronized (this) {
    mFullscreen=fullscreen;
    mTargetRect.set(newTargetBounds);
    mSystemInsets.set(systemInsets);
    mStableInsets.set(stableInsets);
    pingRenderLocked();
  }
}
Program: 192771
Project: 192771
Buggy source:
public static NotificationViewWrapper wrap(Context ctx,View v){
  if (v.getId() == com.android.internal.R.id.status_bar_latest_event_content) {
    if ("String_Node_Str".equals(v.getTag())) {
      return new NotificationBigPictureTemplateViewWrapper(ctx,v);
    }
    return new NotificationTemplateViewWrapper(ctx,v);
  }
 else   if (v instanceof NotificationHeaderView) {
    return new NotificationHeaderViewWrapper(ctx,v);
  }
 else {
    return new NotificationCustomViewWrapper(v);
  }
}

Fixed version (ground truth):
public static NotificationViewWrapper wrap(Context ctx,View v){
  if (v.getId() == com.android.internal.R.id.status_bar_latest_event_content) {
    if ("String_Node_Str".equals(v.getTag())) {
      return new NotificationBigPictureTemplateViewWrapper(ctx,v);
    }
 else     if ("String_Node_Str".equals(v.getTag())) {
      return new NotificationBigTextTemplateViewWrapper(ctx,v);
    }
    return new NotificationTemplateViewWrapper(ctx,v);
  }
 else   if (v instanceof NotificationHeaderView) {
    return new NotificationHeaderViewWrapper(ctx,v);
  }
 else {
    return new NotificationCustomViewWrapper(v);
  }
}
Program: 192772
Project: 192772
Buggy source:
public static NotificationViewWrapper wrap(Context ctx,View v){
  if (v.getId() == com.android.internal.R.id.status_bar_latest_event_content) {
    if ("String_Node_Str".equals(v.getTag())) {
      return new NotificationBigPictureTemplateViewWrapper(ctx,v);
    }
    return new NotificationTemplateViewWrapper(ctx,v);
  }
 else   if (v instanceof NotificationHeaderView) {
    return new NotificationHeaderViewWrapper(ctx,v);
  }
 else {
    return new NotificationCustomViewWrapper(v);
  }
}

Fixed version (ground truth):
public static NotificationViewWrapper wrap(Context ctx,View v){
  if (v.getId() == com.android.internal.R.id.status_bar_latest_event_content) {
    if ("String_Node_Str".equals(v.getTag())) {
      return new NotificationBigPictureTemplateViewWrapper(ctx,v);
    }
 else     if ("String_Node_Str".equals(v.getTag())) {
      return new NotificationBigTextTemplateViewWrapper(ctx,v);
    }
    return new NotificationTemplateViewWrapper(ctx,v);
  }
 else   if (v instanceof NotificationHeaderView) {
    return new NotificationHeaderViewWrapper(ctx,v);
  }
 else {
    return new NotificationCustomViewWrapper(v);
  }
}
Program: 192773
Project: 192773
Buggy source:
@Override protected void applyRestoredPayload(String key,byte[] payload){
  if (KEY_USAGE_STATS.equals(key)) {
    UsageStatsManagerInternal localUsageStatsManager=LocalServices.getService(UsageStatsManagerInternal.class);
    DataInputStream in=new DataInputStream(new ByteArrayInputStream(payload));
    try {
      int user=in.readInt();
      byte[] restoreData=new byte[payload.length - 4];
      in.read(restoreData,0,payload.length - 4);
      localUsageStatsManager.applyRestoredPayload(user,key,restoreData);
    }
 catch (    IOException ioe) {
      if (DEBUG)       Log.e(TAG,"String_Node_Str",ioe);
    }
  }
}

Fixed version (ground truth):
@Override protected void applyRestoredPayload(String key,byte[] payload){
  if (KEY_USAGE_STATS.equals(key)) {
    UsageStatsManagerInternal localUsageStatsManager=LocalServices.getService(UsageStatsManagerInternal.class);
    DataInputStream in=new DataInputStream(new ByteArrayInputStream(payload));
    try {
      int user=in.readInt();
      byte[] restoreData=new byte[payload.length - 4];
      in.read(restoreData,0,restoreData.length);
      localUsageStatsManager.applyRestoredPayload(user,key,restoreData);
    }
 catch (    IOException ioe) {
      if (DEBUG)       Log.e(TAG,"String_Node_Str",ioe);
    }
  }
}
Program: 192774
Project: 192774
Buggy source:
/** 
 * Get the Configuration Statistics from the current device statistics and merge them with the backed up usage statistics.
 */
private IntervalStats mergeStats(IntervalStats beingRestored,IntervalStats onDevice){
  beingRestored.activeConfiguration=onDevice.activeConfiguration;
  beingRestored.configurations.putAll(onDevice.configurations);
  beingRestored.events=onDevice.events;
  return beingRestored;
}

Fixed version (ground truth):
/** 
 * Get the Configuration Statistics from the current device statistics and merge them with the backed up usage statistics.
 */
private IntervalStats mergeStats(IntervalStats beingRestored,IntervalStats onDevice){
  if (onDevice == null)   return beingRestored;
  if (beingRestored == null)   return null;
  beingRestored.activeConfiguration=onDevice.activeConfiguration;
  beingRestored.configurations.putAll(onDevice.configurations);
  beingRestored.events=onDevice.events;
  return beingRestored;
}
Program: 192777
Project: 192777
Buggy source:
/** 
 * Update the stats in the database. They may not be written to disk immediately.
 */
public void putUsageStats(int intervalType,IntervalStats stats) throws IOException {
synchronized (mLock) {
    if (intervalType < 0 || intervalType >= mIntervalDirs.length) {
      throw new IllegalArgumentException("String_Node_Str" + intervalType);
    }
    AtomicFile f=mSortedStatFiles[intervalType].get(stats.beginTime);
    if (f == null) {
      f=new AtomicFile(new File(mIntervalDirs[intervalType],Long.toString(stats.beginTime)));
      mSortedStatFiles[intervalType].put(stats.beginTime,f);
    }
    UsageStatsXml.write(f,stats);
    stats.lastTimeSaved=f.getLastModifiedTime();
  }
}

Fixed version (ground truth):
/** 
 * Update the stats in the database. They may not be written to disk immediately.
 */
public void putUsageStats(int intervalType,IntervalStats stats) throws IOException {
  if (stats == null)   return;
synchronized (mLock) {
    if (intervalType < 0 || intervalType >= mIntervalDirs.length) {
      throw new IllegalArgumentException("String_Node_Str" + intervalType);
    }
    AtomicFile f=mSortedStatFiles[intervalType].get(stats.beginTime);
    if (f == null) {
      f=new AtomicFile(new File(mIntervalDirs[intervalType],Long.toString(stats.beginTime)));
      mSortedStatFiles[intervalType].put(stats.beginTime,f);
    }
    UsageStatsXml.write(f,stats);
    stats.lastTimeSaved=f.getLastModifiedTime();
  }
}
Program: 192778
Project: 192778
Buggy source:
private static void deleteDirectory(File directory){
  File[] files=directory.listFiles();
  for (  File file : files) {
    if (!file.isDirectory()) {
      file.delete();
    }
 else {
      deleteDirectory(file);
    }
  }
  directory.delete();
}

Fixed version (ground truth):
private static void deleteDirectory(File directory){
  File[] files=directory.listFiles();
  if (files != null) {
    for (    File file : files) {
      if (!file.isDirectory()) {
        file.delete();
      }
 else {
        deleteDirectory(file);
      }
    }
  }
  directory.delete();
}
Program: 192779
Project: 192779
Buggy source:
private void collectSpecialWindows(WindowState w){
  if (w.mAttrs.type == TYPE_DOCK_DIVIDER) {
    mDockDivider=w;
  }
 else {
    final TaskStack stack=w.getStack();
    if (stack == null) {
      return;
    }
    if (stack.mStackId == StackId.PINNED_STACK_ID) {
      mPinnedWindow=w;
    }
 else     if (stack.mStackId == StackId.DOCKED_STACK_ID) {
      mDockedWindow=w;
    }
  }
}

Fixed version (ground truth):
private void collectSpecialWindows(WindowState w){
  if (w.mAttrs.type == TYPE_DOCK_DIVIDER) {
    mDockDivider=w;
    return;
  }
  if (w.mWillReplaceWindow) {
    mReplacingWindows.add(w);
  }
  final TaskStack stack=w.getStack();
  if (stack == null) {
    return;
  }
  if (stack.mStackId == PINNED_STACK_ID) {
    mPinnedWindows.add(w);
  }
 else   if (stack.mStackId == DOCKED_STACK_ID) {
    mDockedWindows.add(w);
  }
}
Program: 192780
Project: 192780
Buggy source:
private void clear(){
  mHighestApplicationLayer=0;
  mPinnedWindow=null;
  mDockedWindow=null;
  mDockDivider=null;
}

Fixed version (ground truth):
private void clear(){
  mHighestApplicationLayer=0;
  mPinnedWindows.clear();
  mDockedWindows.clear();
  mReplacingWindows.clear();
  mDockDivider=null;
}
Program: 192781
Project: 192781
Buggy source:
private void adjustSpecialWindows(){
  int layer=mHighestApplicationLayer + 1;
  layer=assignAndIncreaseLayerIfNeeded(mDockedWindow,layer);
  layer++;
  layer=assignAndIncreaseLayerIfNeeded(mDockDivider,layer);
  layer=assignAndIncreaseLayerIfNeeded(mReplacingWindow,layer);
  layer=assignAndIncreaseLayerIfNeeded(mPinnedWindow,layer);
}

Fixed version (ground truth):
private void adjustSpecialWindows(){
  int layer=mHighestApplicationLayer + 1;
  while (!mDockedWindows.isEmpty()) {
    layer=assignAndIncreaseLayerIfNeeded(mDockedWindows.remove(),layer);
  }
  layer++;
  layer=assignAndIncreaseLayerIfNeeded(mDockDivider,layer);
  while (!mReplacingWindows.isEmpty()) {
    layer=assignAndIncreaseLayerIfNeeded(mReplacingWindows.remove(),layer);
  }
  while (!mPinnedWindows.isEmpty()) {
    layer=assignAndIncreaseLayerIfNeeded(mPinnedWindows.remove(),layer);
  }
}
Program: 192782
Project: 192782
Buggy source:
private void collectSpecialWindows(WindowState w){
  if (w.mAttrs.type == TYPE_DOCK_DIVIDER) {
    mDockDivider=w;
  }
 else {
    final TaskStack stack=w.getStack();
    if (stack == null) {
      return;
    }
    if (stack.mStackId == StackId.PINNED_STACK_ID) {
      mPinnedWindow=w;
    }
 else     if (stack.mStackId == StackId.DOCKED_STACK_ID) {
      mDockedWindow=w;
    }
  }
}

Fixed version (ground truth):
private void collectSpecialWindows(WindowState w){
  if (w.mAttrs.type == TYPE_DOCK_DIVIDER) {
    mDockDivider=w;
    return;
  }
  if (w.mWillReplaceWindow) {
    mReplacingWindows.add(w);
  }
  final TaskStack stack=w.getStack();
  if (stack == null) {
    return;
  }
  if (stack.mStackId == PINNED_STACK_ID) {
    mPinnedWindows.add(w);
  }
 else   if (stack.mStackId == DOCKED_STACK_ID) {
    mDockedWindows.add(w);
  }
}
Program: 192783
Project: 192783
Buggy source:
private void clear(){
  mHighestApplicationLayer=0;
  mPinnedWindow=null;
  mDockedWindow=null;
  mDockDivider=null;
}

Fixed version (ground truth):
private void clear(){
  mHighestApplicationLayer=0;
  mPinnedWindows.clear();
  mDockedWindows.clear();
  mReplacingWindows.clear();
  mDockDivider=null;
}
Program: 192784
Project: 192784
Buggy source:
private void adjustSpecialWindows(){
  int layer=mHighestApplicationLayer + 1;
  layer=assignAndIncreaseLayerIfNeeded(mDockedWindow,layer);
  layer++;
  layer=assignAndIncreaseLayerIfNeeded(mDockDivider,layer);
  layer=assignAndIncreaseLayerIfNeeded(mReplacingWindow,layer);
  layer=assignAndIncreaseLayerIfNeeded(mPinnedWindow,layer);
}

Fixed version (ground truth):
private void adjustSpecialWindows(){
  int layer=mHighestApplicationLayer + 1;
  while (!mDockedWindows.isEmpty()) {
    layer=assignAndIncreaseLayerIfNeeded(mDockedWindows.remove(),layer);
  }
  layer++;
  layer=assignAndIncreaseLayerIfNeeded(mDockDivider,layer);
  while (!mReplacingWindows.isEmpty()) {
    layer=assignAndIncreaseLayerIfNeeded(mReplacingWindows.remove(),layer);
  }
  while (!mPinnedWindows.isEmpty()) {
    layer=assignAndIncreaseLayerIfNeeded(mPinnedWindows.remove(),layer);
  }
}
Program: 192785
Project: 192785
Buggy source:
public void updateRunningAccounts(){
  if (Log.isLoggable(TAG,Log.VERBOSE))   Log.v(TAG,"String_Node_Str");
  mSyncHandler.sendEmptyMessage(SyncHandler.MESSAGE_ACCOUNTS_UPDATED);
}

Fixed version (ground truth):
private void updateRunningAccounts(boolean resyncAllTargets){
  if (Log.isLoggable(TAG,Log.VERBOSE))   Log.v(TAG,"String_Node_Str");
  Message m=mSyncHandler.obtainMessage(SyncHandler.MESSAGE_ACCOUNTS_UPDATED);
  m.arg1=resyncAllTargets ? 1 : 0;
  m.sendToTarget();
}
Program: 192786
Project: 192786
Buggy source:
private void onUserRemoved(int userId){
  updateRunningAccounts();
  mSyncStorageEngine.doDatabaseCleanup(new Account[0],userId);
synchronized (mSyncQueue) {
    mSyncQueue.removeUserLocked(userId);
  }
}

Fixed version (ground truth):
private void onUserRemoved(int userId){
  updateRunningAccounts(false);
  mSyncStorageEngine.doDatabaseCleanup(new Account[0],userId);
synchronized (mSyncQueue) {
    mSyncQueue.removeUserLocked(userId);
  }
}
Program: 192787
Project: 192787
Buggy source:
private void onUserStopping(int userId){
  updateRunningAccounts();
  cancelActiveSync(new SyncStorageEngine.EndPoint(null,null,userId),null);
}

Fixed version (ground truth):
private void onUserStopping(int userId){
  updateRunningAccounts(false);
  cancelActiveSync(new SyncStorageEngine.EndPoint(null,null,userId),null);
}
Program: 192788
Project: 192788
Buggy source:
private void onUserUnlocked(int userId){
  AccountManagerService.getSingleton().validateAccounts(userId);
  mSyncAdapters.invalidateCache(userId);
  updateRunningAccounts();
synchronized (mSyncQueue) {
    mSyncQueue.addPendingOperations(userId);
  }
  final Account[] accounts=AccountManagerService.getSingleton().getAccounts(userId,mContext.getOpPackageName());
  for (  Account account : accounts) {
    scheduleSync(account,userId,SyncOperation.REASON_USER_START,null,null,0,0,true);
  }
  sendCheckAlarmsMessage();
}

Fixed version (ground truth):
private void onUserUnlocked(int userId){
  AccountManagerService.getSingleton().validateAccounts(userId);
  mSyncAdapters.invalidateCache(userId);
  updateRunningAccounts(false);
synchronized (mSyncQueue) {
    mSyncQueue.addPendingOperations(userId);
  }
  final Account[] accounts=AccountManagerService.getSingleton().getAccounts(userId,mContext.getOpPackageName());
  for (  Account account : accounts) {
    scheduleSync(account,userId,SyncOperation.REASON_USER_START,null,null,0,0,true);
  }
  sendCheckAlarmsMessage();
}
Program: 192789
Project: 192789
Buggy source:
private void updateRunningAccountsH(){
  mRunningAccounts=AccountManagerService.getSingleton().getRunningAccounts();
  if (mBootCompleted) {
    doDatabaseCleanup();
  }
  AccountAndUser[] accounts=mRunningAccounts;
  for (  ActiveSyncContext currentSyncContext : mActiveSyncContexts) {
    if (!containsAccountAndUser(accounts,currentSyncContext.mSyncOperation.target.account,currentSyncContext.mSyncOperation.target.userId)) {
      Log.d(TAG,"String_Node_Str");
      sendSyncFinishedOrCanceledMessage(currentSyncContext,null);
    }
  }
  sendCheckAlarmsMessage();
}

Fixed version (ground truth):
private void updateRunningAccountsH(boolean resyncAll){
  mRunningAccounts=AccountManagerService.getSingleton().getRunningAccounts();
  if (mBootCompleted) {
    doDatabaseCleanup();
  }
  AccountAndUser[] accounts=mRunningAccounts;
  for (  ActiveSyncContext currentSyncContext : mActiveSyncContexts) {
    if (!containsAccountAndUser(accounts,currentSyncContext.mSyncOperation.target.account,currentSyncContext.mSyncOperation.target.userId)) {
      Log.d(TAG,"String_Node_Str");
      sendSyncFinishedOrCanceledMessage(currentSyncContext,null);
    }
  }
  if (resyncAll) {
    scheduleSync(null,UserHandle.USER_ALL,SyncOperation.REASON_ACCOUNTS_UPDATED,null,null,0,0,false);
  }
 else {
    sendCheckAlarmsMessage();
  }
}
Program: 192791
Project: 192791
Buggy source:
private void updateRunningAccounts(boolean resyncAllTargets){
  if (Log.isLoggable(TAG,Log.VERBOSE))   Log.v(TAG,"String_Node_Str");
  Message m=mSyncHandler.obtainMessage(SyncHandler.MESSAGE_ACCOUNTS_UPDATED);
  m.arg1=resyncAllTargets ? 1 : 0;
  m.sendToTarget();
}

Fixed version (ground truth):
public void updateRunningAccounts(){
  if (Log.isLoggable(TAG,Log.VERBOSE))   Log.v(TAG,"String_Node_Str");
  mSyncHandler.sendEmptyMessage(SyncHandler.MESSAGE_ACCOUNTS_UPDATED);
}
Program: 192792
Project: 192792
Buggy source:
private void onUserRemoved(int userId){
  updateRunningAccounts(false);
  mSyncStorageEngine.doDatabaseCleanup(new Account[0],userId);
synchronized (mSyncQueue) {
    mSyncQueue.removeUserLocked(userId);
  }
}

Fixed version (ground truth):
private void onUserRemoved(int userId){
  updateRunningAccounts();
  mSyncStorageEngine.doDatabaseCleanup(new Account[0],userId);
synchronized (mSyncQueue) {
    mSyncQueue.removeUserLocked(userId);
  }
}
Program: 192793
Project: 192793
Buggy source:
private void onUserStopping(int userId){
  updateRunningAccounts(false);
  cancelActiveSync(new SyncStorageEngine.EndPoint(null,null,userId),null);
}

Fixed version (ground truth):
private void onUserStopping(int userId){
  updateRunningAccounts();
  cancelActiveSync(new SyncStorageEngine.EndPoint(null,null,userId),null);
}
Program: 192794
Project: 192794
Buggy source:
private void onUserUnlocked(int userId){
  AccountManagerService.getSingleton().validateAccounts(userId);
  mSyncAdapters.invalidateCache(userId);
  updateRunningAccounts(false);
synchronized (mSyncQueue) {
    mSyncQueue.addPendingOperations(userId);
  }
  final Account[] accounts=AccountManagerService.getSingleton().getAccounts(userId,mContext.getOpPackageName());
  for (  Account account : accounts) {
    scheduleSync(account,userId,SyncOperation.REASON_USER_START,null,null,0,0,true);
  }
  sendCheckAlarmsMessage();
}

Fixed version (ground truth):
private void onUserUnlocked(int userId){
  AccountManagerService.getSingleton().validateAccounts(userId);
  mSyncAdapters.invalidateCache(userId);
  updateRunningAccounts();
synchronized (mSyncQueue) {
    mSyncQueue.addPendingOperations(userId);
  }
  final Account[] accounts=AccountManagerService.getSingleton().getAccounts(userId,mContext.getOpPackageName());
  for (  Account account : accounts) {
    scheduleSync(account,userId,SyncOperation.REASON_USER_START,null,null,0,0,true);
  }
  sendCheckAlarmsMessage();
}
Program: 192795
Project: 192795
Buggy source:
private void updateRunningAccountsH(boolean resyncAll){
  mRunningAccounts=AccountManagerService.getSingleton().getRunningAccounts();
  if (mBootCompleted) {
    doDatabaseCleanup();
  }
  AccountAndUser[] accounts=mRunningAccounts;
  for (  ActiveSyncContext currentSyncContext : mActiveSyncContexts) {
    if (!containsAccountAndUser(accounts,currentSyncContext.mSyncOperation.target.account,currentSyncContext.mSyncOperation.target.userId)) {
      Log.d(TAG,"String_Node_Str");
      sendSyncFinishedOrCanceledMessage(currentSyncContext,null);
    }
  }
  if (resyncAll) {
    scheduleSync(null,UserHandle.USER_ALL,SyncOperation.REASON_ACCOUNTS_UPDATED,null,null,0,0,false);
  }
 else {
    sendCheckAlarmsMessage();
  }
}

Fixed version (ground truth):
private void updateRunningAccountsH(){
  mRunningAccounts=AccountManagerService.getSingleton().getRunningAccounts();
  if (mBootCompleted) {
    doDatabaseCleanup();
  }
  AccountAndUser[] accounts=mRunningAccounts;
  for (  ActiveSyncContext currentSyncContext : mActiveSyncContexts) {
    if (!containsAccountAndUser(accounts,currentSyncContext.mSyncOperation.target.account,currentSyncContext.mSyncOperation.target.userId)) {
      Log.d(TAG,"String_Node_Str");
      sendSyncFinishedOrCanceledMessage(currentSyncContext,null);
    }
  }
  sendCheckAlarmsMessage();
}
Program: 192797
Project: 192797
Buggy source:
private void updateRunningAccounts(boolean resyncAllTargets){
  if (Log.isLoggable(TAG,Log.VERBOSE))   Log.v(TAG,"String_Node_Str");
  Message m=mSyncHandler.obtainMessage(SyncHandler.MESSAGE_ACCOUNTS_UPDATED);
  m.arg1=resyncAllTargets ? 1 : 0;
  m.sendToTarget();
}

Fixed version (ground truth):
public void updateRunningAccounts(){
  if (Log.isLoggable(TAG,Log.VERBOSE))   Log.v(TAG,"String_Node_Str");
  mSyncHandler.sendEmptyMessage(SyncHandler.MESSAGE_ACCOUNTS_UPDATED);
}
Program: 192798
Project: 192798
Buggy source:
private void onUserRemoved(int userId){
  updateRunningAccounts(false);
  mSyncStorageEngine.doDatabaseCleanup(new Account[0],userId);
synchronized (mSyncQueue) {
    mSyncQueue.removeUserLocked(userId);
  }
}

Fixed version (ground truth):
private void onUserRemoved(int userId){
  updateRunningAccounts();
  mSyncStorageEngine.doDatabaseCleanup(new Account[0],userId);
synchronized (mSyncQueue) {
    mSyncQueue.removeUserLocked(userId);
  }
}
Program: 192799
Project: 192799
Buggy source:
private void onUserStopping(int userId){
  updateRunningAccounts(false);
  cancelActiveSync(new SyncStorageEngine.EndPoint(null,null,userId),null);
}

Fixed version (ground truth):
private void onUserStopping(int userId){
  updateRunningAccounts();
  cancelActiveSync(new SyncStorageEngine.EndPoint(null,null,userId),null);
}
Program: 192800
Project: 192800
Buggy source:
private void onUserUnlocked(int userId){
  AccountManagerService.getSingleton().validateAccounts(userId);
  mSyncAdapters.invalidateCache(userId);
  updateRunningAccounts(false);
synchronized (mSyncQueue) {
    mSyncQueue.addPendingOperations(userId);
  }
  final Account[] accounts=AccountManagerService.getSingleton().getAccounts(userId,mContext.getOpPackageName());
  for (  Account account : accounts) {
    scheduleSync(account,userId,SyncOperation.REASON_USER_START,null,null,0,0,true);
  }
  sendCheckAlarmsMessage();
}

Fixed version (ground truth):
private void onUserUnlocked(int userId){
  AccountManagerService.getSingleton().validateAccounts(userId);
  mSyncAdapters.invalidateCache(userId);
  updateRunningAccounts();
synchronized (mSyncQueue) {
    mSyncQueue.addPendingOperations(userId);
  }
  final Account[] accounts=AccountManagerService.getSingleton().getAccounts(userId,mContext.getOpPackageName());
  for (  Account account : accounts) {
    scheduleSync(account,userId,SyncOperation.REASON_USER_START,null,null,0,0,true);
  }
  sendCheckAlarmsMessage();
}
Program: 192801
Project: 192801
Buggy source:
private void updateRunningAccountsH(boolean resyncAll){
  mRunningAccounts=AccountManagerService.getSingleton().getRunningAccounts();
  if (mBootCompleted) {
    doDatabaseCleanup();
  }
  AccountAndUser[] accounts=mRunningAccounts;
  for (  ActiveSyncContext currentSyncContext : mActiveSyncContexts) {
    if (!containsAccountAndUser(accounts,currentSyncContext.mSyncOperation.target.account,currentSyncContext.mSyncOperation.target.userId)) {
      Log.d(TAG,"String_Node_Str");
      sendSyncFinishedOrCanceledMessage(currentSyncContext,null);
    }
  }
  if (resyncAll) {
    scheduleSync(null,UserHandle.USER_ALL,SyncOperation.REASON_ACCOUNTS_UPDATED,null,null,0,0,false);
  }
 else {
    sendCheckAlarmsMessage();
  }
}

Fixed version (ground truth):
private void updateRunningAccountsH(){
  mRunningAccounts=AccountManagerService.getSingleton().getRunningAccounts();
  if (mBootCompleted) {
    doDatabaseCleanup();
  }
  AccountAndUser[] accounts=mRunningAccounts;
  for (  ActiveSyncContext currentSyncContext : mActiveSyncContexts) {
    if (!containsAccountAndUser(accounts,currentSyncContext.mSyncOperation.target.account,currentSyncContext.mSyncOperation.target.userId)) {
      Log.d(TAG,"String_Node_Str");
      sendSyncFinishedOrCanceledMessage(currentSyncContext,null);
    }
  }
  sendCheckAlarmsMessage();
}
Program: 192805
Project: 192805
Buggy source:
public void onNotificationUpdated(NotificationData.Entry entry){
  mEntry=entry;
  mStatusBarNotification=entry.notification;
  mPrivateLayout.onNotificationUpdated(entry);
  mPublicLayout.onNotificationUpdated(entry);
  updateVetoButton();
  if (mIsSummaryWithChildren) {
    recreateNotificationHeader();
  }
  if (mIconAnimationRunning) {
    setIconAnimationRunning(true);
  }
  if (mNotificationParent != null) {
    mNotificationParent.updateChildrenHeaderAppearance();
  }
  onChildrenCountChanged();
  mPublicLayout.updateExpandButtons(true);
  updateLimits();
}

Fixed version (ground truth):
public void onNotificationUpdated(NotificationData.Entry entry){
  mEntry=entry;
  mStatusBarNotification=entry.notification;
  mPrivateLayout.onNotificationUpdated(entry);
  mPublicLayout.onNotificationUpdated(entry);
  mShowingPublicInitialized=false;
  updateClearability();
  if (mIsSummaryWithChildren) {
    recreateNotificationHeader();
  }
  if (mIconAnimationRunning) {
    setIconAnimationRunning(true);
  }
  if (mNotificationParent != null) {
    mNotificationParent.updateChildrenHeaderAppearance();
  }
  onChildrenCountChanged();
  mPublicLayout.updateExpandButtons(true);
  updateLimits();
}
Program: 192806
Project: 192806
Buggy source:
public void setHideSensitive(boolean hideSensitive,boolean animated,long delay,long duration){
  boolean oldShowingPublic=mShowingPublic;
  mShowingPublic=mSensitive && hideSensitive;
  if (mShowingPublicInitialized && mShowingPublic == oldShowingPublic) {
    return;
  }
  if (mPublicLayout.getChildCount() == 0)   return;
  if (!animated) {
    mPublicLayout.animate().cancel();
    mPrivateLayout.animate().cancel();
    mPublicLayout.setAlpha(1f);
    mPrivateLayout.setAlpha(1f);
    mPublicLayout.setVisibility(mShowingPublic ? View.VISIBLE : View.INVISIBLE);
    updateChildrenVisibility();
  }
 else {
    animateShowingPublic(delay,duration);
  }
  mPrivateLayout.updateExpandButtons(isExpandable());
  updateVetoButton();
  mShowingPublicInitialized=true;
}

Fixed version (ground truth):
public void setHideSensitive(boolean hideSensitive,boolean animated,long delay,long duration){
  boolean oldShowingPublic=mShowingPublic;
  mShowingPublic=mSensitive && hideSensitive;
  if (mShowingPublicInitialized && mShowingPublic == oldShowingPublic) {
    return;
  }
  if (mPublicLayout.getChildCount() == 0)   return;
  if (!animated) {
    mPublicLayout.animate().cancel();
    mPrivateLayout.animate().cancel();
    mPublicLayout.setAlpha(1f);
    mPrivateLayout.setAlpha(1f);
    mPublicLayout.setVisibility(mShowingPublic ? View.VISIBLE : View.INVISIBLE);
    updateChildrenVisibility();
  }
 else {
    animateShowingPublic(delay,duration);
  }
  mPrivateLayout.updateExpandButtons(isExpandable());
  updateClearability();
  mShowingPublicInitialized=true;
}
Program: 192810
Project: 192810
Buggy source:
public DragStartInitializeDropTargetsEvent(Task task,RecentsViewTouchHandler handler){
  this.task=task;
  this.handler=handler;
}

Fixed version (ground truth):
public DragStartInitializeDropTargetsEvent(Task task,TaskView taskView,RecentsViewTouchHandler handler){
  this.task=task;
  this.taskView=taskView;
  this.handler=handler;
}
Program: 192811
Project: 192811
Buggy source:
/** 
 * Returns the task stack bounds with the given   {@param width} and{@param height}.
 */
public Rect getDockedTaskStackBounds(int width,int height,int dividerSize,Rect insets,Resources res){
  RecentsConfiguration config=Recents.getConfiguration();
  boolean isHorizontalDivision=res.getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT;
  int position=DockedDividerUtils.calculateMiddlePosition(isHorizontalDivision,insets,width,height,dividerSize);
  Rect newWindowBounds=new Rect();
  DockedDividerUtils.calculateBoundsForPosition(position,DockedDividerUtils.invertDockSide(dockSide),newWindowBounds,width,height,dividerSize);
  Rect searchBarSpaceBounds=new Rect();
  Rect taskStackBounds=new Rect();
  config.getTaskStackBounds(newWindowBounds,insets.top,insets.right,searchBarSpaceBounds,taskStackBounds);
  return taskStackBounds;
}

Fixed version (ground truth):
/** 
 * Returns the task stack bounds with the given   {@param width} and{@param height}.
 */
public Rect getDockedTaskStackBounds(int width,int height,int dividerSize,Rect insets,Resources res){
  RecentsConfiguration config=Recents.getConfiguration();
  boolean isHorizontalDivision=res.getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT;
  int position=DockedDividerUtils.calculateMiddlePosition(isHorizontalDivision,insets,width,height,dividerSize);
  Rect newWindowBounds=new Rect();
  DockedDividerUtils.calculateBoundsForPosition(position,DockedDividerUtils.invertDockSide(dockSide),newWindowBounds,width,height,dividerSize);
  Rect searchBarSpaceBounds=new Rect();
  Rect taskStackBounds=new Rect();
  int top=dockArea.bottom < 1f ? 0 : insets.top;
  config.getTaskStackBounds(newWindowBounds,top,insets.right,searchBarSpaceBounds,taskStackBounds);
  return taskStackBounds;
}
Program: 192812
Project: 192812
Buggy source:
@Override public void run(){
  setVisibility(View.INVISIBLE);
}

Fixed version (ground truth):
@Override public void run(){
  mStackScroller.animateScroll(mLayoutAlgorithm.mMaxScrollP,null);
}
Program: 192813
Project: 192813
Buggy source:
public final void onBusEvent(HideHistoryEvent event){
  setVisibility(View.VISIBLE);
  mAnimationHelper.startHideHistoryAnimation();
}

Fixed version (ground truth):
public final void onBusEvent(TaskStackUpdatedEvent event){
  event.addPostAnimationCallback(new Runnable(){
    @Override public void run(){
      mStackScroller.animateScroll(mLayoutAlgorithm.mMaxScrollP,null);
    }
  }
);
}
Program: 192815
Project: 192815
Buggy source:
/** 
 * Animates the stack scroll 
 */
void animateScroll(float curScroll,float newScroll,final Runnable postRunnable){
  if (mScrollAnimator != null && mScrollAnimator.isRunning()) {
    setStackScroll(mFinalAnimatedScroll);
    mScroller.startScroll(0,progressToScrollRange(mFinalAnimatedScroll),0,0,0);
  }
  stopScroller();
  stopBoundScrollAnimation();
  mFinalAnimatedScroll=newScroll;
  mScrollAnimator=ObjectAnimator.ofFloat(this,STACK_SCROLL,curScroll,newScroll);
  mScrollAnimator.setDuration(mContext.getResources().getInteger(R.integer.recents_animate_task_stack_scroll_duration));
  mScrollAnimator.setInterpolator(Interpolators.LINEAR_OUT_SLOW_IN);
  mScrollAnimator.addListener(new AnimatorListenerAdapter(){
    @Override public void onAnimationEnd(    Animator animation){
      if (postRunnable != null) {
        postRunnable.run();
      }
      mScrollAnimator.removeAllListeners();
    }
  }
);
  mScrollAnimator.start();
}

Fixed version (ground truth):
/** 
 * Animates the stack scroll 
 */
void animateScroll(float newScroll,final Runnable postRunnable){
  if (mScrollAnimator != null && mScrollAnimator.isRunning()) {
    setStackScroll(mFinalAnimatedScroll);
    mScroller.startScroll(0,progressToScrollRange(mFinalAnimatedScroll),0,0,0);
  }
  stopScroller();
  stopBoundScrollAnimation();
  mFinalAnimatedScroll=newScroll;
  mScrollAnimator=ObjectAnimator.ofFloat(this,STACK_SCROLL,getStackScroll(),newScroll);
  mScrollAnimator.setDuration(mContext.getResources().getInteger(R.integer.recents_animate_task_stack_scroll_duration));
  mScrollAnimator.setInterpolator(Interpolators.LINEAR_OUT_SLOW_IN);
  mScrollAnimator.addListener(new AnimatorListenerAdapter(){
    @Override public void onAnimationEnd(    Animator animation){
      if (postRunnable != null) {
        postRunnable.run();
      }
      mScrollAnimator.removeAllListeners();
    }
  }
);
  mScrollAnimator.start();
}
Program: 192816
Project: 192816
Buggy source:
/** 
 * Sets the current stack scroll to the initial state when you first enter recents.
 * @return whether the stack progress changed.
 */
public boolean setStackScrollToInitialState(){
  float prevStackScrollP=mStackScrollP;
  setStackScroll(getBoundedStackScroll(mLayoutAlgorithm.mInitialScrollP));
  return Float.compare(prevStackScrollP,mStackScrollP) != 0;
}

Fixed version (ground truth):
/** 
 * Sets the current stack scroll to the initial state when you first enter recents.
 * @return whether the stack progress changed.
 */
public boolean setStackScrollToInitialState(){
  SystemServicesProxy ssp=Recents.getSystemServices();
  float prevStackScrollP=mStackScrollP;
  if (ssp.hasDockedTask()) {
    setStackScroll(mLayoutAlgorithm.mMaxScrollP);
  }
 else {
    setStackScroll(mLayoutAlgorithm.mInitialScrollP);
  }
  return Float.compare(prevStackScrollP,mStackScrollP) != 0;
}
Program: 192817
Project: 192817
Buggy source:
/** 
 * Animates the stack scroll into bounds 
 */
ObjectAnimator animateBoundScroll(){
  float curScroll=getStackScroll();
  float newScroll=getBoundedStackScroll(curScroll);
  if (Float.compare(newScroll,curScroll) != 0) {
    animateScroll(curScroll,newScroll,null);
  }
  return mScrollAnimator;
}

Fixed version (ground truth):
/** 
 * Animates the stack scroll into bounds 
 */
ObjectAnimator animateBoundScroll(){
  float curScroll=getStackScroll();
  float newScroll=getBoundedStackScroll(curScroll);
  if (Float.compare(newScroll,curScroll) != 0) {
    animateScroll(newScroll,null);
  }
  return mScrollAnimator;
}
Program: 192818
Project: 192818
Buggy source:
public DragStartInitializeDropTargetsEvent(Task task,RecentsViewTouchHandler handler){
  this.task=task;
  this.handler=handler;
}

Fixed version (ground truth):
public DragStartInitializeDropTargetsEvent(Task task,TaskView taskView,RecentsViewTouchHandler handler){
  this.task=task;
  this.taskView=taskView;
  this.handler=handler;
}
Program: 192819
Project: 192819
Buggy source:
/** 
 * Returns the task stack bounds with the given   {@param width} and{@param height}.
 */
public Rect getDockedTaskStackBounds(int width,int height,int dividerSize,Rect insets,Resources res){
  RecentsConfiguration config=Recents.getConfiguration();
  boolean isHorizontalDivision=res.getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT;
  int position=DockedDividerUtils.calculateMiddlePosition(isHorizontalDivision,insets,width,height,dividerSize);
  Rect newWindowBounds=new Rect();
  DockedDividerUtils.calculateBoundsForPosition(position,DockedDividerUtils.invertDockSide(dockSide),newWindowBounds,width,height,dividerSize);
  Rect searchBarSpaceBounds=new Rect();
  Rect taskStackBounds=new Rect();
  config.getTaskStackBounds(newWindowBounds,insets.top,insets.right,searchBarSpaceBounds,taskStackBounds);
  return taskStackBounds;
}

Fixed version (ground truth):
/** 
 * Returns the task stack bounds with the given   {@param width} and{@param height}.
 */
public Rect getDockedTaskStackBounds(int width,int height,int dividerSize,Rect insets,Resources res){
  RecentsConfiguration config=Recents.getConfiguration();
  boolean isHorizontalDivision=res.getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT;
  int position=DockedDividerUtils.calculateMiddlePosition(isHorizontalDivision,insets,width,height,dividerSize);
  Rect newWindowBounds=new Rect();
  DockedDividerUtils.calculateBoundsForPosition(position,DockedDividerUtils.invertDockSide(dockSide),newWindowBounds,width,height,dividerSize);
  Rect searchBarSpaceBounds=new Rect();
  Rect taskStackBounds=new Rect();
  int top=dockArea.bottom < 1f ? 0 : insets.top;
  config.getTaskStackBounds(newWindowBounds,top,insets.right,searchBarSpaceBounds,taskStackBounds);
  return taskStackBounds;
}
Program: 192820
Project: 192820
Buggy source:
@Override public void run(){
  setVisibility(View.INVISIBLE);
}

Fixed version (ground truth):
@Override public void run(){
  mStackScroller.animateScroll(mLayoutAlgorithm.mMaxScrollP,null);
}
Program: 192821
Project: 192821
Buggy source:
public final void onBusEvent(HideHistoryEvent event){
  setVisibility(View.VISIBLE);
  mAnimationHelper.startHideHistoryAnimation();
}

Fixed version (ground truth):
public final void onBusEvent(TaskStackUpdatedEvent event){
  event.addPostAnimationCallback(new Runnable(){
    @Override public void run(){
      mStackScroller.animateScroll(mLayoutAlgorithm.mMaxScrollP,null);
    }
  }
);
}
Program: 192823
Project: 192823
Buggy source:
/** 
 * Animates the stack scroll 
 */
void animateScroll(float curScroll,float newScroll,final Runnable postRunnable){
  if (mScrollAnimator != null && mScrollAnimator.isRunning()) {
    setStackScroll(mFinalAnimatedScroll);
    mScroller.startScroll(0,progressToScrollRange(mFinalAnimatedScroll),0,0,0);
  }
  stopScroller();
  stopBoundScrollAnimation();
  mFinalAnimatedScroll=newScroll;
  mScrollAnimator=ObjectAnimator.ofFloat(this,STACK_SCROLL,curScroll,newScroll);
  mScrollAnimator.setDuration(mContext.getResources().getInteger(R.integer.recents_animate_task_stack_scroll_duration));
  mScrollAnimator.setInterpolator(Interpolators.LINEAR_OUT_SLOW_IN);
  mScrollAnimator.addListener(new AnimatorListenerAdapter(){
    @Override public void onAnimationEnd(    Animator animation){
      if (postRunnable != null) {
        postRunnable.run();
      }
      mScrollAnimator.removeAllListeners();
    }
  }
);
  mScrollAnimator.start();
}

Fixed version (ground truth):
/** 
 * Animates the stack scroll 
 */
void animateScroll(float newScroll,final Runnable postRunnable){
  if (mScrollAnimator != null && mScrollAnimator.isRunning()) {
    setStackScroll(mFinalAnimatedScroll);
    mScroller.startScroll(0,progressToScrollRange(mFinalAnimatedScroll),0,0,0);
  }
  stopScroller();
  stopBoundScrollAnimation();
  mFinalAnimatedScroll=newScroll;
  mScrollAnimator=ObjectAnimator.ofFloat(this,STACK_SCROLL,getStackScroll(),newScroll);
  mScrollAnimator.setDuration(mContext.getResources().getInteger(R.integer.recents_animate_task_stack_scroll_duration));
  mScrollAnimator.setInterpolator(Interpolators.LINEAR_OUT_SLOW_IN);
  mScrollAnimator.addListener(new AnimatorListenerAdapter(){
    @Override public void onAnimationEnd(    Animator animation){
      if (postRunnable != null) {
        postRunnable.run();
      }
      mScrollAnimator.removeAllListeners();
    }
  }
);
  mScrollAnimator.start();
}
Program: 192824
Project: 192824
Buggy source:
/** 
 * Sets the current stack scroll to the initial state when you first enter recents.
 * @return whether the stack progress changed.
 */
public boolean setStackScrollToInitialState(){
  float prevStackScrollP=mStackScrollP;
  setStackScroll(getBoundedStackScroll(mLayoutAlgorithm.mInitialScrollP));
  return Float.compare(prevStackScrollP,mStackScrollP) != 0;
}

Fixed version (ground truth):
/** 
 * Sets the current stack scroll to the initial state when you first enter recents.
 * @return whether the stack progress changed.
 */
public boolean setStackScrollToInitialState(){
  SystemServicesProxy ssp=Recents.getSystemServices();
  float prevStackScrollP=mStackScrollP;
  if (ssp.hasDockedTask()) {
    setStackScroll(mLayoutAlgorithm.mMaxScrollP);
  }
 else {
    setStackScroll(mLayoutAlgorithm.mInitialScrollP);
  }
  return Float.compare(prevStackScrollP,mStackScrollP) != 0;
}
Program: 192825
Project: 192825
Buggy source:
/** 
 * Animates the stack scroll into bounds 
 */
ObjectAnimator animateBoundScroll(){
  float curScroll=getStackScroll();
  float newScroll=getBoundedStackScroll(curScroll);
  if (Float.compare(newScroll,curScroll) != 0) {
    animateScroll(curScroll,newScroll,null);
  }
  return mScrollAnimator;
}

Fixed version (ground truth):
/** 
 * Animates the stack scroll into bounds 
 */
ObjectAnimator animateBoundScroll(){
  float curScroll=getStackScroll();
  float newScroll=getBoundedStackScroll(curScroll);
  if (Float.compare(newScroll,curScroll) != 0) {
    animateScroll(newScroll,null);
  }
  return mScrollAnimator;
}
Program: 192828
Project: 192828
Buggy source:
public void onNotificationUpdated(NotificationData.Entry entry){
  mEntry=entry;
  mStatusBarNotification=entry.notification;
  mPrivateLayout.onNotificationUpdated(entry);
  mPublicLayout.onNotificationUpdated(entry);
  updateVetoButton();
  if (mIsSummaryWithChildren) {
    recreateNotificationHeader();
  }
  if (mIconAnimationRunning) {
    setIconAnimationRunning(true);
  }
  if (mNotificationParent != null) {
    mNotificationParent.updateChildrenHeaderAppearance();
  }
  onChildrenCountChanged();
  mPublicLayout.updateExpandButtons(true);
  updateLimits();
}

Fixed version (ground truth):
public void onNotificationUpdated(NotificationData.Entry entry){
  mEntry=entry;
  mStatusBarNotification=entry.notification;
  mPrivateLayout.onNotificationUpdated(entry);
  mPublicLayout.onNotificationUpdated(entry);
  mShowingPublicInitialized=false;
  updateClearability();
  if (mIsSummaryWithChildren) {
    recreateNotificationHeader();
  }
  if (mIconAnimationRunning) {
    setIconAnimationRunning(true);
  }
  if (mNotificationParent != null) {
    mNotificationParent.updateChildrenHeaderAppearance();
  }
  onChildrenCountChanged();
  mPublicLayout.updateExpandButtons(true);
  updateLimits();
}