nus-yam/ex-repair huggingface dataset:
Program: 195507
Project: 195507
Buggy source:
/** 
 * Remove any usage stat files that are too old.
 */
public void prune(final long currentTimeMillis){
synchronized (mLock) {
    mCal.setTimeInMillis(currentTimeMillis);
    mCal.addYears(-3);
    pruneFilesOlderThan(mIntervalDirs[UsageStatsManager.INTERVAL_YEARLY],mCal.getTimeInMillis());
    mCal.setTimeInMillis(currentTimeMillis);
    mCal.addMonths(-6);
    pruneFilesOlderThan(mIntervalDirs[UsageStatsManager.INTERVAL_MONTHLY],mCal.getTimeInMillis());
    mCal.setTimeInMillis(currentTimeMillis);
    mCal.addWeeks(-4);
    pruneFilesOlderThan(mIntervalDirs[UsageStatsManager.INTERVAL_WEEKLY],mCal.getTimeInMillis());
    mCal.setTimeInMillis(currentTimeMillis);
    mCal.addDays(-7);
    pruneFilesOlderThan(mIntervalDirs[UsageStatsManager.INTERVAL_DAILY],mCal.getTimeInMillis());
  }
}

Fixed version (ground truth):
/** 
 * Remove any usage stat files that are too old.
 */
public void prune(final long currentTimeMillis){
synchronized (mLock) {
    mCal.setTimeInMillis(currentTimeMillis);
    mCal.addYears(-3);
    pruneFilesOlderThan(mIntervalDirs[UsageStatsManager.INTERVAL_YEARLY],mCal.getTimeInMillis());
    mCal.setTimeInMillis(currentTimeMillis);
    mCal.addMonths(-6);
    pruneFilesOlderThan(mIntervalDirs[UsageStatsManager.INTERVAL_MONTHLY],mCal.getTimeInMillis());
    mCal.setTimeInMillis(currentTimeMillis);
    mCal.addWeeks(-4);
    pruneFilesOlderThan(mIntervalDirs[UsageStatsManager.INTERVAL_WEEKLY],mCal.getTimeInMillis());
    mCal.setTimeInMillis(currentTimeMillis);
    mCal.addDays(-7);
    pruneFilesOlderThan(mIntervalDirs[UsageStatsManager.INTERVAL_DAILY],mCal.getTimeInMillis());
    indexFilesLocked();
  }
}
Program: 195509
Project: 195509
Buggy source:
/** 
 * Remove any usage stat files that are too old.
 */
public void prune(final long currentTimeMillis){
synchronized (mLock) {
    mCal.setTimeInMillis(currentTimeMillis);
    mCal.addYears(-3);
    pruneFilesOlderThan(mIntervalDirs[UsageStatsManager.INTERVAL_YEARLY],mCal.getTimeInMillis());
    mCal.setTimeInMillis(currentTimeMillis);
    mCal.addMonths(-6);
    pruneFilesOlderThan(mIntervalDirs[UsageStatsManager.INTERVAL_MONTHLY],mCal.getTimeInMillis());
    mCal.setTimeInMillis(currentTimeMillis);
    mCal.addWeeks(-4);
    pruneFilesOlderThan(mIntervalDirs[UsageStatsManager.INTERVAL_WEEKLY],mCal.getTimeInMillis());
    mCal.setTimeInMillis(currentTimeMillis);
    mCal.addDays(-7);
    pruneFilesOlderThan(mIntervalDirs[UsageStatsManager.INTERVAL_DAILY],mCal.getTimeInMillis());
  }
}

Fixed version (ground truth):
/** 
 * Remove any usage stat files that are too old.
 */
public void prune(final long currentTimeMillis){
synchronized (mLock) {
    mCal.setTimeInMillis(currentTimeMillis);
    mCal.addYears(-3);
    pruneFilesOlderThan(mIntervalDirs[UsageStatsManager.INTERVAL_YEARLY],mCal.getTimeInMillis());
    mCal.setTimeInMillis(currentTimeMillis);
    mCal.addMonths(-6);
    pruneFilesOlderThan(mIntervalDirs[UsageStatsManager.INTERVAL_MONTHLY],mCal.getTimeInMillis());
    mCal.setTimeInMillis(currentTimeMillis);
    mCal.addWeeks(-4);
    pruneFilesOlderThan(mIntervalDirs[UsageStatsManager.INTERVAL_WEEKLY],mCal.getTimeInMillis());
    mCal.setTimeInMillis(currentTimeMillis);
    mCal.addDays(-7);
    pruneFilesOlderThan(mIntervalDirs[UsageStatsManager.INTERVAL_DAILY],mCal.getTimeInMillis());
    indexFilesLocked();
  }
}
Program: 195510
Project: 195510
Buggy source:
public void setLayer(int layer){
  mSurfaceControl.setLayer(layer);
}

Fixed version (ground truth):
void setLayer(int layer){
  if (mLayer == layer) {
    return;
  }
  mLayer=layer;
  mSurfaceControl.setLayer(mLayer);
}
Program: 195511
Project: 195511
Buggy source:
public FocusedStackFrame(Display display,SurfaceSession session){
  SurfaceControl ctrl=null;
  try {
    if (DEBUG_SURFACE_TRACE) {
      ctrl=new SurfaceTrace(session,"String_Node_Str",1,1,PixelFormat.TRANSLUCENT,SurfaceControl.HIDDEN);
    }
 else {
      ctrl=new SurfaceControl(session,"String_Node_Str",1,1,PixelFormat.TRANSLUCENT,SurfaceControl.HIDDEN);
    }
    ctrl.setLayerStack(display.getLayerStack());
    ctrl.setAlpha(ALPHA);
    mSurface.copyFrom(ctrl);
  }
 catch (  OutOfResourcesException e) {
  }
  mSurfaceControl=ctrl;
}

Fixed version (ground truth):
public FocusedStackFrame(Display display,SurfaceSession session){
  SurfaceControl ctrl=null;
  try {
    if (DEBUG_SURFACE_TRACE) {
      ctrl=new SurfaceTrace(session,"String_Node_Str",1,1,PixelFormat.TRANSLUCENT,SurfaceControl.HIDDEN);
    }
 else {
      ctrl=new SurfaceControl(session,"String_Node_Str",1,1,PixelFormat.TRANSLUCENT,SurfaceControl.HIDDEN);
    }
    ctrl.setLayerStack(display.getLayerStack());
    ctrl.setAlpha(ALPHA);
    mSurface.copyFrom(ctrl);
  }
 catch (  OutOfResourcesException e) {
  }
  mSurfaceControl=ctrl;
  mInnerPaint.setStyle(Paint.Style.STROKE);
  mInnerPaint.setStrokeWidth(THICKNESS);
  mInnerPaint.setColor(Color.WHITE);
  mOuterPaint.setStyle(Paint.Style.STROKE);
  mOuterPaint.setStrokeWidth(THICKNESS);
  mOuterPaint.setColor(Color.BLACK);
}
Program: 195512
Project: 195512
Buggy source:
private void draw(Rect bounds,int color){
  if (false && DEBUG_STACK)   Slog.i(TAG,"String_Node_Str" + bounds.toShortString() + "String_Node_Str"+ Integer.toHexString(color));
  mTmpDrawRect.set(bounds);
  Canvas c=null;
  try {
    c=mSurface.lockCanvas(mTmpDrawRect);
  }
 catch (  IllegalArgumentException e) {
  }
catch (  Surface.OutOfResourcesException e) {
  }
  if (c == null) {
    return;
  }
  final int w=bounds.width();
  final int h=bounds.height();
  mTmpDrawRect.set(0,0,w,THICKNESS);
  c.clipRect(mTmpDrawRect,Region.Op.REPLACE);
  c.drawColor(color);
  mTmpDrawRect.set(0,THICKNESS,THICKNESS,h - THICKNESS);
  c.clipRect(mTmpDrawRect,Region.Op.REPLACE);
  c.drawColor(color);
  mTmpDrawRect.set(w - THICKNESS,THICKNESS,w,h - THICKNESS);
  c.clipRect(mTmpDrawRect,Region.Op.REPLACE);
  c.drawColor(color);
  mTmpDrawRect.set(0,h - THICKNESS,w,h);
  c.clipRect(mTmpDrawRect,Region.Op.REPLACE);
  c.drawColor(color);
  mSurface.unlockCanvasAndPost(c);
}

Fixed version (ground truth):
private void draw(){
  if (mLastBounds.isEmpty()) {
    mLastBounds.set(mBounds);
  }
  if (DEBUG)   Slog.i(TAG,"String_Node_Str" + mBounds + "String_Node_Str"+ mLastBounds);
  Canvas c=null;
  try {
    c=mSurface.lockCanvas(mLastBounds);
  }
 catch (  IllegalArgumentException e) {
    Slog.e(TAG,"String_Node_Str",e);
  }
catch (  Surface.OutOfResourcesException e) {
    Slog.e(TAG,"String_Node_Str",e);
  }
  if (c == null) {
    if (DEBUG)     Slog.w(TAG,"String_Node_Str");
    return;
  }
  c.drawRect(0,0,mBounds.width(),mBounds.height(),mOuterPaint);
  c.drawRect(THICKNESS,THICKNESS,mBounds.width() - THICKNESS,mBounds.height() - THICKNESS,mInnerPaint);
  if (DEBUG)   Slog.w(TAG,"String_Node_Str" + c.getWidth() + "String_Node_Str"+ c.getHeight()+ "String_Node_Str"+ c.getClipBounds());
  mSurface.unlockCanvasAndPost(c);
  mLastBounds.set(mBounds);
}
Program: 195513
Project: 195513
Buggy source:
public void setVisibility(boolean on){
  if (false && DEBUG_STACK)   Slog.i(TAG,"String_Node_Str" + on + "String_Node_Str"+ mLastBounds.toShortString()+ "String_Node_Str"+ mBounds.toShortString());
  if (mSurfaceControl == null) {
    return;
  }
  if (on) {
    if (!mLastBounds.equals(mBounds)) {
      positionSurface(mLastBounds);
      draw(mLastBounds,Color.TRANSPARENT);
      positionSurface(mBounds);
      draw(mBounds,Color.WHITE);
      mLastBounds.set(mBounds);
    }
    mSurfaceControl.show();
  }
 else {
    mSurfaceControl.hide();
  }
}

Fixed version (ground truth):
void setVisibility(TaskStack stack){
  if (stack == null || stack.isFullscreen()) {
    setupSurface(false);
  }
 else {
    stack.getBounds(mBounds);
    setupSurface(true);
    if (!mBounds.equals(mLastBounds)) {
      draw();
    }
  }
}
Program: 195514
Project: 195514
Buggy source:
void setFocusedStackFrame(){
  final TaskStack stack;
  if (mFocusedApp != null) {
    final Task task=mFocusedApp.mTask;
    stack=task.mStack;
    final DisplayContent displayContent=task.getDisplayContent();
    if (displayContent != null) {
      displayContent.setTouchExcludeRegion(stack);
    }
  }
 else {
    stack=null;
  }
  if (SHOW_LIGHT_TRANSACTIONS)   Slog.i(TAG,"String_Node_Str");
  SurfaceControl.openTransaction();
  try {
    if (stack == null) {
      mFocusedStackFrame.setVisibility(false);
    }
 else {
      mFocusedStackFrame.setBounds(stack);
      final boolean multipleStacks=!stack.isFullscreen();
      mFocusedStackFrame.setVisibility(multipleStacks);
    }
  }
  finally {
    SurfaceControl.closeTransaction();
    if (SHOW_LIGHT_TRANSACTIONS)     Slog.i(TAG,"String_Node_Str");
  }
}

Fixed version (ground truth):
void setFocusedStackFrame(){
  final TaskStack stack;
  if (mFocusedApp != null) {
    final Task task=mFocusedApp.mTask;
    stack=task.mStack;
    final DisplayContent displayContent=task.getDisplayContent();
    if (displayContent != null) {
      displayContent.setTouchExcludeRegion(stack);
    }
  }
 else {
    stack=null;
  }
  mFocusedStackFrame.setVisibility(stack);
}
Program: 195515
Project: 195515
Buggy source:
public void setLayer(int layer){
  mSurfaceControl.setLayer(layer);
}

Fixed version (ground truth):
void setLayer(int layer){
  if (mLayer == layer) {
    return;
  }
  mLayer=layer;
  mSurfaceControl.setLayer(mLayer);
}
Program: 195516
Project: 195516
Buggy source:
public FocusedStackFrame(Display display,SurfaceSession session){
  SurfaceControl ctrl=null;
  try {
    if (DEBUG_SURFACE_TRACE) {
      ctrl=new SurfaceTrace(session,"String_Node_Str",1,1,PixelFormat.TRANSLUCENT,SurfaceControl.HIDDEN);
    }
 else {
      ctrl=new SurfaceControl(session,"String_Node_Str",1,1,PixelFormat.TRANSLUCENT,SurfaceControl.HIDDEN);
    }
    ctrl.setLayerStack(display.getLayerStack());
    ctrl.setAlpha(ALPHA);
    mSurface.copyFrom(ctrl);
  }
 catch (  OutOfResourcesException e) {
  }
  mSurfaceControl=ctrl;
}

Fixed version (ground truth):
public FocusedStackFrame(Display display,SurfaceSession session){
  SurfaceControl ctrl=null;
  try {
    if (DEBUG_SURFACE_TRACE) {
      ctrl=new SurfaceTrace(session,"String_Node_Str",1,1,PixelFormat.TRANSLUCENT,SurfaceControl.HIDDEN);
    }
 else {
      ctrl=new SurfaceControl(session,"String_Node_Str",1,1,PixelFormat.TRANSLUCENT,SurfaceControl.HIDDEN);
    }
    ctrl.setLayerStack(display.getLayerStack());
    ctrl.setAlpha(ALPHA);
    mSurface.copyFrom(ctrl);
  }
 catch (  OutOfResourcesException e) {
  }
  mSurfaceControl=ctrl;
  mInnerPaint.setStyle(Paint.Style.STROKE);
  mInnerPaint.setStrokeWidth(THICKNESS);
  mInnerPaint.setColor(Color.WHITE);
  mOuterPaint.setStyle(Paint.Style.STROKE);
  mOuterPaint.setStrokeWidth(THICKNESS);
  mOuterPaint.setColor(Color.BLACK);
}
Program: 195517
Project: 195517
Buggy source:
private void draw(Rect bounds,int color){
  if (false && DEBUG_STACK)   Slog.i(TAG,"String_Node_Str" + bounds.toShortString() + "String_Node_Str"+ Integer.toHexString(color));
  mTmpDrawRect.set(bounds);
  Canvas c=null;
  try {
    c=mSurface.lockCanvas(mTmpDrawRect);
  }
 catch (  IllegalArgumentException e) {
  }
catch (  Surface.OutOfResourcesException e) {
  }
  if (c == null) {
    return;
  }
  final int w=bounds.width();
  final int h=bounds.height();
  mTmpDrawRect.set(0,0,w,THICKNESS);
  c.clipRect(mTmpDrawRect,Region.Op.REPLACE);
  c.drawColor(color);
  mTmpDrawRect.set(0,THICKNESS,THICKNESS,h - THICKNESS);
  c.clipRect(mTmpDrawRect,Region.Op.REPLACE);
  c.drawColor(color);
  mTmpDrawRect.set(w - THICKNESS,THICKNESS,w,h - THICKNESS);
  c.clipRect(mTmpDrawRect,Region.Op.REPLACE);
  c.drawColor(color);
  mTmpDrawRect.set(0,h - THICKNESS,w,h);
  c.clipRect(mTmpDrawRect,Region.Op.REPLACE);
  c.drawColor(color);
  mSurface.unlockCanvasAndPost(c);
}

Fixed version (ground truth):
private void draw(){
  if (mLastBounds.isEmpty()) {
    mLastBounds.set(mBounds);
  }
  if (DEBUG)   Slog.i(TAG,"String_Node_Str" + mBounds + "String_Node_Str"+ mLastBounds);
  Canvas c=null;
  try {
    c=mSurface.lockCanvas(mLastBounds);
  }
 catch (  IllegalArgumentException e) {
    Slog.e(TAG,"String_Node_Str",e);
  }
catch (  Surface.OutOfResourcesException e) {
    Slog.e(TAG,"String_Node_Str",e);
  }
  if (c == null) {
    if (DEBUG)     Slog.w(TAG,"String_Node_Str");
    return;
  }
  c.drawRect(0,0,mBounds.width(),mBounds.height(),mOuterPaint);
  c.drawRect(THICKNESS,THICKNESS,mBounds.width() - THICKNESS,mBounds.height() - THICKNESS,mInnerPaint);
  if (DEBUG)   Slog.w(TAG,"String_Node_Str" + c.getWidth() + "String_Node_Str"+ c.getHeight()+ "String_Node_Str"+ c.getClipBounds());
  mSurface.unlockCanvasAndPost(c);
  mLastBounds.set(mBounds);
}
Program: 195518
Project: 195518
Buggy source:
public void setVisibility(boolean on){
  if (false && DEBUG_STACK)   Slog.i(TAG,"String_Node_Str" + on + "String_Node_Str"+ mLastBounds.toShortString()+ "String_Node_Str"+ mBounds.toShortString());
  if (mSurfaceControl == null) {
    return;
  }
  if (on) {
    if (!mLastBounds.equals(mBounds)) {
      positionSurface(mLastBounds);
      draw(mLastBounds,Color.TRANSPARENT);
      positionSurface(mBounds);
      draw(mBounds,Color.WHITE);
      mLastBounds.set(mBounds);
    }
    mSurfaceControl.show();
  }
 else {
    mSurfaceControl.hide();
  }
}

Fixed version (ground truth):
void setVisibility(TaskStack stack){
  if (stack == null || stack.isFullscreen()) {
    setupSurface(false);
  }
 else {
    stack.getBounds(mBounds);
    setupSurface(true);
    if (!mBounds.equals(mLastBounds)) {
      draw();
    }
  }
}
Program: 195519
Project: 195519
Buggy source:
void setFocusedStackFrame(){
  final TaskStack stack;
  if (mFocusedApp != null) {
    final Task task=mFocusedApp.mTask;
    stack=task.mStack;
    final DisplayContent displayContent=task.getDisplayContent();
    if (displayContent != null) {
      displayContent.setTouchExcludeRegion(stack);
    }
  }
 else {
    stack=null;
  }
  if (SHOW_LIGHT_TRANSACTIONS)   Slog.i(TAG,"String_Node_Str");
  SurfaceControl.openTransaction();
  try {
    if (stack == null) {
      mFocusedStackFrame.setVisibility(false);
    }
 else {
      mFocusedStackFrame.setBounds(stack);
      final boolean multipleStacks=!stack.isFullscreen();
      mFocusedStackFrame.setVisibility(multipleStacks);
    }
  }
  finally {
    SurfaceControl.closeTransaction();
    if (SHOW_LIGHT_TRANSACTIONS)     Slog.i(TAG,"String_Node_Str");
  }
}

Fixed version (ground truth):
void setFocusedStackFrame(){
  final TaskStack stack;
  if (mFocusedApp != null) {
    final Task task=mFocusedApp.mTask;
    stack=task.mStack;
    final DisplayContent displayContent=task.getDisplayContent();
    if (displayContent != null) {
      displayContent.setTouchExcludeRegion(stack);
    }
  }
 else {
    stack=null;
  }
  mFocusedStackFrame.setVisibility(stack);
}
Program: 195528
Project: 195528
Buggy source:
/** 
 * Has the given user chosen to allow their private (full) notifications to be shown even when the lockscreen is in "public" (secure & locked) mode?
 */
public boolean userAllowsPrivateNotificationsInPublic(int userHandle){
  if (userHandle == UserHandle.USER_ALL) {
    return true;
  }
  if (mUsersAllowingPrivateNotifications.indexOfKey(userHandle) < 0) {
    final boolean allowed=0 != Settings.Secure.getIntForUser(mContext.getContentResolver(),Settings.Secure.LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS,0,userHandle);
    final int dpmFlags=mDevicePolicyManager.getKeyguardDisabledFeatures(null,userHandle);
    final boolean allowedByDpm=(dpmFlags & DevicePolicyManager.KEYGUARD_DISABLE_UNREDACTED_NOTIFICATIONS) == 0;
    mUsersAllowingPrivateNotifications.append(userHandle,allowed && allowedByDpm);
    return allowed;
  }
  return mUsersAllowingPrivateNotifications.get(userHandle);
}

Fixed version (ground truth):
/** 
 * Has the given user chosen to allow their private (full) notifications to be shown even when the lockscreen is in "public" (secure & locked) mode?
 */
public boolean userAllowsPrivateNotificationsInPublic(int userHandle){
  if (userHandle == UserHandle.USER_ALL) {
    return true;
  }
  if (mUsersAllowingPrivateNotifications.indexOfKey(userHandle) < 0) {
    final boolean allowedByUser=0 != Settings.Secure.getIntForUser(mContext.getContentResolver(),Settings.Secure.LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS,0,userHandle);
    final int dpmFlags=mDevicePolicyManager.getKeyguardDisabledFeatures(null,userHandle);
    final boolean allowedByDpm=(dpmFlags & DevicePolicyManager.KEYGUARD_DISABLE_UNREDACTED_NOTIFICATIONS) == 0;
    final boolean allowed=allowedByUser && allowedByDpm;
    mUsersAllowingPrivateNotifications.append(userHandle,allowed);
    return allowed;
  }
  return mUsersAllowingPrivateNotifications.get(userHandle);
}
Program: 195529
Project: 195529
Buggy source:
/** 
 * Has the given user chosen to allow their private (full) notifications to be shown even when the lockscreen is in "public" (secure & locked) mode?
 */
public boolean userAllowsPrivateNotificationsInPublic(int userHandle){
  if (userHandle == UserHandle.USER_ALL) {
    return true;
  }
  if (mUsersAllowingPrivateNotifications.indexOfKey(userHandle) < 0) {
    final boolean allowed=0 != Settings.Secure.getIntForUser(mContext.getContentResolver(),Settings.Secure.LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS,0,userHandle);
    final int dpmFlags=mDevicePolicyManager.getKeyguardDisabledFeatures(null,userHandle);
    final boolean allowedByDpm=(dpmFlags & DevicePolicyManager.KEYGUARD_DISABLE_UNREDACTED_NOTIFICATIONS) == 0;
    mUsersAllowingPrivateNotifications.append(userHandle,allowed && allowedByDpm);
    return allowed;
  }
  return mUsersAllowingPrivateNotifications.get(userHandle);
}

Fixed version (ground truth):
/** 
 * Has the given user chosen to allow their private (full) notifications to be shown even when the lockscreen is in "public" (secure & locked) mode?
 */
public boolean userAllowsPrivateNotificationsInPublic(int userHandle){
  if (userHandle == UserHandle.USER_ALL) {
    return true;
  }
  if (mUsersAllowingPrivateNotifications.indexOfKey(userHandle) < 0) {
    final boolean allowedByUser=0 != Settings.Secure.getIntForUser(mContext.getContentResolver(),Settings.Secure.LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS,0,userHandle);
    final int dpmFlags=mDevicePolicyManager.getKeyguardDisabledFeatures(null,userHandle);
    final boolean allowedByDpm=(dpmFlags & DevicePolicyManager.KEYGUARD_DISABLE_UNREDACTED_NOTIFICATIONS) == 0;
    final boolean allowed=allowedByUser && allowedByDpm;
    mUsersAllowingPrivateNotifications.append(userHandle,allowed);
    return allowed;
  }
  return mUsersAllowingPrivateNotifications.get(userHandle);
}
Program: 195530
Project: 195530
Buggy source:
void resizeWindows(){
  final boolean underStatusBar=mBounds.top == 0;
  final ArrayList<WindowState> resizingWindows=mService.mResizingWindows;
  for (int taskNdx=mTasks.size() - 1; taskNdx >= 0; --taskNdx) {
    final ArrayList<AppWindowToken> activities=mTasks.get(taskNdx).mAppTokens;
    for (int activityNdx=activities.size() - 1; activityNdx >= 0; --activityNdx) {
      final ArrayList<WindowState> windows=activities.get(activityNdx).allAppWindows;
      for (int winNdx=windows.size() - 1; winNdx >= 0; --winNdx) {
        final WindowState win=windows.get(winNdx);
        if (!resizingWindows.contains(win)) {
          if (WindowManagerService.DEBUG_RESIZE)           Slog.d(TAG,"String_Node_Str" + win);
          resizingWindows.add(win);
        }
        win.mUnderStatusBar=underStatusBar;
      }
    }
  }
}

Fixed version (ground truth):
void resizeWindows(){
  final ArrayList<WindowState> resizingWindows=mService.mResizingWindows;
  for (int taskNdx=mTasks.size() - 1; taskNdx >= 0; --taskNdx) {
    final ArrayList<AppWindowToken> activities=mTasks.get(taskNdx).mAppTokens;
    for (int activityNdx=activities.size() - 1; activityNdx >= 0; --activityNdx) {
      final ArrayList<WindowState> windows=activities.get(activityNdx).allAppWindows;
      for (int winNdx=windows.size() - 1; winNdx >= 0; --winNdx) {
        final WindowState win=windows.get(winNdx);
        if (!resizingWindows.contains(win)) {
          if (WindowManagerService.DEBUG_RESIZE)           Slog.d(TAG,"String_Node_Str" + win);
          resizingWindows.add(win);
        }
      }
    }
  }
}
Program: 195531
Project: 195531
Buggy source:
/** 
 * Set the stack bounds. Passing in null sets the bounds to fullscreen. 
 */
boolean setBounds(Rect bounds){
  boolean oldFullscreen=mFullscreen;
  if (mDisplayContent != null) {
    mDisplayContent.getLogicalDisplayRect(mTmpRect);
    if (bounds == null) {
      bounds=mTmpRect;
      mFullscreen=true;
    }
 else {
      bounds.intersect(mTmpRect);
      mFullscreen=mTmpRect.equals(bounds);
    }
  }
  if (bounds == null) {
    return false;
  }
  if (mBounds.equals(bounds) && oldFullscreen == mFullscreen) {
    return false;
  }
  mDimLayer.setBounds(bounds);
  mAnimationBackgroundSurface.setBounds(bounds);
  mBounds.set(bounds);
  updateOverrideConfiguration();
  return true;
}

Fixed version (ground truth):
/** 
 * Set the stack bounds. Passing in null sets the bounds to fullscreen. 
 */
boolean setBounds(Rect bounds){
  boolean oldFullscreen=mFullscreen;
  if (mDisplayContent != null) {
    mDisplayContent.getLogicalDisplayRect(mTmpRect);
    if (bounds == null) {
      bounds=mTmpRect;
      mFullscreen=true;
    }
 else {
      bounds.intersect(mTmpRect);
      mFullscreen=mTmpRect.equals(bounds);
    }
  }
  if (bounds == null) {
    return false;
  }
  if (mBounds.equals(bounds) && oldFullscreen == mFullscreen) {
    return false;
  }
  mDimLayer.setBounds(bounds);
  mAnimationBackgroundSurface.setBounds(bounds);
  mBounds.set(bounds);
  mUnderStatusBar=(mBounds.top == 0);
  updateOverrideConfiguration();
  return true;
}
Program: 195532
Project: 195532
Buggy source:
TaskStack(WindowManagerService service,int stackId){
  mService=service;
  mStackId=stackId;
  mOverrideConfig=Configuration.EMPTY;
  mForceFullscreen=false;
  mPreForceFullscreenBounds=new Rect();
  EventLog.writeEvent(EventLogTags.WM_STACK_CREATED,stackId,mBounds.left,mBounds.top,mBounds.right,mBounds.bottom);
}

Fixed version (ground truth):
TaskStack(WindowManagerService service,int stackId){
  mService=service;
  mStackId=stackId;
  mOverrideConfig=Configuration.EMPTY;
  mForceFullscreen=false;
  mPreForceFullscreenBounds=new Rect();
  mUnderStatusBar=true;
  EventLog.writeEvent(EventLogTags.WM_STACK_CREATED,stackId,mBounds.left,mBounds.top,mBounds.right,mBounds.bottom);
}
Program: 195534
Project: 195534
Buggy source:
private void getStackBounds(TaskStack stack,Rect bounds){
  if (stack != null) {
    stack.getBounds(bounds);
    return;
  }
  bounds.set(mFrame);
}

Fixed version (ground truth):
void getStackBounds(Rect bounds){
  final TaskStack stack=getStack();
  if (stack != null) {
    stack.getBounds(bounds);
    return;
  }
  bounds.set(mFrame);
}
Program: 195535
Project: 195535
Buggy source:
void resizeWindows(){
  final boolean underStatusBar=mBounds.top == 0;
  final ArrayList<WindowState> resizingWindows=mService.mResizingWindows;
  for (int taskNdx=mTasks.size() - 1; taskNdx >= 0; --taskNdx) {
    final ArrayList<AppWindowToken> activities=mTasks.get(taskNdx).mAppTokens;
    for (int activityNdx=activities.size() - 1; activityNdx >= 0; --activityNdx) {
      final ArrayList<WindowState> windows=activities.get(activityNdx).allAppWindows;
      for (int winNdx=windows.size() - 1; winNdx >= 0; --winNdx) {
        final WindowState win=windows.get(winNdx);
        if (!resizingWindows.contains(win)) {
          if (WindowManagerService.DEBUG_RESIZE)           Slog.d(TAG,"String_Node_Str" + win);
          resizingWindows.add(win);
        }
        win.mUnderStatusBar=underStatusBar;
      }
    }
  }
}

Fixed version (ground truth):
void resizeWindows(){
  final ArrayList<WindowState> resizingWindows=mService.mResizingWindows;
  for (int taskNdx=mTasks.size() - 1; taskNdx >= 0; --taskNdx) {
    final ArrayList<AppWindowToken> activities=mTasks.get(taskNdx).mAppTokens;
    for (int activityNdx=activities.size() - 1; activityNdx >= 0; --activityNdx) {
      final ArrayList<WindowState> windows=activities.get(activityNdx).allAppWindows;
      for (int winNdx=windows.size() - 1; winNdx >= 0; --winNdx) {
        final WindowState win=windows.get(winNdx);
        if (!resizingWindows.contains(win)) {
          if (WindowManagerService.DEBUG_RESIZE)           Slog.d(TAG,"String_Node_Str" + win);
          resizingWindows.add(win);
        }
      }
    }
  }
}
Program: 195536
Project: 195536
Buggy source:
/** 
 * Set the stack bounds. Passing in null sets the bounds to fullscreen. 
 */
boolean setBounds(Rect bounds){
  boolean oldFullscreen=mFullscreen;
  if (mDisplayContent != null) {
    mDisplayContent.getLogicalDisplayRect(mTmpRect);
    if (bounds == null) {
      bounds=mTmpRect;
      mFullscreen=true;
    }
 else {
      bounds.intersect(mTmpRect);
      mFullscreen=mTmpRect.equals(bounds);
    }
  }
  if (bounds == null) {
    return false;
  }
  if (mBounds.equals(bounds) && oldFullscreen == mFullscreen) {
    return false;
  }
  mDimLayer.setBounds(bounds);
  mAnimationBackgroundSurface.setBounds(bounds);
  mBounds.set(bounds);
  updateOverrideConfiguration();
  return true;
}

Fixed version (ground truth):
/** 
 * Set the stack bounds. Passing in null sets the bounds to fullscreen. 
 */
boolean setBounds(Rect bounds){
  boolean oldFullscreen=mFullscreen;
  if (mDisplayContent != null) {
    mDisplayContent.getLogicalDisplayRect(mTmpRect);
    if (bounds == null) {
      bounds=mTmpRect;
      mFullscreen=true;
    }
 else {
      bounds.intersect(mTmpRect);
      mFullscreen=mTmpRect.equals(bounds);
    }
  }
  if (bounds == null) {
    return false;
  }
  if (mBounds.equals(bounds) && oldFullscreen == mFullscreen) {
    return false;
  }
  mDimLayer.setBounds(bounds);
  mAnimationBackgroundSurface.setBounds(bounds);
  mBounds.set(bounds);
  mUnderStatusBar=(mBounds.top == 0);
  updateOverrideConfiguration();
  return true;
}
Program: 195537
Project: 195537
Buggy source:
TaskStack(WindowManagerService service,int stackId){
  mService=service;
  mStackId=stackId;
  mOverrideConfig=Configuration.EMPTY;
  mForceFullscreen=false;
  mPreForceFullscreenBounds=new Rect();
  EventLog.writeEvent(EventLogTags.WM_STACK_CREATED,stackId,mBounds.left,mBounds.top,mBounds.right,mBounds.bottom);
}

Fixed version (ground truth):
TaskStack(WindowManagerService service,int stackId){
  mService=service;
  mStackId=stackId;
  mOverrideConfig=Configuration.EMPTY;
  mForceFullscreen=false;
  mPreForceFullscreenBounds=new Rect();
  mUnderStatusBar=true;
  EventLog.writeEvent(EventLogTags.WM_STACK_CREATED,stackId,mBounds.left,mBounds.top,mBounds.right,mBounds.bottom);
}
Program: 195539
Project: 195539
Buggy source:
private void getStackBounds(TaskStack stack,Rect bounds){
  if (stack != null) {
    stack.getBounds(bounds);
    return;
  }
  bounds.set(mFrame);
}

Fixed version (ground truth):
void getStackBounds(Rect bounds){
  final TaskStack stack=getStack();
  if (stack != null) {
    stack.getBounds(bounds);
    return;
  }
  bounds.set(mFrame);
}
Program: 195541
Project: 195541
Buggy source:
public void setDual(boolean dual){
  final boolean changed=dual != mDual;
  mDual=dual;
  if (changed) {
    recreateLabel();
  }
  if (mTileBackground instanceof RippleDrawable) {
    setRipple((RippleDrawable)mTileBackground);
  }
  if (dual) {
    mTopBackgroundView.setOnClickListener(mClickPrimary);
    setOnClickListener(null);
    setClickable(false);
    setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO);
    mTopBackgroundView.setBackground(mTileBackground);
  }
 else {
    mTopBackgroundView.setOnClickListener(null);
    mTopBackgroundView.setClickable(false);
    setOnClickListener(mClickPrimary);
    setOnLongClickListener(mLongClick);
    setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES);
    setBackground(mTileBackground);
  }
  mTopBackgroundView.setFocusable(dual);
  setFocusable(!dual);
  mDivider.setVisibility(dual ? VISIBLE : GONE);
  postInvalidate();
}

Fixed version (ground truth):
public boolean setDual(boolean dual){
  final boolean changed=dual != mDual;
  mDual=dual;
  if (changed) {
    recreateLabel();
  }
  if (mTileBackground instanceof RippleDrawable) {
    setRipple((RippleDrawable)mTileBackground);
  }
  if (dual) {
    mTopBackgroundView.setOnClickListener(mClickPrimary);
    setOnClickListener(null);
    setClickable(false);
    setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO);
    mTopBackgroundView.setBackground(mTileBackground);
  }
 else {
    mTopBackgroundView.setOnClickListener(null);
    mTopBackgroundView.setClickable(false);
    setOnClickListener(mClickPrimary);
    setOnLongClickListener(mLongClick);
    setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES);
    setBackground(mTileBackground);
  }
  mTopBackgroundView.setFocusable(dual);
  setFocusable(!dual);
  mDivider.setVisibility(dual ? VISIBLE : GONE);
  postInvalidate();
  return changed;
}
Program: 195543
Project: 195543
Buggy source:
public void setDual(boolean dual){
  final boolean changed=dual != mDual;
  mDual=dual;
  if (changed) {
    recreateLabel();
  }
  if (mTileBackground instanceof RippleDrawable) {
    setRipple((RippleDrawable)mTileBackground);
  }
  if (dual) {
    mTopBackgroundView.setOnClickListener(mClickPrimary);
    setOnClickListener(null);
    setClickable(false);
    setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO);
    mTopBackgroundView.setBackground(mTileBackground);
  }
 else {
    mTopBackgroundView.setOnClickListener(null);
    mTopBackgroundView.setClickable(false);
    setOnClickListener(mClickPrimary);
    setOnLongClickListener(mLongClick);
    setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES);
    setBackground(mTileBackground);
  }
  mTopBackgroundView.setFocusable(dual);
  setFocusable(!dual);
  mDivider.setVisibility(dual ? VISIBLE : GONE);
  postInvalidate();
}

Fixed version (ground truth):
public boolean setDual(boolean dual){
  final boolean changed=dual != mDual;
  mDual=dual;
  if (changed) {
    recreateLabel();
  }
  if (mTileBackground instanceof RippleDrawable) {
    setRipple((RippleDrawable)mTileBackground);
  }
  if (dual) {
    mTopBackgroundView.setOnClickListener(mClickPrimary);
    setOnClickListener(null);
    setClickable(false);
    setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO);
    mTopBackgroundView.setBackground(mTileBackground);
  }
 else {
    mTopBackgroundView.setOnClickListener(null);
    mTopBackgroundView.setClickable(false);
    setOnClickListener(mClickPrimary);
    setOnLongClickListener(mLongClick);
    setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES);
    setBackground(mTileBackground);
  }
  mTopBackgroundView.setFocusable(dual);
  setFocusable(!dual);
  mDivider.setVisibility(dual ? VISIBLE : GONE);
  postInvalidate();
  return changed;
}
Program: 195545
Project: 195545
Buggy source:
public void setDual(boolean dual){
  final boolean changed=dual != mDual;
  mDual=dual;
  if (changed) {
    recreateLabel();
  }
  if (mTileBackground instanceof RippleDrawable) {
    setRipple((RippleDrawable)mTileBackground);
  }
  if (dual) {
    mTopBackgroundView.setOnClickListener(mClickPrimary);
    setOnClickListener(null);
    setClickable(false);
    setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO);
    mTopBackgroundView.setBackground(mTileBackground);
  }
 else {
    mTopBackgroundView.setOnClickListener(null);
    mTopBackgroundView.setClickable(false);
    setOnClickListener(mClickPrimary);
    setOnLongClickListener(mLongClick);
    setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES);
    setBackground(mTileBackground);
  }
  mTopBackgroundView.setFocusable(dual);
  setFocusable(!dual);
  mDivider.setVisibility(dual ? VISIBLE : GONE);
  postInvalidate();
}

Fixed version (ground truth):
public boolean setDual(boolean dual){
  final boolean changed=dual != mDual;
  mDual=dual;
  if (changed) {
    recreateLabel();
  }
  if (mTileBackground instanceof RippleDrawable) {
    setRipple((RippleDrawable)mTileBackground);
  }
  if (dual) {
    mTopBackgroundView.setOnClickListener(mClickPrimary);
    setOnClickListener(null);
    setClickable(false);
    setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO);
    mTopBackgroundView.setBackground(mTileBackground);
  }
 else {
    mTopBackgroundView.setOnClickListener(null);
    mTopBackgroundView.setClickable(false);
    setOnClickListener(mClickPrimary);
    setOnLongClickListener(mLongClick);
    setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES);
    setBackground(mTileBackground);
  }
  mTopBackgroundView.setFocusable(dual);
  setFocusable(!dual);
  mDivider.setVisibility(dual ? VISIBLE : GONE);
  postInvalidate();
  return changed;
}
Program: 195547
Project: 195547
Buggy source:
public void setDual(boolean dual){
  final boolean changed=dual != mDual;
  mDual=dual;
  if (changed) {
    recreateLabel();
  }
  if (mTileBackground instanceof RippleDrawable) {
    setRipple((RippleDrawable)mTileBackground);
  }
  if (dual) {
    mTopBackgroundView.setOnClickListener(mClickPrimary);
    setOnClickListener(null);
    setClickable(false);
    setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO);
    mTopBackgroundView.setBackground(mTileBackground);
  }
 else {
    mTopBackgroundView.setOnClickListener(null);
    mTopBackgroundView.setClickable(false);
    setOnClickListener(mClickPrimary);
    setOnLongClickListener(mLongClick);
    setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES);
    setBackground(mTileBackground);
  }
  mTopBackgroundView.setFocusable(dual);
  setFocusable(!dual);
  mDivider.setVisibility(dual ? VISIBLE : GONE);
  postInvalidate();
}

Fixed version (ground truth):
public boolean setDual(boolean dual){
  final boolean changed=dual != mDual;
  mDual=dual;
  if (changed) {
    recreateLabel();
  }
  if (mTileBackground instanceof RippleDrawable) {
    setRipple((RippleDrawable)mTileBackground);
  }
  if (dual) {
    mTopBackgroundView.setOnClickListener(mClickPrimary);
    setOnClickListener(null);
    setClickable(false);
    setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO);
    mTopBackgroundView.setBackground(mTileBackground);
  }
 else {
    mTopBackgroundView.setOnClickListener(null);
    mTopBackgroundView.setClickable(false);
    setOnClickListener(mClickPrimary);
    setOnLongClickListener(mLongClick);
    setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES);
    setBackground(mTileBackground);
  }
  mTopBackgroundView.setFocusable(dual);
  setFocusable(!dual);
  mDivider.setVisibility(dual ? VISIBLE : GONE);
  postInvalidate();
  return changed;
}
Program: 195549
Project: 195549
Buggy source:
public void setDual(boolean dual){
  final boolean changed=dual != mDual;
  mDual=dual;
  if (changed) {
    recreateLabel();
  }
  if (mTileBackground instanceof RippleDrawable) {
    setRipple((RippleDrawable)mTileBackground);
  }
  if (dual) {
    mTopBackgroundView.setOnClickListener(mClickPrimary);
    setOnClickListener(null);
    setClickable(false);
    setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO);
    mTopBackgroundView.setBackground(mTileBackground);
  }
 else {
    mTopBackgroundView.setOnClickListener(null);
    mTopBackgroundView.setClickable(false);
    setOnClickListener(mClickPrimary);
    setOnLongClickListener(mLongClick);
    setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES);
    setBackground(mTileBackground);
  }
  mTopBackgroundView.setFocusable(dual);
  setFocusable(!dual);
  mDivider.setVisibility(dual ? VISIBLE : GONE);
  postInvalidate();
}

Fixed version (ground truth):
public boolean setDual(boolean dual){
  final boolean changed=dual != mDual;
  mDual=dual;
  if (changed) {
    recreateLabel();
  }
  if (mTileBackground instanceof RippleDrawable) {
    setRipple((RippleDrawable)mTileBackground);
  }
  if (dual) {
    mTopBackgroundView.setOnClickListener(mClickPrimary);
    setOnClickListener(null);
    setClickable(false);
    setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO);
    mTopBackgroundView.setBackground(mTileBackground);
  }
 else {
    mTopBackgroundView.setOnClickListener(null);
    mTopBackgroundView.setClickable(false);
    setOnClickListener(mClickPrimary);
    setOnLongClickListener(mLongClick);
    setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES);
    setBackground(mTileBackground);
  }
  mTopBackgroundView.setFocusable(dual);
  setFocusable(!dual);
  mDivider.setVisibility(dual ? VISIBLE : GONE);
  postInvalidate();
  return changed;
}
Program: 195551
Project: 195551
Buggy source:
public void setDual(boolean dual){
  final boolean changed=dual != mDual;
  mDual=dual;
  if (changed) {
    recreateLabel();
  }
  if (mTileBackground instanceof RippleDrawable) {
    setRipple((RippleDrawable)mTileBackground);
  }
  if (dual) {
    mTopBackgroundView.setOnClickListener(mClickPrimary);
    setOnClickListener(null);
    setClickable(false);
    setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO);
    mTopBackgroundView.setBackground(mTileBackground);
  }
 else {
    mTopBackgroundView.setOnClickListener(null);
    mTopBackgroundView.setClickable(false);
    setOnClickListener(mClickPrimary);
    setOnLongClickListener(mLongClick);
    setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES);
    setBackground(mTileBackground);
  }
  mTopBackgroundView.setFocusable(dual);
  setFocusable(!dual);
  mDivider.setVisibility(dual ? VISIBLE : GONE);
  postInvalidate();
}

Fixed version (ground truth):
public boolean setDual(boolean dual){
  final boolean changed=dual != mDual;
  mDual=dual;
  if (changed) {
    recreateLabel();
  }
  if (mTileBackground instanceof RippleDrawable) {
    setRipple((RippleDrawable)mTileBackground);
  }
  if (dual) {
    mTopBackgroundView.setOnClickListener(mClickPrimary);
    setOnClickListener(null);
    setClickable(false);
    setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO);
    mTopBackgroundView.setBackground(mTileBackground);
  }
 else {
    mTopBackgroundView.setOnClickListener(null);
    mTopBackgroundView.setClickable(false);
    setOnClickListener(mClickPrimary);
    setOnLongClickListener(mLongClick);
    setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES);
    setBackground(mTileBackground);
  }
  mTopBackgroundView.setFocusable(dual);
  setFocusable(!dual);
  mDivider.setVisibility(dual ? VISIBLE : GONE);
  postInvalidate();
  return changed;
}
Program: 195553
Project: 195553
Buggy source:
public void setDual(boolean dual){
  final boolean changed=dual != mDual;
  mDual=dual;
  if (changed) {
    recreateLabel();
  }
  if (mTileBackground instanceof RippleDrawable) {
    setRipple((RippleDrawable)mTileBackground);
  }
  if (dual) {
    mTopBackgroundView.setOnClickListener(mClickPrimary);
    setOnClickListener(null);
    setClickable(false);
    setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO);
    mTopBackgroundView.setBackground(mTileBackground);
  }
 else {
    mTopBackgroundView.setOnClickListener(null);
    mTopBackgroundView.setClickable(false);
    setOnClickListener(mClickPrimary);
    setOnLongClickListener(mLongClick);
    setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES);
    setBackground(mTileBackground);
  }
  mTopBackgroundView.setFocusable(dual);
  setFocusable(!dual);
  mDivider.setVisibility(dual ? VISIBLE : GONE);
  postInvalidate();
}

Fixed version (ground truth):
public boolean setDual(boolean dual){
  final boolean changed=dual != mDual;
  mDual=dual;
  if (changed) {
    recreateLabel();
  }
  if (mTileBackground instanceof RippleDrawable) {
    setRipple((RippleDrawable)mTileBackground);
  }
  if (dual) {
    mTopBackgroundView.setOnClickListener(mClickPrimary);
    setOnClickListener(null);
    setClickable(false);
    setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO);
    mTopBackgroundView.setBackground(mTileBackground);
  }
 else {
    mTopBackgroundView.setOnClickListener(null);
    mTopBackgroundView.setClickable(false);
    setOnClickListener(mClickPrimary);
    setOnLongClickListener(mLongClick);
    setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES);
    setBackground(mTileBackground);
  }
  mTopBackgroundView.setFocusable(dual);
  setFocusable(!dual);
  mDivider.setVisibility(dual ? VISIBLE : GONE);
  postInvalidate();
  return changed;
}
Program: 195554
Project: 195554
Buggy source:
@Override public HdmiDeviceInfo getActiveSource(){
  enforceAccessPermission();
  HdmiCecLocalDeviceTv tv=tv();
  if (tv == null) {
    Slog.w(TAG,"String_Node_Str");
    return null;
  }
  ActiveSource activeSource=tv.getActiveSource();
  if (activeSource.isValid()) {
    return new HdmiDeviceInfo(activeSource.logicalAddress,activeSource.physicalAddress,HdmiDeviceInfo.PORT_INVALID,HdmiDeviceInfo.DEVICE_INACTIVE,0,"String_Node_Str");
  }
  int activePath=tv.getActivePath();
  if (activePath != HdmiDeviceInfo.PATH_INVALID) {
    HdmiDeviceInfo info=tv.getDeviceInfoByPath(activePath);
    return (info != null) ? info : new HdmiDeviceInfo(activePath,tv.getActivePortId());
  }
  return null;
}

Fixed version (ground truth):
@Override public HdmiDeviceInfo getActiveSource(){
  enforceAccessPermission();
  HdmiCecLocalDeviceTv tv=tv();
  if (tv == null) {
    Slog.w(TAG,"String_Node_Str");
    return null;
  }
  ActiveSource activeSource=tv.getActiveSource();
  if (activeSource.isValid()) {
    return new HdmiDeviceInfo(activeSource.logicalAddress,activeSource.physicalAddress,HdmiDeviceInfo.PORT_INVALID,HdmiDeviceInfo.DEVICE_INACTIVE,0,"String_Node_Str");
  }
  int activePath=tv.getActivePath();
  if (activePath != HdmiDeviceInfo.PATH_INVALID) {
    HdmiDeviceInfo info=tv.getSafeDeviceInfoByPath(activePath);
    return (info != null) ? info : new HdmiDeviceInfo(activePath,tv.getActivePortId());
  }
  return null;
}
Program: 195555
Project: 195555
Buggy source:
@Override public HdmiDeviceInfo getActiveSource(){
  enforceAccessPermission();
  HdmiCecLocalDeviceTv tv=tv();
  if (tv == null) {
    Slog.w(TAG,"String_Node_Str");
    return null;
  }
  ActiveSource activeSource=tv.getActiveSource();
  if (activeSource.isValid()) {
    return new HdmiDeviceInfo(activeSource.logicalAddress,activeSource.physicalAddress,HdmiDeviceInfo.PORT_INVALID,HdmiDeviceInfo.DEVICE_INACTIVE,0,"String_Node_Str");
  }
  int activePath=tv.getActivePath();
  if (activePath != HdmiDeviceInfo.PATH_INVALID) {
    HdmiDeviceInfo info=tv.getDeviceInfoByPath(activePath);
    return (info != null) ? info : new HdmiDeviceInfo(activePath,tv.getActivePortId());
  }
  return null;
}

Fixed version (ground truth):
@Override public HdmiDeviceInfo getActiveSource(){
  enforceAccessPermission();
  HdmiCecLocalDeviceTv tv=tv();
  if (tv == null) {
    Slog.w(TAG,"String_Node_Str");
    return null;
  }
  ActiveSource activeSource=tv.getActiveSource();
  if (activeSource.isValid()) {
    return new HdmiDeviceInfo(activeSource.logicalAddress,activeSource.physicalAddress,HdmiDeviceInfo.PORT_INVALID,HdmiDeviceInfo.DEVICE_INACTIVE,0,"String_Node_Str");
  }
  int activePath=tv.getActivePath();
  if (activePath != HdmiDeviceInfo.PATH_INVALID) {
    HdmiDeviceInfo info=tv.getSafeDeviceInfoByPath(activePath);
    return (info != null) ? info : new HdmiDeviceInfo(activePath,tv.getActivePortId());
  }
  return null;
}
Program: 195556
Project: 195556
Buggy source:
@Override public HdmiDeviceInfo getActiveSource(){
  enforceAccessPermission();
  HdmiCecLocalDeviceTv tv=tv();
  if (tv == null) {
    Slog.w(TAG,"String_Node_Str");
    return null;
  }
  ActiveSource activeSource=tv.getActiveSource();
  if (activeSource.isValid()) {
    return new HdmiDeviceInfo(activeSource.logicalAddress,activeSource.physicalAddress,HdmiDeviceInfo.PORT_INVALID,HdmiDeviceInfo.DEVICE_INACTIVE,0,"String_Node_Str");
  }
  int activePath=tv.getActivePath();
  if (activePath != HdmiDeviceInfo.PATH_INVALID) {
    HdmiDeviceInfo info=tv.getDeviceInfoByPath(activePath);
    return (info != null) ? info : new HdmiDeviceInfo(activePath,tv.getActivePortId());
  }
  return null;
}

Fixed version (ground truth):
@Override public HdmiDeviceInfo getActiveSource(){
  enforceAccessPermission();
  HdmiCecLocalDeviceTv tv=tv();
  if (tv == null) {
    Slog.w(TAG,"String_Node_Str");
    return null;
  }
  ActiveSource activeSource=tv.getActiveSource();
  if (activeSource.isValid()) {
    return new HdmiDeviceInfo(activeSource.logicalAddress,activeSource.physicalAddress,HdmiDeviceInfo.PORT_INVALID,HdmiDeviceInfo.DEVICE_INACTIVE,0,"String_Node_Str");
  }
  int activePath=tv.getActivePath();
  if (activePath != HdmiDeviceInfo.PATH_INVALID) {
    HdmiDeviceInfo info=tv.getSafeDeviceInfoByPath(activePath);
    return (info != null) ? info : new HdmiDeviceInfo(activePath,tv.getActivePortId());
  }
  return null;
}
Program: 195557
Project: 195557
Buggy source:
@Override public HdmiDeviceInfo getActiveSource(){
  enforceAccessPermission();
  HdmiCecLocalDeviceTv tv=tv();
  if (tv == null) {
    Slog.w(TAG,"String_Node_Str");
    return null;
  }
  ActiveSource activeSource=tv.getActiveSource();
  if (activeSource.isValid()) {
    return new HdmiDeviceInfo(activeSource.logicalAddress,activeSource.physicalAddress,HdmiDeviceInfo.PORT_INVALID,HdmiDeviceInfo.DEVICE_INACTIVE,0,"String_Node_Str");
  }
  int activePath=tv.getActivePath();
  if (activePath != HdmiDeviceInfo.PATH_INVALID) {
    HdmiDeviceInfo info=tv.getDeviceInfoByPath(activePath);
    return (info != null) ? info : new HdmiDeviceInfo(activePath,tv.getActivePortId());
  }
  return null;
}

Fixed version (ground truth):
@Override public HdmiDeviceInfo getActiveSource(){
  enforceAccessPermission();
  HdmiCecLocalDeviceTv tv=tv();
  if (tv == null) {
    Slog.w(TAG,"String_Node_Str");
    return null;
  }
  ActiveSource activeSource=tv.getActiveSource();
  if (activeSource.isValid()) {
    return new HdmiDeviceInfo(activeSource.logicalAddress,activeSource.physicalAddress,HdmiDeviceInfo.PORT_INVALID,HdmiDeviceInfo.DEVICE_INACTIVE,0,"String_Node_Str");
  }
  int activePath=tv.getActivePath();
  if (activePath != HdmiDeviceInfo.PATH_INVALID) {
    HdmiDeviceInfo info=tv.getSafeDeviceInfoByPath(activePath);
    return (info != null) ? info : new HdmiDeviceInfo(activePath,tv.getActivePortId());
  }
  return null;
}
Program: 195558
Project: 195558
Buggy source:
@Override public HdmiDeviceInfo getActiveSource(){
  enforceAccessPermission();
  HdmiCecLocalDeviceTv tv=tv();
  if (tv == null) {
    Slog.w(TAG,"String_Node_Str");
    return null;
  }
  ActiveSource activeSource=tv.getActiveSource();
  if (activeSource.isValid()) {
    return new HdmiDeviceInfo(activeSource.logicalAddress,activeSource.physicalAddress,HdmiDeviceInfo.PORT_INVALID,HdmiDeviceInfo.DEVICE_INACTIVE,0,"String_Node_Str");
  }
  int activePath=tv.getActivePath();
  if (activePath != HdmiDeviceInfo.PATH_INVALID) {
    HdmiDeviceInfo info=tv.getDeviceInfoByPath(activePath);
    return (info != null) ? info : new HdmiDeviceInfo(activePath,tv.getActivePortId());
  }
  return null;
}

Fixed version (ground truth):
@Override public HdmiDeviceInfo getActiveSource(){
  enforceAccessPermission();
  HdmiCecLocalDeviceTv tv=tv();
  if (tv == null) {
    Slog.w(TAG,"String_Node_Str");
    return null;
  }
  ActiveSource activeSource=tv.getActiveSource();
  if (activeSource.isValid()) {
    return new HdmiDeviceInfo(activeSource.logicalAddress,activeSource.physicalAddress,HdmiDeviceInfo.PORT_INVALID,HdmiDeviceInfo.DEVICE_INACTIVE,0,"String_Node_Str");
  }
  int activePath=tv.getActivePath();
  if (activePath != HdmiDeviceInfo.PATH_INVALID) {
    HdmiDeviceInfo info=tv.getSafeDeviceInfoByPath(activePath);
    return (info != null) ? info : new HdmiDeviceInfo(activePath,tv.getActivePortId());
  }
  return null;
}