nus-yam/ex-repair huggingface dataset:
Program: 193211
Project: 193211
Buggy source:
VoiceInteractionManagerServiceImpl(Context context,Handler handler,Object lock,int userHandle,ComponentName service){
  mContext=context;
  mHandler=handler;
  mLock=lock;
  mUser=userHandle;
  mComponent=service;
  mAm=ActivityManagerNative.getDefault();
  VoiceInteractionServiceInfo info;
  try {
    info=new VoiceInteractionServiceInfo(context.getPackageManager(),service,mUser);
  }
 catch (  RemoteException|PackageManager.NameNotFoundException e) {
    Slog.w(TAG,"String_Node_Str" + service,e);
    mInfo=null;
    mSessionComponentName=null;
    mIWindowManager=null;
    mValid=false;
    return;
  }
  mInfo=info;
  if (mInfo.getParseError() != null) {
    Slog.w(TAG,"String_Node_Str" + mInfo.getParseError());
    mSessionComponentName=null;
    mIWindowManager=null;
    mValid=false;
    return;
  }
  mValid=true;
  mSessionComponentName=new ComponentName(service.getPackageName(),mInfo.getSessionService());
  mIWindowManager=IWindowManager.Stub.asInterface(ServiceManager.getService(Context.WINDOW_SERVICE));
  IntentFilter filter=new IntentFilter();
  filter.addAction(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
  mContext.registerReceiver(mBroadcastReceiver,filter,null,handler);
}

Fixed version (ground truth):
VoiceInteractionManagerServiceImpl(Context context,Handler handler,Object lock,int userHandle,ComponentName service){
  mContext=context;
  mHandler=handler;
  mLock=lock;
  mUser=userHandle;
  mComponent=service;
  mAm=ActivityManagerNative.getDefault();
  VoiceInteractionServiceInfo info;
  try {
    info=new VoiceInteractionServiceInfo(context.getPackageManager(),service,mUser);
  }
 catch (  PackageManager.NameNotFoundException e) {
    Slog.w(TAG,"String_Node_Str" + service,e);
    mInfo=null;
    mSessionComponentName=null;
    mIWindowManager=null;
    mValid=false;
    return;
  }
  mInfo=info;
  if (mInfo.getParseError() != null) {
    Slog.w(TAG,"String_Node_Str" + mInfo.getParseError());
    mSessionComponentName=null;
    mIWindowManager=null;
    mValid=false;
    return;
  }
  mValid=true;
  mSessionComponentName=new ComponentName(service.getPackageName(),mInfo.getSessionService());
  mIWindowManager=IWindowManager.Stub.asInterface(ServiceManager.getService(Context.WINDOW_SERVICE));
  IntentFilter filter=new IntentFilter();
  filter.addAction(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
  mContext.registerReceiver(mBroadcastReceiver,filter,null,handler);
}
Program: 193212
Project: 193212
Buggy source:
/** 
 * Returns the task stack bounds in the current orientation. These bounds do not account for the system insets.
 */
public void getTaskStackBounds(Rect windowBounds,int topInset,int rightInset,Rect searchBarBounds,Rect taskStackBounds){
  if (hasTransposedNavBar) {
    int swInset=getInsetToSmallestWidth(windowBounds.right - rightInset - windowBounds.left);
    taskStackBounds.set(windowBounds.left + swInset,windowBounds.top + topInset,windowBounds.right - swInset - rightInset,windowBounds.bottom);
  }
 else {
    int swInset=getInsetToSmallestWidth(windowBounds.right - windowBounds.left);
    int top=searchBarBounds.isEmpty() ? topInset : 0;
    taskStackBounds.set(windowBounds.left + swInset,searchBarBounds.bottom + top,windowBounds.right - swInset,windowBounds.bottom);
  }
}

Fixed version (ground truth):
/** 
 * Returns the task stack bounds in the current orientation. These bounds do not account for the system insets.
 */
public void getTaskStackBounds(Rect windowBounds,int topInset,int rightInset,Rect searchBarBounds,Rect taskStackBounds){
  if (hasTransposedNavBar) {
    int swInset=getInsetToSmallestWidth(windowBounds.right - rightInset - windowBounds.left);
    taskStackBounds.set(windowBounds.left + swInset,windowBounds.top + topInset,windowBounds.right - swInset - rightInset,windowBounds.bottom);
  }
 else {
    int swInset=getInsetToSmallestWidth(windowBounds.right - windowBounds.left);
    int top=searchBarBounds.isEmpty() ? topInset : 0;
    taskStackBounds.set(windowBounds.left + swInset,searchBarBounds.bottom + top,windowBounds.right - swInset - rightInset,windowBounds.bottom);
  }
}
Program: 193214
Project: 193214
Buggy source:
/** 
 * This is called with the size of the space not including the top or right insets, or the search bar height in portrait (but including the search bar width in landscape, since we want to draw under it.
 */
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  List<TaskView> taskViews=getTaskViews();
  int taskViewCount=taskViews.size();
  for (int i=0; i < taskViewCount; i++) {
    TaskView tv=taskViews.get(i);
    if (tv.getBackground() != null) {
      tv.getBackground().getPadding(mTmpRect);
    }
 else {
      mTmpRect.setEmpty();
    }
    Rect taskRect=mLayoutAlgorithm.mTaskRect;
    tv.layout(taskRect.left - mTmpRect.left,taskRect.top - mTmpRect.top,taskRect.right + mTmpRect.right,taskRect.bottom + mTmpRect.bottom);
  }
  if (mAwaitingFirstLayout) {
    mAwaitingFirstLayout=false;
    onFirstLayout();
  }
  if (changed) {
    requestSynchronizeStackViewsWithModel();
    synchronizeStackViewsWithModel();
    clipTaskViews(true);
  }
}

Fixed version (ground truth):
/** 
 * This is called with the size of the space not including the top or right insets, or the search bar height in portrait (but including the search bar width in landscape, since we want to draw under it.
 */
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  mTmpTaskViews.clear();
  mTmpTaskViews.addAll(getTaskViews());
  mTmpTaskViews.addAll(mViewPool.getViews());
  int taskViewCount=mTmpTaskViews.size();
  for (int i=0; i < taskViewCount; i++) {
    TaskView tv=mTmpTaskViews.get(i);
    if (tv.getBackground() != null) {
      tv.getBackground().getPadding(mTmpRect);
    }
 else {
      mTmpRect.setEmpty();
    }
    Rect taskRect=mLayoutAlgorithm.mTaskRect;
    tv.layout(taskRect.left - mTmpRect.left,taskRect.top - mTmpRect.top,taskRect.right + mTmpRect.right,taskRect.bottom + mTmpRect.bottom);
  }
  if (mAwaitingFirstLayout) {
    mAwaitingFirstLayout=false;
    onFirstLayout();
  }
  if (changed) {
    if (mStackScroller.isScrollOutOfBounds()) {
      mStackScroller.boundScroll();
    }
    requestSynchronizeStackViewsWithModel();
    synchronizeStackViewsWithModel();
    clipTaskViews(true);
  }
}
Program: 193215
Project: 193215
Buggy source:
/** 
 * Resets this TaskStackView for reuse. 
 */
void reset(){
  resetFocusedTask();
  List<TaskView> taskViews=getTaskViews();
  int taskViewCount=taskViews.size();
  for (int i=taskViewCount - 1; i >= 0; i--) {
    mViewPool.returnViewToPool(taskViews.get(i));
  }
  if (mViewPool != null) {
    Iterator<TaskView> iter=mViewPool.poolViewIterator();
    if (iter != null) {
      while (iter.hasNext()) {
        TaskView tv=iter.next();
        tv.reset();
      }
    }
  }
  mStack.reset();
  mStackViewsDirty=true;
  mStackViewsClipDirty=true;
  mAwaitingFirstLayout=true;
  if (mUIDozeTrigger != null) {
    mUIDozeTrigger.stopDozing();
    mUIDozeTrigger.resetTrigger();
  }
  mStackScroller.reset();
}

Fixed version (ground truth):
/** 
 * Resets this TaskStackView for reuse. 
 */
void reset(){
  resetFocusedTask();
  List<TaskView> taskViews=getTaskViews();
  int taskViewCount=taskViews.size();
  for (int i=taskViewCount - 1; i >= 0; i--) {
    mViewPool.returnViewToPool(taskViews.get(i));
  }
  List<TaskView> poolViews=mViewPool.getViews();
  for (  TaskView tv : poolViews) {
    tv.reset();
  }
  mStack.reset();
  mStackViewsDirty=true;
  mStackViewsClipDirty=true;
  mAwaitingFirstLayout=true;
  if (mUIDozeTrigger != null) {
    mUIDozeTrigger.stopDozing();
    mUIDozeTrigger.resetTrigger();
  }
  mStackScroller.reset();
}
Program: 193216
Project: 193216
Buggy source:
/** 
 * This is called with the full window width and height to allow stack view children to perform the full screen transition down.
 */
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  int width=MeasureSpec.getSize(widthMeasureSpec);
  int height=MeasureSpec.getSize(heightMeasureSpec);
  computeRects(mTaskStackBounds);
  if (mAwaitingFirstLayout) {
    mStackScroller.setStackScrollToInitialState();
    requestSynchronizeStackViewsWithModel();
    synchronizeStackViewsWithModel();
  }
  List<TaskView> taskViews=getTaskViews();
  int taskViewCount=taskViews.size();
  for (int i=0; i < taskViewCount; i++) {
    TaskView tv=taskViews.get(i);
    if (tv.getBackground() != null) {
      tv.getBackground().getPadding(mTmpRect);
    }
 else {
      mTmpRect.setEmpty();
    }
    tv.measure(MeasureSpec.makeMeasureSpec(mLayoutAlgorithm.mTaskRect.width() + mTmpRect.left + mTmpRect.right,MeasureSpec.EXACTLY),MeasureSpec.makeMeasureSpec(mLayoutAlgorithm.mTaskRect.height() + mTmpRect.top + mTmpRect.bottom,MeasureSpec.EXACTLY));
  }
  setMeasuredDimension(width,height);
}

Fixed version (ground truth):
/** 
 * This is called with the full window width and height to allow stack view children to perform the full screen transition down.
 */
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  int width=MeasureSpec.getSize(widthMeasureSpec);
  int height=MeasureSpec.getSize(heightMeasureSpec);
  computeRects(mTaskStackBounds);
  if (mAwaitingFirstLayout) {
    mStackScroller.setStackScrollToInitialState();
    requestSynchronizeStackViewsWithModel();
    synchronizeStackViewsWithModel();
  }
  mTmpTaskViews.clear();
  mTmpTaskViews.addAll(getTaskViews());
  mTmpTaskViews.addAll(mViewPool.getViews());
  int taskViewCount=mTmpTaskViews.size();
  for (int i=0; i < taskViewCount; i++) {
    TaskView tv=mTmpTaskViews.get(i);
    if (tv.getBackground() != null) {
      tv.getBackground().getPadding(mTmpRect);
    }
 else {
      mTmpRect.setEmpty();
    }
    tv.measure(MeasureSpec.makeMeasureSpec(mLayoutAlgorithm.mTaskRect.width() + mTmpRect.left + mTmpRect.right,MeasureSpec.EXACTLY),MeasureSpec.makeMeasureSpec(mLayoutAlgorithm.mTaskRect.height() + mTmpRect.top + mTmpRect.bottom,MeasureSpec.EXACTLY));
  }
  setMeasuredDimension(width,height);
}
Program: 193217
Project: 193217
Buggy source:
/** 
 * Returns the task stack bounds in the current orientation. These bounds do not account for the system insets.
 */
public void getTaskStackBounds(Rect windowBounds,int topInset,int rightInset,Rect searchBarBounds,Rect taskStackBounds){
  if (hasTransposedNavBar) {
    int swInset=getInsetToSmallestWidth(windowBounds.right - rightInset - windowBounds.left);
    taskStackBounds.set(windowBounds.left + swInset,windowBounds.top + topInset,windowBounds.right - swInset - rightInset,windowBounds.bottom);
  }
 else {
    int swInset=getInsetToSmallestWidth(windowBounds.right - windowBounds.left);
    int top=searchBarBounds.isEmpty() ? topInset : 0;
    taskStackBounds.set(windowBounds.left + swInset,searchBarBounds.bottom + top,windowBounds.right - swInset,windowBounds.bottom);
  }
}

Fixed version (ground truth):
/** 
 * Returns the task stack bounds in the current orientation. These bounds do not account for the system insets.
 */
public void getTaskStackBounds(Rect windowBounds,int topInset,int rightInset,Rect searchBarBounds,Rect taskStackBounds){
  if (hasTransposedNavBar) {
    int swInset=getInsetToSmallestWidth(windowBounds.right - rightInset - windowBounds.left);
    taskStackBounds.set(windowBounds.left + swInset,windowBounds.top + topInset,windowBounds.right - swInset - rightInset,windowBounds.bottom);
  }
 else {
    int swInset=getInsetToSmallestWidth(windowBounds.right - windowBounds.left);
    int top=searchBarBounds.isEmpty() ? topInset : 0;
    taskStackBounds.set(windowBounds.left + swInset,searchBarBounds.bottom + top,windowBounds.right - swInset - rightInset,windowBounds.bottom);
  }
}
Program: 193219
Project: 193219
Buggy source:
/** 
 * This is called with the size of the space not including the top or right insets, or the search bar height in portrait (but including the search bar width in landscape, since we want to draw under it.
 */
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  List<TaskView> taskViews=getTaskViews();
  int taskViewCount=taskViews.size();
  for (int i=0; i < taskViewCount; i++) {
    TaskView tv=taskViews.get(i);
    if (tv.getBackground() != null) {
      tv.getBackground().getPadding(mTmpRect);
    }
 else {
      mTmpRect.setEmpty();
    }
    Rect taskRect=mLayoutAlgorithm.mTaskRect;
    tv.layout(taskRect.left - mTmpRect.left,taskRect.top - mTmpRect.top,taskRect.right + mTmpRect.right,taskRect.bottom + mTmpRect.bottom);
  }
  if (mAwaitingFirstLayout) {
    mAwaitingFirstLayout=false;
    onFirstLayout();
  }
  if (changed) {
    requestSynchronizeStackViewsWithModel();
    synchronizeStackViewsWithModel();
    clipTaskViews(true);
  }
}

Fixed version (ground truth):
/** 
 * This is called with the size of the space not including the top or right insets, or the search bar height in portrait (but including the search bar width in landscape, since we want to draw under it.
 */
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  mTmpTaskViews.clear();
  mTmpTaskViews.addAll(getTaskViews());
  mTmpTaskViews.addAll(mViewPool.getViews());
  int taskViewCount=mTmpTaskViews.size();
  for (int i=0; i < taskViewCount; i++) {
    TaskView tv=mTmpTaskViews.get(i);
    if (tv.getBackground() != null) {
      tv.getBackground().getPadding(mTmpRect);
    }
 else {
      mTmpRect.setEmpty();
    }
    Rect taskRect=mLayoutAlgorithm.mTaskRect;
    tv.layout(taskRect.left - mTmpRect.left,taskRect.top - mTmpRect.top,taskRect.right + mTmpRect.right,taskRect.bottom + mTmpRect.bottom);
  }
  if (mAwaitingFirstLayout) {
    mAwaitingFirstLayout=false;
    onFirstLayout();
  }
  if (changed) {
    if (mStackScroller.isScrollOutOfBounds()) {
      mStackScroller.boundScroll();
    }
    requestSynchronizeStackViewsWithModel();
    synchronizeStackViewsWithModel();
    clipTaskViews(true);
  }
}
Program: 193220
Project: 193220
Buggy source:
/** 
 * Resets this TaskStackView for reuse. 
 */
void reset(){
  resetFocusedTask();
  List<TaskView> taskViews=getTaskViews();
  int taskViewCount=taskViews.size();
  for (int i=taskViewCount - 1; i >= 0; i--) {
    mViewPool.returnViewToPool(taskViews.get(i));
  }
  if (mViewPool != null) {
    Iterator<TaskView> iter=mViewPool.poolViewIterator();
    if (iter != null) {
      while (iter.hasNext()) {
        TaskView tv=iter.next();
        tv.reset();
      }
    }
  }
  mStack.reset();
  mStackViewsDirty=true;
  mStackViewsClipDirty=true;
  mAwaitingFirstLayout=true;
  if (mUIDozeTrigger != null) {
    mUIDozeTrigger.stopDozing();
    mUIDozeTrigger.resetTrigger();
  }
  mStackScroller.reset();
}

Fixed version (ground truth):
/** 
 * Resets this TaskStackView for reuse. 
 */
void reset(){
  resetFocusedTask();
  List<TaskView> taskViews=getTaskViews();
  int taskViewCount=taskViews.size();
  for (int i=taskViewCount - 1; i >= 0; i--) {
    mViewPool.returnViewToPool(taskViews.get(i));
  }
  List<TaskView> poolViews=mViewPool.getViews();
  for (  TaskView tv : poolViews) {
    tv.reset();
  }
  mStack.reset();
  mStackViewsDirty=true;
  mStackViewsClipDirty=true;
  mAwaitingFirstLayout=true;
  if (mUIDozeTrigger != null) {
    mUIDozeTrigger.stopDozing();
    mUIDozeTrigger.resetTrigger();
  }
  mStackScroller.reset();
}
Program: 193221
Project: 193221
Buggy source:
/** 
 * This is called with the full window width and height to allow stack view children to perform the full screen transition down.
 */
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  int width=MeasureSpec.getSize(widthMeasureSpec);
  int height=MeasureSpec.getSize(heightMeasureSpec);
  computeRects(mTaskStackBounds);
  if (mAwaitingFirstLayout) {
    mStackScroller.setStackScrollToInitialState();
    requestSynchronizeStackViewsWithModel();
    synchronizeStackViewsWithModel();
  }
  List<TaskView> taskViews=getTaskViews();
  int taskViewCount=taskViews.size();
  for (int i=0; i < taskViewCount; i++) {
    TaskView tv=taskViews.get(i);
    if (tv.getBackground() != null) {
      tv.getBackground().getPadding(mTmpRect);
    }
 else {
      mTmpRect.setEmpty();
    }
    tv.measure(MeasureSpec.makeMeasureSpec(mLayoutAlgorithm.mTaskRect.width() + mTmpRect.left + mTmpRect.right,MeasureSpec.EXACTLY),MeasureSpec.makeMeasureSpec(mLayoutAlgorithm.mTaskRect.height() + mTmpRect.top + mTmpRect.bottom,MeasureSpec.EXACTLY));
  }
  setMeasuredDimension(width,height);
}

Fixed version (ground truth):
/** 
 * This is called with the full window width and height to allow stack view children to perform the full screen transition down.
 */
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  int width=MeasureSpec.getSize(widthMeasureSpec);
  int height=MeasureSpec.getSize(heightMeasureSpec);
  computeRects(mTaskStackBounds);
  if (mAwaitingFirstLayout) {
    mStackScroller.setStackScrollToInitialState();
    requestSynchronizeStackViewsWithModel();
    synchronizeStackViewsWithModel();
  }
  mTmpTaskViews.clear();
  mTmpTaskViews.addAll(getTaskViews());
  mTmpTaskViews.addAll(mViewPool.getViews());
  int taskViewCount=mTmpTaskViews.size();
  for (int i=0; i < taskViewCount; i++) {
    TaskView tv=mTmpTaskViews.get(i);
    if (tv.getBackground() != null) {
      tv.getBackground().getPadding(mTmpRect);
    }
 else {
      mTmpRect.setEmpty();
    }
    tv.measure(MeasureSpec.makeMeasureSpec(mLayoutAlgorithm.mTaskRect.width() + mTmpRect.left + mTmpRect.right,MeasureSpec.EXACTLY),MeasureSpec.makeMeasureSpec(mLayoutAlgorithm.mTaskRect.height() + mTmpRect.top + mTmpRect.bottom,MeasureSpec.EXACTLY));
  }
  setMeasuredDimension(width,height);
}
Program: 193222
Project: 193222
Buggy source:
/** 
 * An entry was removed.
 * @param removed the removed entry
 * @param sbn the notification the entry has, which doesn't need to be the same as it's internalnotification
 */
private void onEntryRemovedInternal(NotificationData.Entry removed,final StatusBarNotification sbn){
  Notification notif=sbn.getNotification();
  String groupKey=sbn.getGroupKey();
  final NotificationGroup group=mGroupMap.get(groupKey);
  if (group == null) {
    return;
  }
  if (notif.isGroupSummary()) {
    group.summary=null;
  }
 else {
    group.children.remove(removed);
  }
  if (group.children.isEmpty()) {
    if (group.summary == null) {
      mGroupMap.remove(groupKey);
    }
 else     if (!group.expanded) {
      group.summary.row.updateNotificationHeader();
    }
  }
}

Fixed version (ground truth):
/** 
 * An entry was removed.
 * @param removed the removed entry
 * @param sbn the notification the entry has, which doesn't need to be the same as it's internalnotification
 */
private void onEntryRemovedInternal(NotificationData.Entry removed,final StatusBarNotification sbn){
  Notification notif=sbn.getNotification();
  String groupKey=sbn.getGroupKey();
  final NotificationGroup group=mGroupMap.get(groupKey);
  if (group == null) {
    return;
  }
  if (notif.isGroupChild()) {
    group.children.remove(removed);
  }
 else {
    group.summary=null;
  }
  if (group.children.isEmpty()) {
    if (group.summary == null) {
      mGroupMap.remove(groupKey);
    }
 else     if (!group.expanded) {
      group.summary.row.updateNotificationHeader();
    }
  }
}
Program: 193223
Project: 193223
Buggy source:
public void onEntryAdded(NotificationData.Entry added){
  StatusBarNotification sbn=added.notification;
  Notification notif=sbn.getNotification();
  String groupKey=sbn.getGroupKey();
  NotificationGroup group=mGroupMap.get(groupKey);
  if (group == null) {
    group=new NotificationGroup();
    mGroupMap.put(groupKey,group);
  }
  if (notif.isGroupSummary()) {
    group.summary=added;
    group.expanded=added.row.areChildrenExpanded();
    if (!group.children.isEmpty()) {
      mListener.onGroupCreatedFromChildren(group);
    }
  }
 else {
    group.children.add(added);
    if (group.summary != null && group.children.size() == 1 && !group.expanded) {
      group.summary.row.updateNotificationHeader();
    }
  }
}

Fixed version (ground truth):
public void onEntryAdded(NotificationData.Entry added){
  StatusBarNotification sbn=added.notification;
  Notification notif=sbn.getNotification();
  String groupKey=sbn.getGroupKey();
  NotificationGroup group=mGroupMap.get(groupKey);
  if (group == null) {
    group=new NotificationGroup();
    mGroupMap.put(groupKey,group);
  }
  if (notif.isGroupChild()) {
    group.children.add(added);
    if (group.summary != null && group.children.size() == 1 && !group.expanded) {
      group.summary.row.updateNotificationHeader();
    }
  }
 else {
    group.summary=added;
    group.expanded=added.row.areChildrenExpanded();
    if (!group.children.isEmpty()) {
      mListener.onGroupCreatedFromChildren(group);
    }
  }
}
Program: 193224
Project: 193224
Buggy source:
/** 
 * @return whether a given notification is a summary in a group which has children
 */
public boolean isSummaryOfGroup(StatusBarNotification sbn){
  if (sbn.getNotification().isGroupChild()) {
    return false;
  }
  NotificationGroup group=mGroupMap.get(sbn.getGroupKey());
  if (group == null) {
    return false;
  }
  return !group.children.isEmpty();
}

Fixed version (ground truth):
/** 
 * @return whether a given notification is a summary in a group which has children
 */
public boolean isSummaryOfGroup(StatusBarNotification sbn){
  if (!sbn.getNotification().isGroupSummary()) {
    return false;
  }
  NotificationGroup group=mGroupMap.get(sbn.getGroupKey());
  if (group == null) {
    return false;
  }
  return !group.children.isEmpty();
}
Program: 193229
Project: 193229
Buggy source:
/** 
 * See if any windows have been drawn, so they (and others associated with them) can now be shown. 
 */
private void testTokenMayBeDrawnLocked(int displayId){
  final ArrayList<Task> tasks=mService.getDisplayContentLocked(displayId).getTasks();
  final int numTasks=tasks.size();
  for (int taskNdx=0; taskNdx < numTasks; ++taskNdx) {
    final AppTokenList tokens=tasks.get(taskNdx).mAppTokens;
    final int numTokens=tokens.size();
    for (int tokenNdx=0; tokenNdx < numTokens; ++tokenNdx) {
      final AppWindowToken wtoken=tokens.get(tokenNdx);
      AppWindowAnimator appAnimator=wtoken.mAppAnimator;
      final boolean allDrawn=wtoken.allDrawn;
      if (allDrawn != appAnimator.allDrawn) {
        appAnimator.allDrawn=allDrawn;
        if (allDrawn) {
          if (appAnimator.freezingScreen) {
            appAnimator.showAllWindowsLocked();
            mService.unsetAppFreezingScreenLocked(wtoken,false,true);
            if (DEBUG_ORIENTATION)             Slog.i(TAG,"String_Node_Str" + wtoken + "String_Node_Str"+ wtoken.numInterestingWindows+ "String_Node_Str"+ wtoken.numDrawnWindows);
            setAppLayoutChanges(appAnimator,WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER,"String_Node_Str",displayId);
          }
 else {
            setAppLayoutChanges(appAnimator,WindowManagerPolicy.FINISH_LAYOUT_REDO_ANIM,"String_Node_Str",displayId);
            if (!mService.mOpeningApps.contains(wtoken)) {
              mAnimating|=appAnimator.showAllWindowsLocked();
            }
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * See if any windows have been drawn, so they (and others associated with them) can now be shown. 
 */
private void testTokenMayBeDrawnLocked(int displayId){
  final ArrayList<Task> tasks=mService.getDisplayContentLocked(displayId).getTasks();
  final int numTasks=tasks.size();
  for (int taskNdx=0; taskNdx < numTasks; ++taskNdx) {
    final AppTokenList tokens=tasks.get(taskNdx).mAppTokens;
    final int numTokens=tokens.size();
    for (int tokenNdx=0; tokenNdx < numTokens; ++tokenNdx) {
      final AppWindowToken wtoken=tokens.get(tokenNdx);
      AppWindowAnimator appAnimator=wtoken.mAppAnimator;
      final boolean allDrawn=wtoken.allDrawn;
      if (allDrawn != appAnimator.allDrawn) {
        appAnimator.allDrawn=allDrawn;
        if (allDrawn) {
          if (appAnimator.freezingScreen) {
            appAnimator.showAllWindowsLocked();
            mService.unsetAppFreezingScreenLocked(wtoken,false,true);
            if (DEBUG_ORIENTATION)             Slog.i(TAG,"String_Node_Str" + wtoken + "String_Node_Str"+ wtoken.numInterestingWindows+ "String_Node_Str"+ wtoken.numDrawnWindows);
            setAppLayoutChanges(appAnimator,WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER,"String_Node_Str",displayId);
          }
 else {
            setAppLayoutChanges(appAnimator,WindowManagerPolicy.FINISH_LAYOUT_REDO_ANIM,"String_Node_Str",displayId);
            if (!mService.mOpeningApps.contains(wtoken)) {
              orAnimating(appAnimator.showAllWindowsLocked());
            }
          }
        }
      }
    }
  }
}
Program: 193232
Project: 193232
Buggy source:
private void adjustCropToStackBounds(WindowState w,Rect clipRect,boolean isFreeformResizing){
  final AppWindowToken appToken=w.mAppToken;
  final Task task=w.getTask();
  if (task != null && appToken.mCropWindowsToStack && !appToken.mWillReplaceWindow) {
    TaskStack stack=task.mStack;
    stack.getDimBounds(mTmpStackBounds);
    final int frameX=isFreeformResizing ? (int)mSurfaceController.getX() : w.mFrame.left + mWin.mXOffset - w.getAttrs().surfaceInsets.left;
    final int frameY=isFreeformResizing ? (int)mSurfaceController.getY() : w.mFrame.top + mWin.mYOffset - w.getAttrs().surfaceInsets.top;
    clipRect.left=Math.max(0,Math.max(mTmpStackBounds.left,frameX + clipRect.left) - frameX);
    clipRect.top=Math.max(0,Math.max(mTmpStackBounds.top,frameY + clipRect.top) - frameY);
    clipRect.right=Math.max(0,Math.min(mTmpStackBounds.right,frameX + clipRect.right) - frameX);
    clipRect.bottom=Math.max(0,Math.min(mTmpStackBounds.bottom,frameY + clipRect.bottom) - frameY);
  }
}

Fixed version (ground truth):
private void adjustCropToStackBounds(WindowState w,Rect clipRect,boolean isFreeformResizing){
  final AppWindowToken appToken=w.mAppToken;
  final Task task=w.getTask();
  if (task == null || !appToken.mCropWindowsToStack) {
    return;
  }
  if (isAnimating() && (appToken.mWillReplaceWindow || w.inDockedWorkspace())) {
    return;
  }
  final TaskStack stack=task.mStack;
  stack.getDimBounds(mTmpStackBounds);
  final int frameX=isFreeformResizing ? (int)mSurfaceController.getX() : w.mFrame.left + mWin.mXOffset - w.getAttrs().surfaceInsets.left;
  final int frameY=isFreeformResizing ? (int)mSurfaceController.getY() : w.mFrame.top + mWin.mYOffset - w.getAttrs().surfaceInsets.top;
  clipRect.left=Math.max(0,Math.max(mTmpStackBounds.left,frameX + clipRect.left) - frameX);
  clipRect.top=Math.max(0,Math.max(mTmpStackBounds.top,frameY + clipRect.top) - frameY);
  clipRect.right=Math.max(0,Math.min(mTmpStackBounds.right,frameX + clipRect.right) - frameX);
  clipRect.bottom=Math.max(0,Math.min(mTmpStackBounds.bottom,frameY + clipRect.bottom) - frameY);
}
Program: 193235
Project: 193235
Buggy source:
private void processApplicationsAnimatingInPlace(int transit){
  if (transit == AppTransition.TRANSIT_TASK_IN_PLACE) {
    final WindowState win=mService.findFocusedWindowLocked(mService.getDefaultDisplayContentLocked());
    if (win != null) {
      final AppWindowToken wtoken=win.mAppToken;
      final AppWindowAnimator appAnimator=wtoken.mAppAnimator;
      if (DEBUG_APP_TRANSITIONS)       Slog.v(TAG,"String_Node_Str" + wtoken);
      appAnimator.clearThumbnail();
      appAnimator.animation=null;
      mService.updateTokenInPlaceLocked(wtoken,transit);
      wtoken.updateReportedVisibilityLocked();
      appAnimator.mAllAppWinAnimators.clear();
      final int N=wtoken.allAppWindows.size();
      for (int j=0; j < N; j++) {
        appAnimator.mAllAppWinAnimators.add(wtoken.allAppWindows.get(j).mWinAnimator);
      }
      mService.mAnimator.mAppWindowAnimating|=appAnimator.isAnimating();
      mService.mAnimator.mAnimating|=appAnimator.showAllWindowsLocked();
    }
  }
}

Fixed version (ground truth):
private void processApplicationsAnimatingInPlace(int transit){
  if (transit == AppTransition.TRANSIT_TASK_IN_PLACE) {
    final WindowState win=mService.findFocusedWindowLocked(mService.getDefaultDisplayContentLocked());
    if (win != null) {
      final AppWindowToken wtoken=win.mAppToken;
      final AppWindowAnimator appAnimator=wtoken.mAppAnimator;
      if (DEBUG_APP_TRANSITIONS)       Slog.v(TAG,"String_Node_Str" + wtoken);
      appAnimator.clearThumbnail();
      appAnimator.animation=null;
      mService.updateTokenInPlaceLocked(wtoken,transit);
      wtoken.updateReportedVisibilityLocked();
      appAnimator.mAllAppWinAnimators.clear();
      final int N=wtoken.allAppWindows.size();
      for (int j=0; j < N; j++) {
        appAnimator.mAllAppWinAnimators.add(wtoken.allAppWindows.get(j).mWinAnimator);
      }
      mService.mAnimator.mAppWindowAnimating|=appAnimator.isAnimating();
      mService.mAnimator.orAnimating(appAnimator.showAllWindowsLocked());
    }
  }
}
Program: 193240
Project: 193240
Buggy source:
/** 
 * See if any windows have been drawn, so they (and others associated with them) can now be shown. 
 */
private void testTokenMayBeDrawnLocked(int displayId){
  final ArrayList<Task> tasks=mService.getDisplayContentLocked(displayId).getTasks();
  final int numTasks=tasks.size();
  for (int taskNdx=0; taskNdx < numTasks; ++taskNdx) {
    final AppTokenList tokens=tasks.get(taskNdx).mAppTokens;
    final int numTokens=tokens.size();
    for (int tokenNdx=0; tokenNdx < numTokens; ++tokenNdx) {
      final AppWindowToken wtoken=tokens.get(tokenNdx);
      AppWindowAnimator appAnimator=wtoken.mAppAnimator;
      final boolean allDrawn=wtoken.allDrawn;
      if (allDrawn != appAnimator.allDrawn) {
        appAnimator.allDrawn=allDrawn;
        if (allDrawn) {
          if (appAnimator.freezingScreen) {
            appAnimator.showAllWindowsLocked();
            mService.unsetAppFreezingScreenLocked(wtoken,false,true);
            if (DEBUG_ORIENTATION)             Slog.i(TAG,"String_Node_Str" + wtoken + "String_Node_Str"+ wtoken.numInterestingWindows+ "String_Node_Str"+ wtoken.numDrawnWindows);
            setAppLayoutChanges(appAnimator,WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER,"String_Node_Str",displayId);
          }
 else {
            setAppLayoutChanges(appAnimator,WindowManagerPolicy.FINISH_LAYOUT_REDO_ANIM,"String_Node_Str",displayId);
            if (!mService.mOpeningApps.contains(wtoken)) {
              mAnimating|=appAnimator.showAllWindowsLocked();
            }
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * See if any windows have been drawn, so they (and others associated with them) can now be shown. 
 */
private void testTokenMayBeDrawnLocked(int displayId){
  final ArrayList<Task> tasks=mService.getDisplayContentLocked(displayId).getTasks();
  final int numTasks=tasks.size();
  for (int taskNdx=0; taskNdx < numTasks; ++taskNdx) {
    final AppTokenList tokens=tasks.get(taskNdx).mAppTokens;
    final int numTokens=tokens.size();
    for (int tokenNdx=0; tokenNdx < numTokens; ++tokenNdx) {
      final AppWindowToken wtoken=tokens.get(tokenNdx);
      AppWindowAnimator appAnimator=wtoken.mAppAnimator;
      final boolean allDrawn=wtoken.allDrawn;
      if (allDrawn != appAnimator.allDrawn) {
        appAnimator.allDrawn=allDrawn;
        if (allDrawn) {
          if (appAnimator.freezingScreen) {
            appAnimator.showAllWindowsLocked();
            mService.unsetAppFreezingScreenLocked(wtoken,false,true);
            if (DEBUG_ORIENTATION)             Slog.i(TAG,"String_Node_Str" + wtoken + "String_Node_Str"+ wtoken.numInterestingWindows+ "String_Node_Str"+ wtoken.numDrawnWindows);
            setAppLayoutChanges(appAnimator,WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER,"String_Node_Str",displayId);
          }
 else {
            setAppLayoutChanges(appAnimator,WindowManagerPolicy.FINISH_LAYOUT_REDO_ANIM,"String_Node_Str",displayId);
            if (!mService.mOpeningApps.contains(wtoken)) {
              orAnimating(appAnimator.showAllWindowsLocked());
            }
          }
        }
      }
    }
  }
}
Program: 193243
Project: 193243
Buggy source:
private void adjustCropToStackBounds(WindowState w,Rect clipRect,boolean isFreeformResizing){
  final AppWindowToken appToken=w.mAppToken;
  final Task task=w.getTask();
  if (task != null && appToken.mCropWindowsToStack && !appToken.mWillReplaceWindow) {
    TaskStack stack=task.mStack;
    stack.getDimBounds(mTmpStackBounds);
    final int frameX=isFreeformResizing ? (int)mSurfaceController.getX() : w.mFrame.left + mWin.mXOffset - w.getAttrs().surfaceInsets.left;
    final int frameY=isFreeformResizing ? (int)mSurfaceController.getY() : w.mFrame.top + mWin.mYOffset - w.getAttrs().surfaceInsets.top;
    clipRect.left=Math.max(0,Math.max(mTmpStackBounds.left,frameX + clipRect.left) - frameX);
    clipRect.top=Math.max(0,Math.max(mTmpStackBounds.top,frameY + clipRect.top) - frameY);
    clipRect.right=Math.max(0,Math.min(mTmpStackBounds.right,frameX + clipRect.right) - frameX);
    clipRect.bottom=Math.max(0,Math.min(mTmpStackBounds.bottom,frameY + clipRect.bottom) - frameY);
  }
}

Fixed version (ground truth):
private void adjustCropToStackBounds(WindowState w,Rect clipRect,boolean isFreeformResizing){
  final AppWindowToken appToken=w.mAppToken;
  final Task task=w.getTask();
  if (task == null || !appToken.mCropWindowsToStack) {
    return;
  }
  if (isAnimating() && (appToken.mWillReplaceWindow || w.inDockedWorkspace())) {
    return;
  }
  final TaskStack stack=task.mStack;
  stack.getDimBounds(mTmpStackBounds);
  final int frameX=isFreeformResizing ? (int)mSurfaceController.getX() : w.mFrame.left + mWin.mXOffset - w.getAttrs().surfaceInsets.left;
  final int frameY=isFreeformResizing ? (int)mSurfaceController.getY() : w.mFrame.top + mWin.mYOffset - w.getAttrs().surfaceInsets.top;
  clipRect.left=Math.max(0,Math.max(mTmpStackBounds.left,frameX + clipRect.left) - frameX);
  clipRect.top=Math.max(0,Math.max(mTmpStackBounds.top,frameY + clipRect.top) - frameY);
  clipRect.right=Math.max(0,Math.min(mTmpStackBounds.right,frameX + clipRect.right) - frameX);
  clipRect.bottom=Math.max(0,Math.min(mTmpStackBounds.bottom,frameY + clipRect.bottom) - frameY);
}
Program: 193246
Project: 193246
Buggy source:
private void processApplicationsAnimatingInPlace(int transit){
  if (transit == AppTransition.TRANSIT_TASK_IN_PLACE) {
    final WindowState win=mService.findFocusedWindowLocked(mService.getDefaultDisplayContentLocked());
    if (win != null) {
      final AppWindowToken wtoken=win.mAppToken;
      final AppWindowAnimator appAnimator=wtoken.mAppAnimator;
      if (DEBUG_APP_TRANSITIONS)       Slog.v(TAG,"String_Node_Str" + wtoken);
      appAnimator.clearThumbnail();
      appAnimator.animation=null;
      mService.updateTokenInPlaceLocked(wtoken,transit);
      wtoken.updateReportedVisibilityLocked();
      appAnimator.mAllAppWinAnimators.clear();
      final int N=wtoken.allAppWindows.size();
      for (int j=0; j < N; j++) {
        appAnimator.mAllAppWinAnimators.add(wtoken.allAppWindows.get(j).mWinAnimator);
      }
      mService.mAnimator.mAppWindowAnimating|=appAnimator.isAnimating();
      mService.mAnimator.mAnimating|=appAnimator.showAllWindowsLocked();
    }
  }
}

Fixed version (ground truth):
private void processApplicationsAnimatingInPlace(int transit){
  if (transit == AppTransition.TRANSIT_TASK_IN_PLACE) {
    final WindowState win=mService.findFocusedWindowLocked(mService.getDefaultDisplayContentLocked());
    if (win != null) {
      final AppWindowToken wtoken=win.mAppToken;
      final AppWindowAnimator appAnimator=wtoken.mAppAnimator;
      if (DEBUG_APP_TRANSITIONS)       Slog.v(TAG,"String_Node_Str" + wtoken);
      appAnimator.clearThumbnail();
      appAnimator.animation=null;
      mService.updateTokenInPlaceLocked(wtoken,transit);
      wtoken.updateReportedVisibilityLocked();
      appAnimator.mAllAppWinAnimators.clear();
      final int N=wtoken.allAppWindows.size();
      for (int j=0; j < N; j++) {
        appAnimator.mAllAppWinAnimators.add(wtoken.allAppWindows.get(j).mWinAnimator);
      }
      mService.mAnimator.mAppWindowAnimating|=appAnimator.isAnimating();
      mService.mAnimator.orAnimating(appAnimator.showAllWindowsLocked());
    }
  }
}
Program: 193248
Project: 193248
Buggy source:
void invalidateInternal(int l,int t,int r,int b,boolean invalidateCache,boolean fullInvalidate){
  if (mGhostView != null) {
    mGhostView.invalidate(true);
    return;
  }
  if (skipInvalidate()) {
    return;
  }
  if ((mPrivateFlags & (PFLAG_DRAWN | PFLAG_HAS_BOUNDS)) == (PFLAG_DRAWN | PFLAG_HAS_BOUNDS) || (invalidateCache && (mPrivateFlags & PFLAG_DRAWING_CACHE_VALID) == PFLAG_DRAWING_CACHE_VALID) || (mPrivateFlags & PFLAG_INVALIDATED) != PFLAG_INVALIDATED || (fullInvalidate && isOpaque() != mLastIsOpaque)) {
    if (fullInvalidate) {
      mLastIsOpaque=isOpaque();
      mPrivateFlags&=~PFLAG_DRAWN;
    }
    mPrivateFlags|=PFLAG_DIRTY;
    resetDisplayList();
    if (invalidateCache) {
      mPrivateFlags|=PFLAG_INVALIDATED;
      mPrivateFlags&=~PFLAG_DRAWING_CACHE_VALID;
    }
    final AttachInfo ai=mAttachInfo;
    final ViewParent p=mParent;
    if (p != null && ai != null && l < r && t < b) {
      final Rect damage=ai.mTmpInvalRect;
      damage.set(l,t,r,b);
      p.invalidateChild(this,damage);
    }
    if (mBackground != null && mBackground.isProjected()) {
      final View receiver=getProjectionReceiver();
      if (receiver != null) {
        receiver.damageInParent();
      }
    }
    if (isHardwareAccelerated() && getZ() != 0) {
      damageShadowReceiver();
    }
  }
}

Fixed version (ground truth):
void invalidateInternal(int l,int t,int r,int b,boolean invalidateCache,boolean fullInvalidate){
  if (mGhostView != null) {
    mGhostView.invalidate(true);
    return;
  }
  if (skipInvalidate()) {
    return;
  }
  if ((mPrivateFlags & (PFLAG_DRAWN | PFLAG_HAS_BOUNDS)) == (PFLAG_DRAWN | PFLAG_HAS_BOUNDS) || (invalidateCache && (mPrivateFlags & PFLAG_DRAWING_CACHE_VALID) == PFLAG_DRAWING_CACHE_VALID) || (mPrivateFlags & PFLAG_INVALIDATED) != PFLAG_INVALIDATED || (fullInvalidate && isOpaque() != mLastIsOpaque)) {
    if (fullInvalidate) {
      mLastIsOpaque=isOpaque();
      mPrivateFlags&=~PFLAG_DRAWN;
    }
    mPrivateFlags|=PFLAG_DIRTY;
    if (invalidateCache) {
      mPrivateFlags|=PFLAG_INVALIDATED;
      mPrivateFlags&=~PFLAG_DRAWING_CACHE_VALID;
    }
    final AttachInfo ai=mAttachInfo;
    final ViewParent p=mParent;
    if (p != null && ai != null && l < r && t < b) {
      final Rect damage=ai.mTmpInvalRect;
      damage.set(l,t,r,b);
      p.invalidateChild(this,damage);
    }
    if (mBackground != null && mBackground.isProjected()) {
      final View receiver=getProjectionReceiver();
      if (receiver != null) {
        receiver.damageInParent();
      }
    }
    if (isHardwareAccelerated() && getZ() != 0) {
      damageShadowReceiver();
    }
  }
}
Program: 193249
Project: 193249
Buggy source:
void invalidateInternal(int l,int t,int r,int b,boolean invalidateCache,boolean fullInvalidate){
  if (mGhostView != null) {
    mGhostView.invalidate(true);
    return;
  }
  if (skipInvalidate()) {
    return;
  }
  if ((mPrivateFlags & (PFLAG_DRAWN | PFLAG_HAS_BOUNDS)) == (PFLAG_DRAWN | PFLAG_HAS_BOUNDS) || (invalidateCache && (mPrivateFlags & PFLAG_DRAWING_CACHE_VALID) == PFLAG_DRAWING_CACHE_VALID) || (mPrivateFlags & PFLAG_INVALIDATED) != PFLAG_INVALIDATED || (fullInvalidate && isOpaque() != mLastIsOpaque)) {
    if (fullInvalidate) {
      mLastIsOpaque=isOpaque();
      mPrivateFlags&=~PFLAG_DRAWN;
    }
    mPrivateFlags|=PFLAG_DIRTY;
    resetDisplayList();
    if (invalidateCache) {
      mPrivateFlags|=PFLAG_INVALIDATED;
      mPrivateFlags&=~PFLAG_DRAWING_CACHE_VALID;
    }
    final AttachInfo ai=mAttachInfo;
    final ViewParent p=mParent;
    if (p != null && ai != null && l < r && t < b) {
      final Rect damage=ai.mTmpInvalRect;
      damage.set(l,t,r,b);
      p.invalidateChild(this,damage);
    }
    if (mBackground != null && mBackground.isProjected()) {
      final View receiver=getProjectionReceiver();
      if (receiver != null) {
        receiver.damageInParent();
      }
    }
    if (isHardwareAccelerated() && getZ() != 0) {
      damageShadowReceiver();
    }
  }
}

Fixed version (ground truth):
void invalidateInternal(int l,int t,int r,int b,boolean invalidateCache,boolean fullInvalidate){
  if (mGhostView != null) {
    mGhostView.invalidate(true);
    return;
  }
  if (skipInvalidate()) {
    return;
  }
  if ((mPrivateFlags & (PFLAG_DRAWN | PFLAG_HAS_BOUNDS)) == (PFLAG_DRAWN | PFLAG_HAS_BOUNDS) || (invalidateCache && (mPrivateFlags & PFLAG_DRAWING_CACHE_VALID) == PFLAG_DRAWING_CACHE_VALID) || (mPrivateFlags & PFLAG_INVALIDATED) != PFLAG_INVALIDATED || (fullInvalidate && isOpaque() != mLastIsOpaque)) {
    if (fullInvalidate) {
      mLastIsOpaque=isOpaque();
      mPrivateFlags&=~PFLAG_DRAWN;
    }
    mPrivateFlags|=PFLAG_DIRTY;
    if (invalidateCache) {
      mPrivateFlags|=PFLAG_INVALIDATED;
      mPrivateFlags&=~PFLAG_DRAWING_CACHE_VALID;
    }
    final AttachInfo ai=mAttachInfo;
    final ViewParent p=mParent;
    if (p != null && ai != null && l < r && t < b) {
      final Rect damage=ai.mTmpInvalRect;
      damage.set(l,t,r,b);
      p.invalidateChild(this,damage);
    }
    if (mBackground != null && mBackground.isProjected()) {
      final View receiver=getProjectionReceiver();
      if (receiver != null) {
        receiver.damageInParent();
      }
    }
    if (isHardwareAccelerated() && getZ() != 0) {
      damageShadowReceiver();
    }
  }
}
Program: 193250
Project: 193250
Buggy source:
/** 
 * Handle screen pinning request.
 */
public final void onBusEvent(final ScreenPinningRequestEvent event){
  int processUser=event.systemServicesProxy.getProcessUser();
  if (event.systemServicesProxy.isSystemUser(processUser)) {
    mImpl.onStartScreenPinning(event.applicationContext);
  }
 else {
    postToSystemUser(new Runnable(){
      @Override public void run(){
        try {
          mCallbacksToSystemUser.startScreenPinning();
        }
 catch (        RemoteException e) {
          Log.e(TAG,"String_Node_Str",e);
        }
      }
    }
);
  }
}

Fixed version (ground truth):
/** 
 * Handle screen pinning request.
 */
public final void onBusEvent(final ScreenPinningRequestEvent event){
  int processUser=sSystemServicesProxy.getProcessUser();
  if (sSystemServicesProxy.isSystemUser(processUser)) {
    mImpl.onStartScreenPinning(event.applicationContext);
  }
 else {
    postToSystemUser(new Runnable(){
      @Override public void run(){
        try {
          mCallbacksToSystemUser.startScreenPinning();
        }
 catch (        RemoteException e) {
          Log.e(TAG,"String_Node_Str",e);
        }
      }
    }
);
  }
}
Program: 193251
Project: 193251
Buggy source:
@Override public void onAllTaskViewsDismissed(){
  mFinishLaunchHomeRunnable.run();
}

Fixed version (ground truth):
/** 
 * RecentsView.RecentsViewCallbacks Implementation 
 */
@Override public void onAllTaskViewsDismissed(){
  mFinishLaunchHomeRunnable.run();
}
Program: 193253
Project: 193253
Buggy source:
public ScreenPinningRequestEvent(Context context,SystemServicesProxy systemServicesProxy){
  this.applicationContext=context.getApplicationContext();
  this.systemServicesProxy=systemServicesProxy;
}

Fixed version (ground truth):
public ScreenPinningRequestEvent(Context context){
  this.applicationContext=context.getApplicationContext();
}
Program: 193254
Project: 193254
Buggy source:
private ForegroundThread(){
  super("String_Node_Str",android.os.Process.THREAD_PRIORITY_BACKGROUND);
}

Fixed version (ground truth):
private ForegroundThread(){
  super("String_Node_Str");
}
Program: 193256
Project: 193256
Buggy source:
public Task(TaskKey key,boolean isActive,int taskAffiliation,int taskAffiliationColor,String activityTitle,String contentDescription,Drawable activityIcon,int colorPrimary,boolean lockToThisTask,boolean lockToTaskEnabled,Bitmap icon,String iconFilename,Rect bounds){
  boolean isInAffiliationGroup=(taskAffiliation != key.id);
  boolean hasAffiliationGroupColor=isInAffiliationGroup && (taskAffiliationColor != 0);
  this.key=key;
  this.taskAffiliation=taskAffiliation;
  this.taskAffiliationColor=taskAffiliationColor;
  this.activityLabel=activityTitle;
  this.contentDescription=contentDescription;
  this.activityIcon=activityIcon;
  this.colorPrimary=hasAffiliationGroupColor ? taskAffiliationColor : colorPrimary;
  this.useLightOnPrimaryColor=Utilities.computeContrastBetweenColors(this.colorPrimary,Color.WHITE) > 3f;
  this.isActive=isActive;
  this.lockToThisTask=lockToTaskEnabled && lockToThisTask;
  this.lockToTaskEnabled=lockToTaskEnabled;
  this.icon=icon;
  this.iconFilename=iconFilename;
  this.bounds=bounds;
}

Fixed version (ground truth):
public Task(TaskKey key,int taskAffiliation,int taskAffiliationColor,String activityTitle,String contentDescription,Drawable activityIcon,int colorPrimary,boolean lockToThisTask,boolean lockToTaskEnabled,Bitmap icon,String iconFilename,Rect bounds){
  boolean isInAffiliationGroup=(taskAffiliation != key.id);
  boolean hasAffiliationGroupColor=isInAffiliationGroup && (taskAffiliationColor != 0);
  this.key=key;
  this.taskAffiliation=taskAffiliation;
  this.taskAffiliationColor=taskAffiliationColor;
  this.activityLabel=activityTitle;
  this.contentDescription=contentDescription;
  this.activityIcon=activityIcon;
  this.colorPrimary=hasAffiliationGroupColor ? taskAffiliationColor : colorPrimary;
  this.useLightOnPrimaryColor=Utilities.computeContrastBetweenColors(this.colorPrimary,Color.WHITE) > 3f;
  this.lockToThisTask=lockToTaskEnabled && lockToThisTask;
  this.lockToTaskEnabled=lockToTaskEnabled;
  this.icon=icon;
  this.iconFilename=iconFilename;
  this.bounds=bounds;
}
Program: 193257
Project: 193257
Buggy source:
/** 
 * Copies the other task. 
 */
public void copyFrom(Task o){
  this.key=o.key;
  this.taskAffiliation=o.taskAffiliation;
  this.taskAffiliationColor=o.taskAffiliationColor;
  this.activityLabel=o.activityLabel;
  this.contentDescription=o.contentDescription;
  this.activityIcon=o.activityIcon;
  this.colorPrimary=o.colorPrimary;
  this.useLightOnPrimaryColor=o.useLightOnPrimaryColor;
  this.isActive=o.isActive;
  this.lockToThisTask=o.lockToThisTask;
  this.lockToTaskEnabled=o.lockToTaskEnabled;
}

Fixed version (ground truth):
/** 
 * Copies the other task. 
 */
public void copyFrom(Task o){
  this.key=o.key;
  this.taskAffiliation=o.taskAffiliation;
  this.taskAffiliationColor=o.taskAffiliationColor;
  this.activityLabel=o.activityLabel;
  this.contentDescription=o.contentDescription;
  this.activityIcon=o.activityIcon;
  this.colorPrimary=o.colorPrimary;
  this.useLightOnPrimaryColor=o.useLightOnPrimaryColor;
  this.lockToThisTask=o.lockToThisTask;
  this.lockToTaskEnabled=o.lockToTaskEnabled;
}
Program: 193258
Project: 193258
Buggy source:
/** 
 * Handle screen pinning request.
 */
public final void onBusEvent(final ScreenPinningRequestEvent event){
  int processUser=event.systemServicesProxy.getProcessUser();
  if (event.systemServicesProxy.isSystemUser(processUser)) {
    mImpl.onStartScreenPinning(event.applicationContext);
  }
 else {
    postToSystemUser(new Runnable(){
      @Override public void run(){
        try {
          mCallbacksToSystemUser.startScreenPinning();
        }
 catch (        RemoteException e) {
          Log.e(TAG,"String_Node_Str",e);
        }
      }
    }
);
  }
}

Fixed version (ground truth):
/** 
 * Handle screen pinning request.
 */
public final void onBusEvent(final ScreenPinningRequestEvent event){
  int processUser=sSystemServicesProxy.getProcessUser();
  if (sSystemServicesProxy.isSystemUser(processUser)) {
    mImpl.onStartScreenPinning(event.applicationContext);
  }
 else {
    postToSystemUser(new Runnable(){
      @Override public void run(){
        try {
          mCallbacksToSystemUser.startScreenPinning();
        }
 catch (        RemoteException e) {
          Log.e(TAG,"String_Node_Str",e);
        }
      }
    }
);
  }
}
Program: 193259
Project: 193259
Buggy source:
@Override public void onAllTaskViewsDismissed(){
  mFinishLaunchHomeRunnable.run();
}

Fixed version (ground truth):
/** 
 * RecentsView.RecentsViewCallbacks Implementation 
 */
@Override public void onAllTaskViewsDismissed(){
  mFinishLaunchHomeRunnable.run();
}