nus-yam/ex-repair huggingface dataset:
Program: 192719
Project: 192719
Buggy source:
private void updateSingleLineView(){
  if (mIsChildInGroup) {
    mSingleLineView=mHybridViewManager.bindFromNotification(mSingleLineView,mStatusBarNotification.getNotification());
  }
}

Fixed version (ground truth):
private void updateSingleLineView(){
  if (mIsChildInGroup) {
    mSingleLineView=mHybridViewManager.bindFromNotification(mSingleLineView,mStatusBarNotification.getNotification());
  }
 else   if (mSingleLineView != null) {
    removeView(mSingleLineView);
    mSingleLineView=null;
  }
}
Program: 192720
Project: 192720
Buggy source:
@Override public void maybeEscalateHeadsUp(){
  TreeSet<HeadsUpManager.HeadsUpEntry> entries=mHeadsUpManager.getSortedEntries();
  for (  HeadsUpManager.HeadsUpEntry entry : entries) {
    final StatusBarNotification sbn=entry.entry.notification;
    final Notification notification=sbn.getNotification();
    if (notification.fullScreenIntent != null) {
      if (DEBUG) {
        Log.d(TAG,"String_Node_Str");
      }
      try {
        EventLog.writeEvent(EventLogTags.SYSUI_HEADS_UP_ESCALATION,sbn.getKey());
        notification.fullScreenIntent.send();
        entry.entry.notifyFullScreenIntentLaunched();
      }
 catch (      PendingIntent.CanceledException e) {
      }
    }
  }
  mHeadsUpManager.releaseAllImmediately();
}

Fixed version (ground truth):
@Override public void maybeEscalateHeadsUp(){
  Collection<HeadsUpManager.HeadsUpEntry> entries=mHeadsUpManager.getAllEntries();
  for (  HeadsUpManager.HeadsUpEntry entry : entries) {
    final StatusBarNotification sbn=entry.entry.notification;
    final Notification notification=sbn.getNotification();
    if (notification.fullScreenIntent != null) {
      if (DEBUG) {
        Log.d(TAG,"String_Node_Str");
      }
      try {
        EventLog.writeEvent(EventLogTags.SYSUI_HEADS_UP_ESCALATION,sbn.getKey());
        notification.fullScreenIntent.send();
        entry.entry.notifyFullScreenIntentLaunched();
      }
 catch (      PendingIntent.CanceledException e) {
      }
    }
  }
  mHeadsUpManager.releaseAllImmediately();
}
Program: 192721
Project: 192721
Buggy source:
@Override public int compareTo(HeadsUpEntry o){
  boolean selfFullscreen=hasFullScreenIntent(entry);
  boolean otherFullscreen=hasFullScreenIntent(o.entry);
  if (selfFullscreen && !otherFullscreen) {
    return -1;
  }
 else   if (!selfFullscreen && otherFullscreen) {
    return 1;
  }
  return postTime < o.postTime ? 1 : postTime == o.postTime ? entry.key.compareTo(o.entry.key) : -1;
}

Fixed version (ground truth):
@Override public int compareTo(HeadsUpEntry o){
  boolean isPinned=entry.row.isPinned();
  boolean otherPinned=o.entry.row.isPinned();
  if (isPinned && !otherPinned) {
    return -1;
  }
 else   if (!isPinned && otherPinned) {
    return 1;
  }
  boolean selfFullscreen=hasFullScreenIntent(entry);
  boolean otherFullscreen=hasFullScreenIntent(o.entry);
  if (selfFullscreen && !otherFullscreen) {
    return -1;
  }
 else   if (!selfFullscreen && otherFullscreen) {
    return 1;
  }
  return postTime < o.postTime ? 1 : postTime == o.postTime ? entry.key.compareTo(o.entry.key) : -1;
}
Program: 192722
Project: 192722
Buggy source:
private void removeHeadsUpEntry(NotificationData.Entry entry){
  HeadsUpEntry remove=mHeadsUpEntries.remove(entry.key);
  mSortedEntries.remove(remove);
  entry.row.sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED);
  entry.row.setHeadsUp(false);
  setEntryPinned(remove,false);
  for (  OnHeadsUpChangedListener listener : mListeners) {
    listener.onHeadsUpStateChanged(entry,false);
  }
  mEntryPool.release(remove);
}

Fixed version (ground truth):
private void removeHeadsUpEntry(NotificationData.Entry entry){
  HeadsUpEntry remove=mHeadsUpEntries.remove(entry.key);
  entry.row.sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED);
  entry.row.setHeadsUp(false);
  setEntryPinned(remove,false);
  for (  OnHeadsUpChangedListener listener : mListeners) {
    listener.onHeadsUpStateChanged(entry,false);
  }
  mEntryPool.release(remove);
}
Program: 192723
Project: 192723
Buggy source:
public HeadsUpEntry getTopEntry(){
  return mSortedEntries.isEmpty() ? null : mSortedEntries.first();
}

Fixed version (ground truth):
public HeadsUpEntry getTopEntry(){
  if (mHeadsUpEntries.isEmpty()) {
    return null;
  }
  HeadsUpEntry topEntry=null;
  for (  HeadsUpEntry entry : mHeadsUpEntries.values()) {
    if (topEntry == null || entry.compareTo(topEntry) == -1) {
      topEntry=entry;
    }
  }
  return topEntry;
}
Program: 192724
Project: 192724
Buggy source:
public void updateEntry(boolean updatePostTime){
  mSortedEntries.remove(HeadsUpEntry.this);
  long currentTime=mClock.currentTimeMillis();
  earliestRemovaltime=currentTime + mMinimumDisplayTime;
  if (updatePostTime) {
    postTime=Math.max(postTime,currentTime);
  }
  removeAutoRemovalCallbacks();
  if (mEntriesToRemoveAfterExpand.contains(entry)) {
    mEntriesToRemoveAfterExpand.remove(entry);
  }
  if (!isSticky()) {
    long finishTime=postTime + mHeadsUpNotificationDecay;
    long removeDelay=Math.max(finishTime - currentTime,mMinimumDisplayTime);
    mHandler.postDelayed(mRemoveHeadsUpRunnable,removeDelay);
  }
  mSortedEntries.add(HeadsUpEntry.this);
}

Fixed version (ground truth):
public void updateEntry(boolean updatePostTime){
  long currentTime=mClock.currentTimeMillis();
  earliestRemovaltime=currentTime + mMinimumDisplayTime;
  if (updatePostTime) {
    postTime=Math.max(postTime,currentTime);
  }
  removeAutoRemovalCallbacks();
  if (mEntriesToRemoveAfterExpand.contains(entry)) {
    mEntriesToRemoveAfterExpand.remove(entry);
  }
  if (!isSticky()) {
    long finishTime=postTime + mHeadsUpNotificationDecay;
    long removeDelay=Math.max(finishTime - currentTime,mMinimumDisplayTime);
    mHandler.postDelayed(mRemoveHeadsUpRunnable,removeDelay);
  }
}
Program: 192725
Project: 192725
Buggy source:
public void dump(FileDescriptor fd,PrintWriter pw,String[] args){
  pw.println("String_Node_Str");
  pw.print("String_Node_Str");
  pw.println(mTouchAcceptanceDelay);
  pw.print("String_Node_Str");
  pw.println(mSnoozeLengthMs);
  pw.print("String_Node_Str");
  pw.println(SystemClock.elapsedRealtime());
  pw.print("String_Node_Str");
  pw.println(mUser);
  for (  HeadsUpEntry entry : mSortedEntries) {
    pw.print("String_Node_Str");
    pw.println(entry.entry);
  }
  int N=mSnoozedPackages.size();
  pw.println("String_Node_Str" + N);
  for (int i=0; i < N; i++) {
    pw.print("String_Node_Str");
    pw.print(mSnoozedPackages.valueAt(i));
    pw.print("String_Node_Str");
    pw.println(mSnoozedPackages.keyAt(i));
  }
}

Fixed version (ground truth):
public void dump(FileDescriptor fd,PrintWriter pw,String[] args){
  pw.println("String_Node_Str");
  pw.print("String_Node_Str");
  pw.println(mTouchAcceptanceDelay);
  pw.print("String_Node_Str");
  pw.println(mSnoozeLengthMs);
  pw.print("String_Node_Str");
  pw.println(SystemClock.elapsedRealtime());
  pw.print("String_Node_Str");
  pw.println(mUser);
  for (  HeadsUpEntry entry : mHeadsUpEntries.values()) {
    pw.print("String_Node_Str");
    pw.println(entry.entry);
  }
  int N=mSnoozedPackages.size();
  pw.println("String_Node_Str" + N);
  for (int i=0; i < N; i++) {
    pw.print("String_Node_Str");
    pw.print(mSnoozedPackages.valueAt(i));
    pw.print("String_Node_Str");
    pw.println(mSnoozedPackages.keyAt(i));
  }
}
Program: 192726
Project: 192726
Buggy source:
public void onComputeInternalInsets(ViewTreeObserver.InternalInsetsInfo info){
  if (mIsExpanded) {
    return;
  }
  if (mHasPinnedNotification) {
    int minX=0;
    int maxX=0;
    int maxY=0;
    for (    HeadsUpEntry entry : mSortedEntries) {
      ExpandableNotificationRow row=entry.entry.row;
      if (row.isPinned()) {
        if (row.isChildInGroup()) {
          final ExpandableNotificationRow groupSummary=mGroupManager.getGroupSummary(row.getStatusBarNotification());
          if (groupSummary != null) {
            row=groupSummary;
          }
        }
        row.getLocationOnScreen(mTmpTwoArray);
        minX=mTmpTwoArray[0];
        maxX=mTmpTwoArray[0] + row.getWidth();
        maxY=row.getIntrinsicHeight();
        break;
      }
    }
    info.setTouchableInsets(ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_REGION);
    info.touchableRegion.set(minX,0,maxX,maxY);
  }
 else   if (mHeadsUpGoingAway || mWaitingOnCollapseWhenGoingAway) {
    info.setTouchableInsets(ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_REGION);
    info.touchableRegion.set(0,0,mStatusBarWindowView.getWidth(),mStatusBarHeight);
  }
}

Fixed version (ground truth):
public void onComputeInternalInsets(ViewTreeObserver.InternalInsetsInfo info){
  if (mIsExpanded) {
    return;
  }
  if (mHasPinnedNotification) {
    ExpandableNotificationRow topEntry=getTopEntry().entry.row;
    if (topEntry.isChildInGroup()) {
      final ExpandableNotificationRow groupSummary=mGroupManager.getGroupSummary(topEntry.getStatusBarNotification());
      if (groupSummary != null) {
        topEntry=groupSummary;
      }
    }
    topEntry.getLocationOnScreen(mTmpTwoArray);
    int minX=mTmpTwoArray[0];
    int maxX=mTmpTwoArray[0] + topEntry.getWidth();
    int maxY=topEntry.getIntrinsicHeight();
    info.setTouchableInsets(ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_REGION);
    info.touchableRegion.set(minX,0,maxX,maxY);
  }
 else   if (mHeadsUpGoingAway || mWaitingOnCollapseWhenGoingAway) {
    info.setTouchableInsets(ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_REGION);
    info.touchableRegion.set(0,0,mStatusBarWindowView.getWidth(),mStatusBarHeight);
  }
}
Program: 192727
Project: 192727
Buggy source:
@Override public void setFocusedStack(int stackId){
  if (DEBUG_FOCUS)   Slog.d(TAG_FOCUS,"String_Node_Str" + stackId);
synchronized (ActivityManagerService.this) {
    ActivityStack stack=mStackSupervisor.getStack(stackId);
    if (stack != null) {
      ActivityRecord r=stack.topRunningActivityLocked();
      if (r != null) {
        setFocusedActivityLocked(r,"String_Node_Str");
        mStackSupervisor.resumeFocusedStackTopActivityLocked();
      }
    }
  }
}

Fixed version (ground truth):
@Override public void setFocusedStack(int stackId){
  enforceCallingPermission(MANAGE_ACTIVITY_STACKS,"String_Node_Str");
  if (DEBUG_FOCUS)   Slog.d(TAG_FOCUS,"String_Node_Str" + stackId);
  final long callingId=Binder.clearCallingIdentity();
  try {
synchronized (this) {
      final ActivityStack stack=mStackSupervisor.getStack(stackId);
      if (stack == null) {
        return;
      }
      final ActivityRecord r=stack.topRunningActivityLocked();
      if (setFocusedActivityLocked(r,"String_Node_Str")) {
        mStackSupervisor.resumeFocusedStackTopActivityLocked();
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(callingId);
  }
}
Program: 192728
Project: 192728
Buggy source:
@Override public void setFocusedTask(int taskId){
  if (DEBUG_FOCUS)   Slog.d(TAG_FOCUS,"String_Node_Str" + taskId);
  long callingId=Binder.clearCallingIdentity();
  try {
synchronized (ActivityManagerService.this) {
      TaskRecord task=mStackSupervisor.anyTaskForIdLocked(taskId);
      if (task != null) {
        final ActivityRecord r=task.topRunningActivityLocked();
        if (setFocusedActivityLocked(r,"String_Node_Str")) {
          mStackSupervisor.resumeFocusedStackTopActivityLocked();
        }
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(callingId);
  }
}

Fixed version (ground truth):
@Override public void setFocusedTask(int taskId){
  enforceCallingPermission(MANAGE_ACTIVITY_STACKS,"String_Node_Str");
  if (DEBUG_FOCUS)   Slog.d(TAG_FOCUS,"String_Node_Str" + taskId);
  final long callingId=Binder.clearCallingIdentity();
  try {
synchronized (this) {
      final TaskRecord task=mStackSupervisor.anyTaskForIdLocked(taskId);
      if (task == null) {
        return;
      }
      final ActivityRecord r=task.topRunningActivityLocked();
      if (setFocusedActivityLocked(r,"String_Node_Str")) {
        mStackSupervisor.resumeFocusedStackTopActivityLocked();
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(callingId);
  }
}
Program: 192729
Project: 192729
Buggy source:
@Override public void setFocusedStack(int stackId){
  if (DEBUG_FOCUS)   Slog.d(TAG_FOCUS,"String_Node_Str" + stackId);
synchronized (ActivityManagerService.this) {
    ActivityStack stack=mStackSupervisor.getStack(stackId);
    if (stack != null) {
      ActivityRecord r=stack.topRunningActivityLocked();
      if (r != null) {
        setFocusedActivityLocked(r,"String_Node_Str");
        mStackSupervisor.resumeFocusedStackTopActivityLocked();
      }
    }
  }
}

Fixed version (ground truth):
@Override public void setFocusedStack(int stackId){
  enforceCallingPermission(MANAGE_ACTIVITY_STACKS,"String_Node_Str");
  if (DEBUG_FOCUS)   Slog.d(TAG_FOCUS,"String_Node_Str" + stackId);
  final long callingId=Binder.clearCallingIdentity();
  try {
synchronized (this) {
      final ActivityStack stack=mStackSupervisor.getStack(stackId);
      if (stack == null) {
        return;
      }
      final ActivityRecord r=stack.topRunningActivityLocked();
      if (setFocusedActivityLocked(r,"String_Node_Str")) {
        mStackSupervisor.resumeFocusedStackTopActivityLocked();
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(callingId);
  }
}
Program: 192730
Project: 192730
Buggy source:
@Override public void setFocusedTask(int taskId){
  if (DEBUG_FOCUS)   Slog.d(TAG_FOCUS,"String_Node_Str" + taskId);
  long callingId=Binder.clearCallingIdentity();
  try {
synchronized (ActivityManagerService.this) {
      TaskRecord task=mStackSupervisor.anyTaskForIdLocked(taskId);
      if (task != null) {
        final ActivityRecord r=task.topRunningActivityLocked();
        if (setFocusedActivityLocked(r,"String_Node_Str")) {
          mStackSupervisor.resumeFocusedStackTopActivityLocked();
        }
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(callingId);
  }
}

Fixed version (ground truth):
@Override public void setFocusedTask(int taskId){
  enforceCallingPermission(MANAGE_ACTIVITY_STACKS,"String_Node_Str");
  if (DEBUG_FOCUS)   Slog.d(TAG_FOCUS,"String_Node_Str" + taskId);
  final long callingId=Binder.clearCallingIdentity();
  try {
synchronized (this) {
      final TaskRecord task=mStackSupervisor.anyTaskForIdLocked(taskId);
      if (task == null) {
        return;
      }
      final ActivityRecord r=task.topRunningActivityLocked();
      if (setFocusedActivityLocked(r,"String_Node_Str")) {
        mStackSupervisor.resumeFocusedStackTopActivityLocked();
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(callingId);
  }
}
Program: 192731
Project: 192731
Buggy source:
@Override public void onAnimationUpdate(ValueAnimator animation){
  final float value=(Float)animation.getAnimatedValue();
  final float remains=1 - value;
  mTmpRect.left=(int)(mFrom.left * remains + mTo.left * value);
  mTmpRect.top=(int)(mFrom.top * remains + mTo.top * value);
  mTmpRect.right=(int)(mFrom.right * remains + mTo.right * value);
  mTmpRect.bottom=(int)(mFrom.bottom * remains + mTo.bottom * value);
  if (DEBUG_ANIM)   Slog.d(TAG,"String_Node_Str" + mTarget + "String_Node_Str"+ mTmpRect+ "String_Node_Str"+ mFrom+ "String_Node_Str"+ mTo+ "String_Node_Str"+ value+ "String_Node_Str"+ remains);
  if (!mTarget.setSize(mTmpRect)) {
    animation.cancel();
  }
}

Fixed version (ground truth):
@Override public void onAnimationUpdate(ValueAnimator animation){
  final float value=(Float)animation.getAnimatedValue();
  final float remains=1 - value;
  mTmpRect.left=(int)(mFrom.left * remains + mTo.left * value + 0.5f);
  mTmpRect.top=(int)(mFrom.top * remains + mTo.top * value + 0.5f);
  mTmpRect.right=(int)(mFrom.right * remains + mTo.right * value + 0.5f);
  mTmpRect.bottom=(int)(mFrom.bottom * remains + mTo.bottom * value + 0.5f);
  if (DEBUG_ANIM)   Slog.d(TAG,"String_Node_Str" + mTarget + "String_Node_Str"+ mTmpRect+ "String_Node_Str"+ mFrom+ "String_Node_Str"+ mTo+ "String_Node_Str"+ value+ "String_Node_Str"+ remains);
  if (!mTarget.setSize(mTmpRect)) {
    animation.cancel();
  }
}
Program: 192732
Project: 192732
Buggy source:
BoundsAnimator(AnimateBoundsUser target,Rect from,Rect to,boolean moveToFullScreen){
  super();
  mTarget=target;
  mFrom=from;
  mTo=to;
  mTmpRect=new Rect();
  mMoveToFullScreen=moveToFullScreen;
  addUpdateListener(this);
  addListener(this);
}

Fixed version (ground truth):
BoundsAnimator(AnimateBoundsUser target,Rect from,Rect to,boolean moveToFullScreen,boolean replacement){
  super();
  mTarget=target;
  mFrom=from;
  mTo=to;
  mTmpRect=new Rect();
  mMoveToFullScreen=moveToFullScreen;
  mReplacement=replacement;
  addUpdateListener(this);
  addListener(this);
}
Program: 192733
Project: 192733
Buggy source:
@Override public void onAnimationEnd(Animator animation){
  finishAnimation();
  if (mMoveToFullScreen) {
    mTarget.moveToFullscreen();
  }
}

Fixed version (ground truth):
/** 
 * Callback for the target to inform it that the animation has ended, so it can do some necessary cleanup.
 */
void onAnimationEnd();
Program: 192734
Project: 192734
Buggy source:
private void finishAnimation(){
  mTarget.finishBoundsAnimation();
  removeListener(this);
  removeUpdateListener(this);
  mRunningAnimations.remove(mTarget);
}

Fixed version (ground truth):
private void finishAnimation(){
  if (!mWillReplace) {
    mTarget.onAnimationEnd();
  }
  removeListener(this);
  removeUpdateListener(this);
  mRunningAnimations.remove(mTarget);
}
Program: 192735
Project: 192735
Buggy source:
void animateBounds(final AnimateBoundsUser target,Rect from,Rect to){
  boolean moveToFullscreen=false;
  if (to == null) {
    to=new Rect();
    target.getFullScreenBounds(to);
    moveToFullscreen=true;
  }
  final BoundsAnimator existing=mRunningAnimations.get(target);
  if (existing != null) {
    existing.cancel();
  }
  BoundsAnimator animator=new BoundsAnimator(target,from,to,moveToFullscreen);
  mRunningAnimations.put(target,animator);
  animator.setFloatValues(0f,1f);
  animator.setDuration(DEFAULT_APP_TRANSITION_DURATION);
  animator.setInterpolator(new LinearInterpolator());
  animator.start();
}

Fixed version (ground truth):
void animateBounds(final AnimateBoundsUser target,Rect from,Rect to){
  boolean moveToFullscreen=false;
  if (to == null) {
    to=new Rect();
    target.getFullScreenBounds(to);
    moveToFullscreen=true;
  }
  final BoundsAnimator existing=mRunningAnimations.get(target);
  final boolean replacing=existing != null;
  if (replacing) {
    existing.cancel();
  }
  final BoundsAnimator animator=new BoundsAnimator(target,from,to,moveToFullscreen,replacing);
  mRunningAnimations.put(target,animator);
  animator.setFloatValues(0f,1f);
  animator.setDuration(DEFAULT_APP_TRANSITION_DURATION * DEBUG_ANIMATION_SLOW_DOWN_FACTOR);
  animator.setInterpolator(new LinearInterpolator());
  animator.start();
}
Program: 192736
Project: 192736
Buggy source:
@Override public void onAnimationStart(Animator animation){
}

Fixed version (ground truth):
void onAnimationStart();
Program: 192737
Project: 192737
Buggy source:
boolean isDragResizing(){
  return mDragResizing;
}

Fixed version (ground truth):
boolean isDragResizing(){
  return mDragResizing || (mStack != null && mStack.isDragResizing());
}
Program: 192738
Project: 192738
Buggy source:
public void animateResizePinnedStack(final Rect bounds){
synchronized (mWindowMap) {
    final TaskStack stack=mStackIdToStack.get(PINNED_STACK_ID);
    if (stack == null) {
      Slog.w(TAG,"String_Node_Str" + PINNED_STACK_ID + "String_Node_Str");
      return;
    }
    final ArrayList<Task> tasks=stack.getTasks();
    if (tasks.isEmpty()) {
      Slog.w(TAG,"String_Node_Str");
      return;
    }
    final Task task=tasks.get(tasks.size() - 1);
    task.setDragResizing(true);
    final Rect originalBounds=new Rect();
    stack.getBounds(originalBounds);
    UiThread.getHandler().post(new Runnable(){
      @Override public void run(){
        mBoundsAnimationController.animateBounds(stack,originalBounds,bounds);
      }
    }
);
  }
}

Fixed version (ground truth):
public void animateResizePinnedStack(final Rect bounds){
synchronized (mWindowMap) {
    final TaskStack stack=mStackIdToStack.get(PINNED_STACK_ID);
    if (stack == null) {
      Slog.w(TAG,"String_Node_Str" + PINNED_STACK_ID + "String_Node_Str");
      return;
    }
    final Rect originalBounds=new Rect();
    stack.getBounds(originalBounds);
    UiThread.getHandler().post(new Runnable(){
      @Override public void run(){
        mBoundsAnimationController.animateBounds(stack,originalBounds,bounds);
      }
    }
);
  }
}
Program: 192739
Project: 192739
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: 192740
Project: 192740
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: 192743
Project: 192743
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: 192744
Project: 192744
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: 192745
Project: 192745
Buggy source:
public void startListening(){
  mListening=true;
  mContext.getContentResolver().registerContentObserver(Settings.System.getUriFor(SHOW_PERCENT_SETTING),false,mSettingObserver);
  if (mDemoMode)   return;
  mBatteryController.addStateChangedCallback(this);
}

Fixed version (ground truth):
public void startListening(){
  mListening=true;
  mContext.getContentResolver().registerContentObserver(Settings.System.getUriFor(SHOW_PERCENT_SETTING),false,mSettingObserver);
  updateShowPercent();
  if (mDemoMode)   return;
  mBatteryController.addStateChangedCallback(this);
}
Program: 192746
Project: 192746
Buggy source:
private void bindView(){
  mDrawable.onBatteryLevelChanged(100,false,false);
  mDrawable.onPowerSaveChanged(true);
  ((ImageView)mCurrentView.findViewById(android.R.id.icon)).setImageDrawable(mDrawable);
  Checkable checkbox=(Checkable)mCurrentView.findViewById(android.R.id.toggle);
  checkbox.setChecked(mPowerSave);
  if (mCharging) {
    BatteryInfo.getBatteryInfo(mContext,new BatteryInfo.Callback(){
      @Override public void onBatteryInfoLoaded(      BatteryInfo info){
        if (mCurrentView != null && mCharging) {
          ((TextView)mCurrentView.findViewById(android.R.id.title)).setText(info.mChargeLabelString);
        }
      }
    }
);
    ((TextView)mCurrentView.findViewById(android.R.id.summary)).setText(R.string.battery_detail_charging_summary);
    mCurrentView.setClickable(false);
    mCurrentView.findViewById(android.R.id.icon).setVisibility(View.INVISIBLE);
    mCurrentView.findViewById(android.R.id.toggle).setVisibility(View.INVISIBLE);
  }
 else {
    ((TextView)mCurrentView.findViewById(android.R.id.title)).setText(R.string.battery_detail_switch_title);
    ((TextView)mCurrentView.findViewById(android.R.id.summary)).setText(R.string.battery_detail_switch_summary);
    mCurrentView.setClickable(true);
    mCurrentView.findViewById(android.R.id.icon).setVisibility(View.VISIBLE);
    mCurrentView.findViewById(android.R.id.toggle).setVisibility(View.VISIBLE);
    mCurrentView.setOnClickListener(this);
  }
}

Fixed version (ground truth):
private void bindView(){
  mDrawable.onBatteryLevelChanged(100,false,false);
  mDrawable.onPowerSaveChanged(true);
  mDrawable.disableShowPercent();
  ((ImageView)mCurrentView.findViewById(android.R.id.icon)).setImageDrawable(mDrawable);
  Checkable checkbox=(Checkable)mCurrentView.findViewById(android.R.id.toggle);
  checkbox.setChecked(mPowerSave);
  if (mCharging) {
    BatteryInfo.getBatteryInfo(mContext,new BatteryInfo.Callback(){
      @Override public void onBatteryInfoLoaded(      BatteryInfo info){
        if (mCurrentView != null && mCharging) {
          ((TextView)mCurrentView.findViewById(android.R.id.title)).setText(info.mChargeLabelString);
        }
      }
    }
);
    ((TextView)mCurrentView.findViewById(android.R.id.summary)).setText(R.string.battery_detail_charging_summary);
    mCurrentView.setClickable(false);
    mCurrentView.findViewById(android.R.id.icon).setVisibility(View.INVISIBLE);
    mCurrentView.findViewById(android.R.id.toggle).setVisibility(View.INVISIBLE);
  }
 else {
    ((TextView)mCurrentView.findViewById(android.R.id.title)).setText(R.string.battery_detail_switch_title);
    ((TextView)mCurrentView.findViewById(android.R.id.summary)).setText(R.string.battery_detail_switch_summary);
    mCurrentView.setClickable(true);
    mCurrentView.findViewById(android.R.id.icon).setVisibility(View.VISIBLE);
    mCurrentView.findViewById(android.R.id.toggle).setVisibility(View.VISIBLE);
    mCurrentView.setOnClickListener(this);
  }
}
Program: 192747
Project: 192747
Buggy source:
@Override public void onServiceConnected(int profile,BluetoothProfile proxy){
  ((BluetoothPan)proxy).setBluetoothTethering(enable);
  int result=((BluetoothPan)proxy).isTetheringOn() ? ConnectivityManager.TETHER_ERROR_NO_ERROR : ConnectivityManager.TETHER_ERROR_MASTER_ERROR;
  sendTetherResult(receiver,result);
  if (enable && isTetherProvisioningRequired()) {
    scheduleProvisioningRechecks(ConnectivityManager.TETHERING_BLUETOOTH);
  }
  adapter.closeProfileProxy(BluetoothProfile.PAN,proxy);
}

Fixed version (ground truth):
@Override public void onServiceConnected(int profile,BluetoothProfile proxy){
  ((BluetoothPan)proxy).setBluetoothTethering(enable);
  int result=((BluetoothPan)proxy).isTetheringOn() == enable ? ConnectivityManager.TETHER_ERROR_NO_ERROR : ConnectivityManager.TETHER_ERROR_MASTER_ERROR;
  sendTetherResult(receiver,result);
  if (enable && isTetherProvisioningRequired()) {
    scheduleProvisioningRechecks(ConnectivityManager.TETHERING_BLUETOOTH);
  }
  adapter.closeProfileProxy(BluetoothProfile.PAN,proxy);
}
Program: 192748
Project: 192748
Buggy source:
private void setBluetoothTethering(final boolean enable,final ResultReceiver receiver){
  final BluetoothAdapter adapter=BluetoothAdapter.getDefaultAdapter();
  if (adapter == null || !adapter.isEnabled()) {
    Log.w(TAG,"String_Node_Str" + (adapter == null));
    sendTetherResult(receiver,ConnectivityManager.TETHER_ERROR_SERVICE_UNAVAIL);
    return;
  }
  adapter.getProfileProxy(mContext,new ServiceListener(){
    @Override public void onServiceDisconnected(    int profile){
    }
    @Override public void onServiceConnected(    int profile,    BluetoothProfile proxy){
      ((BluetoothPan)proxy).setBluetoothTethering(enable);
      int result=((BluetoothPan)proxy).isTetheringOn() ? ConnectivityManager.TETHER_ERROR_NO_ERROR : ConnectivityManager.TETHER_ERROR_MASTER_ERROR;
      sendTetherResult(receiver,result);
      if (enable && isTetherProvisioningRequired()) {
        scheduleProvisioningRechecks(ConnectivityManager.TETHERING_BLUETOOTH);
      }
      adapter.closeProfileProxy(BluetoothProfile.PAN,proxy);
    }
  }
,BluetoothProfile.PAN);
}

Fixed version (ground truth):
private void setBluetoothTethering(final boolean enable,final ResultReceiver receiver){
  final BluetoothAdapter adapter=BluetoothAdapter.getDefaultAdapter();
  if (adapter == null || !adapter.isEnabled()) {
    Log.w(TAG,"String_Node_Str" + (adapter == null));
    sendTetherResult(receiver,ConnectivityManager.TETHER_ERROR_SERVICE_UNAVAIL);
    return;
  }
  adapter.getProfileProxy(mContext,new ServiceListener(){
    @Override public void onServiceDisconnected(    int profile){
    }
    @Override public void onServiceConnected(    int profile,    BluetoothProfile proxy){
      ((BluetoothPan)proxy).setBluetoothTethering(enable);
      int result=((BluetoothPan)proxy).isTetheringOn() == enable ? ConnectivityManager.TETHER_ERROR_NO_ERROR : ConnectivityManager.TETHER_ERROR_MASTER_ERROR;
      sendTetherResult(receiver,result);
      if (enable && isTetherProvisioningRequired()) {
        scheduleProvisioningRechecks(ConnectivityManager.TETHERING_BLUETOOTH);
      }
      adapter.closeProfileProxy(BluetoothProfile.PAN,proxy);
    }
  }
,BluetoothProfile.PAN);
}
Program: 192749
Project: 192749
Buggy source:
public void startListening(){
  mListening=true;
  mContext.getContentResolver().registerContentObserver(Settings.System.getUriFor(SHOW_PERCENT_SETTING),false,mSettingObserver);
  if (mDemoMode)   return;
  mBatteryController.addStateChangedCallback(this);
}

Fixed version (ground truth):
public void startListening(){
  mListening=true;
  mContext.getContentResolver().registerContentObserver(Settings.System.getUriFor(SHOW_PERCENT_SETTING),false,mSettingObserver);
  updateShowPercent();
  if (mDemoMode)   return;
  mBatteryController.addStateChangedCallback(this);
}
Program: 192750
Project: 192750
Buggy source:
private void bindView(){
  mDrawable.onBatteryLevelChanged(100,false,false);
  mDrawable.onPowerSaveChanged(true);
  ((ImageView)mCurrentView.findViewById(android.R.id.icon)).setImageDrawable(mDrawable);
  Checkable checkbox=(Checkable)mCurrentView.findViewById(android.R.id.toggle);
  checkbox.setChecked(mPowerSave);
  if (mCharging) {
    BatteryInfo.getBatteryInfo(mContext,new BatteryInfo.Callback(){
      @Override public void onBatteryInfoLoaded(      BatteryInfo info){
        if (mCurrentView != null && mCharging) {
          ((TextView)mCurrentView.findViewById(android.R.id.title)).setText(info.mChargeLabelString);
        }
      }
    }
);
    ((TextView)mCurrentView.findViewById(android.R.id.summary)).setText(R.string.battery_detail_charging_summary);
    mCurrentView.setClickable(false);
    mCurrentView.findViewById(android.R.id.icon).setVisibility(View.INVISIBLE);
    mCurrentView.findViewById(android.R.id.toggle).setVisibility(View.INVISIBLE);
  }
 else {
    ((TextView)mCurrentView.findViewById(android.R.id.title)).setText(R.string.battery_detail_switch_title);
    ((TextView)mCurrentView.findViewById(android.R.id.summary)).setText(R.string.battery_detail_switch_summary);
    mCurrentView.setClickable(true);
    mCurrentView.findViewById(android.R.id.icon).setVisibility(View.VISIBLE);
    mCurrentView.findViewById(android.R.id.toggle).setVisibility(View.VISIBLE);
    mCurrentView.setOnClickListener(this);
  }
}

Fixed version (ground truth):
private void bindView(){
  mDrawable.onBatteryLevelChanged(100,false,false);
  mDrawable.onPowerSaveChanged(true);
  mDrawable.disableShowPercent();
  ((ImageView)mCurrentView.findViewById(android.R.id.icon)).setImageDrawable(mDrawable);
  Checkable checkbox=(Checkable)mCurrentView.findViewById(android.R.id.toggle);
  checkbox.setChecked(mPowerSave);
  if (mCharging) {
    BatteryInfo.getBatteryInfo(mContext,new BatteryInfo.Callback(){
      @Override public void onBatteryInfoLoaded(      BatteryInfo info){
        if (mCurrentView != null && mCharging) {
          ((TextView)mCurrentView.findViewById(android.R.id.title)).setText(info.mChargeLabelString);
        }
      }
    }
);
    ((TextView)mCurrentView.findViewById(android.R.id.summary)).setText(R.string.battery_detail_charging_summary);
    mCurrentView.setClickable(false);
    mCurrentView.findViewById(android.R.id.icon).setVisibility(View.INVISIBLE);
    mCurrentView.findViewById(android.R.id.toggle).setVisibility(View.INVISIBLE);
  }
 else {
    ((TextView)mCurrentView.findViewById(android.R.id.title)).setText(R.string.battery_detail_switch_title);
    ((TextView)mCurrentView.findViewById(android.R.id.summary)).setText(R.string.battery_detail_switch_summary);
    mCurrentView.setClickable(true);
    mCurrentView.findViewById(android.R.id.icon).setVisibility(View.VISIBLE);
    mCurrentView.findViewById(android.R.id.toggle).setVisibility(View.VISIBLE);
    mCurrentView.setOnClickListener(this);
  }
}
Program: 192751
Project: 192751
Buggy source:
@Override public void onServiceConnected(int profile,BluetoothProfile proxy){
  ((BluetoothPan)proxy).setBluetoothTethering(enable);
  int result=((BluetoothPan)proxy).isTetheringOn() ? ConnectivityManager.TETHER_ERROR_NO_ERROR : ConnectivityManager.TETHER_ERROR_MASTER_ERROR;
  sendTetherResult(receiver,result);
  if (enable && isTetherProvisioningRequired()) {
    scheduleProvisioningRechecks(ConnectivityManager.TETHERING_BLUETOOTH);
  }
  adapter.closeProfileProxy(BluetoothProfile.PAN,proxy);
}

Fixed version (ground truth):
@Override public void onServiceConnected(int profile,BluetoothProfile proxy){
  ((BluetoothPan)proxy).setBluetoothTethering(enable);
  int result=((BluetoothPan)proxy).isTetheringOn() == enable ? ConnectivityManager.TETHER_ERROR_NO_ERROR : ConnectivityManager.TETHER_ERROR_MASTER_ERROR;
  sendTetherResult(receiver,result);
  if (enable && isTetherProvisioningRequired()) {
    scheduleProvisioningRechecks(ConnectivityManager.TETHERING_BLUETOOTH);
  }
  adapter.closeProfileProxy(BluetoothProfile.PAN,proxy);
}
Program: 192752
Project: 192752
Buggy source:
private void setBluetoothTethering(final boolean enable,final ResultReceiver receiver){
  final BluetoothAdapter adapter=BluetoothAdapter.getDefaultAdapter();
  if (adapter == null || !adapter.isEnabled()) {
    Log.w(TAG,"String_Node_Str" + (adapter == null));
    sendTetherResult(receiver,ConnectivityManager.TETHER_ERROR_SERVICE_UNAVAIL);
    return;
  }
  adapter.getProfileProxy(mContext,new ServiceListener(){
    @Override public void onServiceDisconnected(    int profile){
    }
    @Override public void onServiceConnected(    int profile,    BluetoothProfile proxy){
      ((BluetoothPan)proxy).setBluetoothTethering(enable);
      int result=((BluetoothPan)proxy).isTetheringOn() ? ConnectivityManager.TETHER_ERROR_NO_ERROR : ConnectivityManager.TETHER_ERROR_MASTER_ERROR;
      sendTetherResult(receiver,result);
      if (enable && isTetherProvisioningRequired()) {
        scheduleProvisioningRechecks(ConnectivityManager.TETHERING_BLUETOOTH);
      }
      adapter.closeProfileProxy(BluetoothProfile.PAN,proxy);
    }
  }
,BluetoothProfile.PAN);
}

Fixed version (ground truth):
private void setBluetoothTethering(final boolean enable,final ResultReceiver receiver){
  final BluetoothAdapter adapter=BluetoothAdapter.getDefaultAdapter();
  if (adapter == null || !adapter.isEnabled()) {
    Log.w(TAG,"String_Node_Str" + (adapter == null));
    sendTetherResult(receiver,ConnectivityManager.TETHER_ERROR_SERVICE_UNAVAIL);
    return;
  }
  adapter.getProfileProxy(mContext,new ServiceListener(){
    @Override public void onServiceDisconnected(    int profile){
    }
    @Override public void onServiceConnected(    int profile,    BluetoothProfile proxy){
      ((BluetoothPan)proxy).setBluetoothTethering(enable);
      int result=((BluetoothPan)proxy).isTetheringOn() == enable ? ConnectivityManager.TETHER_ERROR_NO_ERROR : ConnectivityManager.TETHER_ERROR_MASTER_ERROR;
      sendTetherResult(receiver,result);
      if (enable && isTetherProvisioningRequired()) {
        scheduleProvisioningRechecks(ConnectivityManager.TETHERING_BLUETOOTH);
      }
      adapter.closeProfileProxy(BluetoothProfile.PAN,proxy);
    }
  }
,BluetoothProfile.PAN);
}
Program: 192753
Project: 192753
Buggy source:
@Override public void onViewRecycled(ViewHolder holder){
  RecentsTaskLoader loader=Recents.getTaskLoader();
  int position=holder.getAdapterPosition();
  if (position != RecyclerView.NO_POSITION) {
    Row row=mRows.get(position);
    int viewType=row.getViewType();
    if (viewType == TASK_ROW_VIEW_TYPE) {
      TaskRow taskRow=(TaskRow)row;
      loader.unloadTaskData(taskRow.task);
      taskRow.task.removeCallback(holder);
    }
  }
}

Fixed version (ground truth):
@Override public void onViewRecycled(ViewHolder holder){
  RecentsTaskLoader loader=Recents.getTaskLoader();
  int position=holder.getAdapterPosition();
  if (position != RecyclerView.NO_POSITION) {
    Row row=mRows.get(position);
    int viewType=row.getViewType();
    if (viewType == TASK_ROW_VIEW_TYPE) {
      TaskRow taskRow=(TaskRow)row;
      loader.unloadTaskData(taskRow.task);
      holder.unbindFromTask();
    }
  }
}
Program: 192754
Project: 192754
Buggy source:
@Override public void onBindViewHolder(ViewHolder holder,int position){
  RecentsTaskLoader loader=Recents.getTaskLoader();
  Row row=mRows.get(position);
  int viewType=row.getViewType();
switch (viewType) {
case DATE_ROW_VIEW_TYPE:
{
      TextView tv=(TextView)holder.content;
      tv.setText(((DateRow)row).date);
      break;
    }
case TASK_ROW_VIEW_TYPE:
{
    TaskRow taskRow=(TaskRow)row;
    taskRow.task.addCallback(holder);
    TextView tv=(TextView)holder.content.findViewById(R.id.description);
    tv.setText(taskRow.task.title);
    ImageView iv=(ImageView)holder.content.findViewById(R.id.icon);
    iv.setAlpha(0f);
    holder.content.setOnClickListener(taskRow);
    loader.loadTaskData(taskRow.task,false);
    break;
  }
}
}

Fixed version (ground truth):
@Override public void onBindViewHolder(ViewHolder holder,int position){
  RecentsTaskLoader loader=Recents.getTaskLoader();
  Row row=mRows.get(position);
  int viewType=row.getViewType();
switch (viewType) {
case DATE_ROW_VIEW_TYPE:
{
      TextView tv=(TextView)holder.content;
      tv.setText(((DateRow)row).date);
      break;
    }
case TASK_ROW_VIEW_TYPE:
{
    TaskRow taskRow=(TaskRow)row;
    TextView tv=(TextView)holder.content.findViewById(R.id.description);
    tv.setText(taskRow.task.title);
    ImageView iv=(ImageView)holder.content.findViewById(R.id.icon);
    iv.setAlpha(0f);
    holder.content.setOnClickListener(taskRow);
    holder.bindToTask(taskRow.task);
    loader.loadTaskData(taskRow.task,false);
    break;
  }
}
}
Program: 192755
Project: 192755
Buggy source:
public ViewHolder(View v){
  super(v);
  content=v;
}

Fixed version (ground truth):
public ViewHolder(View content){
  super(content);
  this.content=content;
}
Program: 192757
Project: 192757
Buggy source:
/** 
 * Updates the current transforms that would put a TaskView at the front and back of the stack.
 */
private void updateFrontBackTransforms(){
  if (mStackRect.isEmpty()) {
    return;
  }
  float min=mUnfocusedRange.relativeMin + mFocusState * (mFocusedRange.relativeMin - mUnfocusedRange.relativeMin);
  float max=mUnfocusedRange.relativeMax + mFocusState * (mFocusedRange.relativeMax - mUnfocusedRange.relativeMax);
  getStackTransform(min,0f,mBackOfStackTransform,null,true);
  getStackTransform(max,0f,mFrontOfStackTransform,null,true);
  mBackOfStackTransform.visible=true;
  mFrontOfStackTransform.visible=true;
}

Fixed version (ground truth):
/** 
 * Updates the current transforms that would put a TaskView at the front and back of the stack.
 */
private void updateFrontBackTransforms(){
  if (mStackRect.isEmpty()) {
    return;
  }
  float min=mUnfocusedRange.relativeMin + mFocusState * (mFocusedRange.relativeMin - mUnfocusedRange.relativeMin);
  float max=mUnfocusedRange.relativeMax + mFocusState * (mFocusedRange.relativeMax - mUnfocusedRange.relativeMax);
  getStackTransform(min,0f,mBackOfStackTransform,null,true,true);
  getStackTransform(max,0f,mFrontOfStackTransform,null,true,true);
  mBackOfStackTransform.visible=true;
  mFrontOfStackTransform.visible=true;
}
Program: 192759
Project: 192759
Buggy source:
/** 
 * Returns the current task transforms of all tasks, falling back to the stack layout if there is no   {@link TaskView} for the task.
 */
public void getCurrentTaskTransforms(ArrayList<Task> tasks,ArrayList<TaskViewTransform> transformsOut){
  Utilities.matchTaskListSize(tasks,transformsOut);
  for (int i=tasks.size() - 1; i >= 0; i--) {
    Task task=tasks.get(i);
    TaskViewTransform transform=transformsOut.get(i);
    TaskView tv=getChildViewForTask(task);
    if (tv != null) {
      transform.fillIn(tv);
    }
 else {
      mLayoutAlgorithm.getStackTransform(task,mStackScroller.getStackScroll(),transform,null);
    }
    transform.visible=true;
  }
}

Fixed version (ground truth):
/** 
 * Returns the current task transforms of all tasks, falling back to the stack layout if there is no   {@link TaskView} for the task.
 */
public void getCurrentTaskTransforms(ArrayList<Task> tasks,ArrayList<TaskViewTransform> transformsOut){
  Utilities.matchTaskListSize(tasks,transformsOut);
  for (int i=tasks.size() - 1; i >= 0; i--) {
    Task task=tasks.get(i);
    TaskViewTransform transform=transformsOut.get(i);
    TaskView tv=getChildViewForTask(task);
    if (tv != null) {
      transform.fillIn(tv);
    }
 else {
      mLayoutAlgorithm.getStackTransform(task,mStackScroller.getStackScroll(),transform,null,true);
    }
    transform.visible=true;
  }
}
Program: 192760
Project: 192760
Buggy source:
/** 
 * Called after the   {@link TaskView} is finished animating back into the list.onChildDismissed() calls.
 */
@Override public void onChildSnappedBack(View v){
  TaskView tv=(TaskView)v;
  tv.setClipViewInStack(true);
  tv.setTouchEnabled(true);
  mSv.removeIgnoreTask(tv.getTask());
  mSv.updateLayoutAlgorithm(false);
  mSwipeHelperAnimations.remove(v);
}

Fixed version (ground truth):
/** 
 * Called after the   {@link TaskView} is finished animating back into the list.onChildDismissed() calls.
 */
@Override public void onChildSnappedBack(View v){
  TaskView tv=(TaskView)v;
  tv.setClipViewInStack(true);
  tv.setTouchEnabled(true);
  mSv.removeIgnoreTask(tv.getTask());
  mSv.updateLayoutAlgorithm(false);
  mSv.relayoutTaskViews(AnimationProps.IMMEDIATE);
  mSwipeHelperAnimations.remove(v);
}
Program: 192762
Project: 192762
Buggy source:
/** 
 * Start a drag resizing which will inform all listeners that a window resize is taking place.
 */
private void startDragResizing(Rect initialBounds){
  if (!mDragResizing) {
    mDragResizing=true;
synchronized (mWindowCallbacks) {
      for (int i=mWindowCallbacks.size() - 1; i >= 0; i--) {
        mWindowCallbacks.get(i).onWindowDragResizeStart(initialBounds);
      }
    }
    mFullRedrawNeeded=true;
  }
}

Fixed version (ground truth):
/** 
 * Start a drag resizing which will inform all listeners that a window resize is taking place.
 */
private void startDragResizing(Rect initialBounds,boolean fullscreen,Rect systemInsets,Rect stableInsets){
  if (!mDragResizing) {
    mDragResizing=true;
synchronized (mWindowCallbacks) {
      for (int i=mWindowCallbacks.size() - 1; i >= 0; i--) {
        mWindowCallbacks.get(i).onWindowDragResizeStart(initialBounds,fullscreen,systemInsets,stableInsets);
      }
    }
    mFullRedrawNeeded=true;
  }
}
Program: 192764
Project: 192764
Buggy source:
/** 
 * Called by the system when the window got changed by the user, before the layouter got called. It can be used to perform a "quick and dirty" resize which should never take more then 4ms to complete. <p>At the time the layouting has not happened yet.
 * @param newBounds The new window frame bounds.
 */
void onWindowSizeIsChanging(Rect newBounds);

Fixed version (ground truth):
/** 
 * Called by the system when the window got changed by the user, before the layouter got called. It also gets called when the insets changed, or when the window switched between a fullscreen layout or a non-fullscreen layout. It can be used to perform a "quick and dirty" resize which should never take more then 4ms to complete. <p>At the time the layouting has not happened yet.
 * @param newBounds The new window frame 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.
 */
void onWindowSizeIsChanging(Rect newBounds,boolean fullscreen,Rect systemInsets,Rect stableInsets);
Program: 192765
Project: 192765
Buggy source:
/** 
 * Called when a drag resize starts.
 * @param initialBounds The initial bounds where the window will be.
 */
void onWindowDragResizeStart(Rect initialBounds);

Fixed version (ground truth):
/** 
 * Called when a drag resize starts.
 * @param initialBounds The initial bounds where the window will be.
 * @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.
 */
void onWindowDragResizeStart(Rect initialBounds,boolean fullscreen,Rect systemInsets,Rect stableInsets);