nus-yam/ex-repair huggingface dataset:
Program: 197798
Project: 197798
Buggy source:
protected SwipeHelper.LongPressListener getNotificationLongClicker(){
  return new SwipeHelper.LongPressListener(){
    @Override public boolean onLongPress(    View v,    int x,    int y){
      dismissPopups();
      if (v.getWindowToken() == null)       return false;
      final NotificationGuts guts=(NotificationGuts)v.findViewById(R.id.notification_guts);
      if (guts == null)       return false;
      if (guts.getVisibility() == View.VISIBLE)       return false;
      guts.setVisibility(View.VISIBLE);
      final double horz=Math.max(guts.getWidth() - x,x);
      final double vert=Math.max(guts.getActualHeight() - y,y);
      final float r=(float)Math.hypot(horz,vert);
      final Animator a=ViewAnimationUtils.createCircularReveal(guts,x,y,0,r);
      a.setDuration(400);
      a.setInterpolator(mLinearOutSlowIn);
      a.start();
      mNotificationGutsExposed=guts;
      return true;
    }
  }
;
}

Fixed version (ground truth):
protected SwipeHelper.LongPressListener getNotificationLongClicker(){
  return new SwipeHelper.LongPressListener(){
    @Override public boolean onLongPress(    View v,    int x,    int y){
      dismissPopups();
      if (v.getWindowToken() == null) {
        Log.e(TAG,"String_Node_Str");
        return false;
      }
      final NotificationGuts guts=(NotificationGuts)v.findViewById(R.id.notification_guts);
      if (guts.getVisibility() == View.VISIBLE) {
        Log.e(TAG,"String_Node_Str");
        return false;
      }
      guts.setVisibility(View.VISIBLE);
      final double horz=Math.max(guts.getWidth() - x,x);
      final double vert=Math.max(guts.getActualHeight() - y,y);
      final float r=(float)Math.hypot(horz,vert);
      final Animator a=ViewAnimationUtils.createCircularReveal(guts,x,y,0,r);
      a.setDuration(400);
      a.setInterpolator(mLinearOutSlowIn);
      a.start();
      mNotificationGutsExposed=guts;
      return true;
    }
  }
;
}
Program: 197799
Project: 197799
Buggy source:
@Override public boolean onLongPress(View v,int x,int y){
  dismissPopups();
  if (v.getWindowToken() == null)   return false;
  final NotificationGuts guts=(NotificationGuts)v.findViewById(R.id.notification_guts);
  if (guts == null)   return false;
  if (guts.getVisibility() == View.VISIBLE)   return false;
  guts.setVisibility(View.VISIBLE);
  final double horz=Math.max(guts.getWidth() - x,x);
  final double vert=Math.max(guts.getActualHeight() - y,y);
  final float r=(float)Math.hypot(horz,vert);
  final Animator a=ViewAnimationUtils.createCircularReveal(guts,x,y,0,r);
  a.setDuration(400);
  a.setInterpolator(mLinearOutSlowIn);
  a.start();
  mNotificationGutsExposed=guts;
  return true;
}

Fixed version (ground truth):
@Override public boolean onLongPress(View v,int x,int y){
  dismissPopups();
  if (v.getWindowToken() == null) {
    Log.e(TAG,"String_Node_Str");
    return false;
  }
  final NotificationGuts guts=(NotificationGuts)v.findViewById(R.id.notification_guts);
  if (guts.getVisibility() == View.VISIBLE) {
    Log.e(TAG,"String_Node_Str");
    return false;
  }
  guts.setVisibility(View.VISIBLE);
  final double horz=Math.max(guts.getWidth() - x,x);
  final double vert=Math.max(guts.getActualHeight() - y,y);
  final float r=(float)Math.hypot(horz,vert);
  final Animator a=ViewAnimationUtils.createCircularReveal(guts,x,y,0,r);
  a.setDuration(400);
  a.setInterpolator(mLinearOutSlowIn);
  a.start();
  mNotificationGutsExposed=guts;
  return true;
}
Program: 197800
Project: 197800
Buggy source:
private int getPositionInLinearLayout(View requestedChild){
  int position=0;
  for (int i=0; i < getChildCount(); i++) {
    View child=getChildAt(i);
    if (child == requestedChild) {
      return position;
    }
    if (child.getVisibility() != View.GONE) {
      position+=child.getHeight();
      if (i < getChildCount() - 1) {
        position+=mPaddingBetweenElements;
      }
    }
  }
  return 0;
}

Fixed version (ground truth):
private int getPositionInLinearLayout(View requestedChild){
  int position=0;
  for (int i=0; i < getChildCount(); i++) {
    View child=getChildAt(i);
    if (child == requestedChild) {
      return position;
    }
    if (child.getVisibility() != View.GONE) {
      position+=getIntrinsicHeight(child);
      if (i < getChildCount() - 1) {
        position+=mPaddingBetweenElements;
      }
    }
  }
  return 0;
}
Program: 197801
Project: 197801
Buggy source:
public ExpandableView getChildAtPosition(float touchX,float touchY){
  final int count=getChildCount();
  for (int childIdx=0; childIdx < count; childIdx++) {
    ExpandableView slidingChild=(ExpandableView)getChildAt(childIdx);
    if (slidingChild.getVisibility() == GONE) {
      continue;
    }
    float childTop=slidingChild.getTranslationY();
    float top=childTop + slidingChild.getClipTopAmount();
    float bottom=top + slidingChild.getActualHeight();
    int left=0;
    int right=getWidth();
    if (touchY >= top && touchY <= bottom && touchX >= left && touchX <= right) {
      return slidingChild;
    }
  }
  return null;
}

Fixed version (ground truth):
public ExpandableView getChildAtPosition(float touchX,float touchY){
  final int count=getChildCount();
  for (int childIdx=0; childIdx < count; childIdx++) {
    ExpandableView slidingChild=(ExpandableView)getChildAt(childIdx);
    if (slidingChild.getVisibility() == GONE) {
      continue;
    }
    float childTop=slidingChild.getTranslationY();
    float top=childTop + slidingChild.getClipTopAmount();
    float bottom=childTop + slidingChild.getActualHeight();
    int left=0;
    int right=getWidth();
    if (touchY >= top && touchY <= bottom && touchX >= left && touchX <= right) {
      return slidingChild;
    }
  }
  return null;
}
Program: 197802
Project: 197802
Buggy source:
protected SwipeHelper.LongPressListener getNotificationLongClicker(){
  return new SwipeHelper.LongPressListener(){
    @Override public boolean onLongPress(    View v,    int x,    int y){
      dismissPopups();
      if (v.getWindowToken() == null)       return false;
      final NotificationGuts guts=(NotificationGuts)v.findViewById(R.id.notification_guts);
      if (guts == null)       return false;
      if (guts.getVisibility() == View.VISIBLE)       return false;
      guts.setVisibility(View.VISIBLE);
      final double horz=Math.max(guts.getWidth() - x,x);
      final double vert=Math.max(guts.getActualHeight() - y,y);
      final float r=(float)Math.hypot(horz,vert);
      final Animator a=ViewAnimationUtils.createCircularReveal(guts,x,y,0,r);
      a.setDuration(400);
      a.setInterpolator(mLinearOutSlowIn);
      a.start();
      mNotificationGutsExposed=guts;
      return true;
    }
  }
;
}

Fixed version (ground truth):
protected SwipeHelper.LongPressListener getNotificationLongClicker(){
  return new SwipeHelper.LongPressListener(){
    @Override public boolean onLongPress(    View v,    int x,    int y){
      dismissPopups();
      if (v.getWindowToken() == null) {
        Log.e(TAG,"String_Node_Str");
        return false;
      }
      final NotificationGuts guts=(NotificationGuts)v.findViewById(R.id.notification_guts);
      if (guts.getVisibility() == View.VISIBLE) {
        Log.e(TAG,"String_Node_Str");
        return false;
      }
      guts.setVisibility(View.VISIBLE);
      final double horz=Math.max(guts.getWidth() - x,x);
      final double vert=Math.max(guts.getActualHeight() - y,y);
      final float r=(float)Math.hypot(horz,vert);
      final Animator a=ViewAnimationUtils.createCircularReveal(guts,x,y,0,r);
      a.setDuration(400);
      a.setInterpolator(mLinearOutSlowIn);
      a.start();
      mNotificationGutsExposed=guts;
      return true;
    }
  }
;
}
Program: 197803
Project: 197803
Buggy source:
@Override public boolean onLongPress(View v,int x,int y){
  dismissPopups();
  if (v.getWindowToken() == null)   return false;
  final NotificationGuts guts=(NotificationGuts)v.findViewById(R.id.notification_guts);
  if (guts == null)   return false;
  if (guts.getVisibility() == View.VISIBLE)   return false;
  guts.setVisibility(View.VISIBLE);
  final double horz=Math.max(guts.getWidth() - x,x);
  final double vert=Math.max(guts.getActualHeight() - y,y);
  final float r=(float)Math.hypot(horz,vert);
  final Animator a=ViewAnimationUtils.createCircularReveal(guts,x,y,0,r);
  a.setDuration(400);
  a.setInterpolator(mLinearOutSlowIn);
  a.start();
  mNotificationGutsExposed=guts;
  return true;
}

Fixed version (ground truth):
@Override public boolean onLongPress(View v,int x,int y){
  dismissPopups();
  if (v.getWindowToken() == null) {
    Log.e(TAG,"String_Node_Str");
    return false;
  }
  final NotificationGuts guts=(NotificationGuts)v.findViewById(R.id.notification_guts);
  if (guts.getVisibility() == View.VISIBLE) {
    Log.e(TAG,"String_Node_Str");
    return false;
  }
  guts.setVisibility(View.VISIBLE);
  final double horz=Math.max(guts.getWidth() - x,x);
  final double vert=Math.max(guts.getActualHeight() - y,y);
  final float r=(float)Math.hypot(horz,vert);
  final Animator a=ViewAnimationUtils.createCircularReveal(guts,x,y,0,r);
  a.setDuration(400);
  a.setInterpolator(mLinearOutSlowIn);
  a.start();
  mNotificationGutsExposed=guts;
  return true;
}
Program: 197804
Project: 197804
Buggy source:
private int getPositionInLinearLayout(View requestedChild){
  int position=0;
  for (int i=0; i < getChildCount(); i++) {
    View child=getChildAt(i);
    if (child == requestedChild) {
      return position;
    }
    if (child.getVisibility() != View.GONE) {
      position+=child.getHeight();
      if (i < getChildCount() - 1) {
        position+=mPaddingBetweenElements;
      }
    }
  }
  return 0;
}

Fixed version (ground truth):
private int getPositionInLinearLayout(View requestedChild){
  int position=0;
  for (int i=0; i < getChildCount(); i++) {
    View child=getChildAt(i);
    if (child == requestedChild) {
      return position;
    }
    if (child.getVisibility() != View.GONE) {
      position+=getIntrinsicHeight(child);
      if (i < getChildCount() - 1) {
        position+=mPaddingBetweenElements;
      }
    }
  }
  return 0;
}
Program: 197805
Project: 197805
Buggy source:
public ExpandableView getChildAtPosition(float touchX,float touchY){
  final int count=getChildCount();
  for (int childIdx=0; childIdx < count; childIdx++) {
    ExpandableView slidingChild=(ExpandableView)getChildAt(childIdx);
    if (slidingChild.getVisibility() == GONE) {
      continue;
    }
    float childTop=slidingChild.getTranslationY();
    float top=childTop + slidingChild.getClipTopAmount();
    float bottom=top + slidingChild.getActualHeight();
    int left=0;
    int right=getWidth();
    if (touchY >= top && touchY <= bottom && touchX >= left && touchX <= right) {
      return slidingChild;
    }
  }
  return null;
}

Fixed version (ground truth):
public ExpandableView getChildAtPosition(float touchX,float touchY){
  final int count=getChildCount();
  for (int childIdx=0; childIdx < count; childIdx++) {
    ExpandableView slidingChild=(ExpandableView)getChildAt(childIdx);
    if (slidingChild.getVisibility() == GONE) {
      continue;
    }
    float childTop=slidingChild.getTranslationY();
    float top=childTop + slidingChild.getClipTopAmount();
    float bottom=childTop + slidingChild.getActualHeight();
    int left=0;
    int right=getWidth();
    if (touchY >= top && touchY <= bottom && touchX >= left && touchX <= right) {
      return slidingChild;
    }
  }
  return null;
}
Program: 197806
Project: 197806
Buggy source:
protected SwipeHelper.LongPressListener getNotificationLongClicker(){
  return new SwipeHelper.LongPressListener(){
    @Override public boolean onLongPress(    View v,    int x,    int y){
      dismissPopups();
      if (v.getWindowToken() == null)       return false;
      final NotificationGuts guts=(NotificationGuts)v.findViewById(R.id.notification_guts);
      if (guts == null)       return false;
      if (guts.getVisibility() == View.VISIBLE)       return false;
      guts.setVisibility(View.VISIBLE);
      final double horz=Math.max(guts.getWidth() - x,x);
      final double vert=Math.max(guts.getActualHeight() - y,y);
      final float r=(float)Math.hypot(horz,vert);
      final Animator a=ViewAnimationUtils.createCircularReveal(guts,x,y,0,r);
      a.setDuration(400);
      a.setInterpolator(mLinearOutSlowIn);
      a.start();
      mNotificationGutsExposed=guts;
      return true;
    }
  }
;
}

Fixed version (ground truth):
protected SwipeHelper.LongPressListener getNotificationLongClicker(){
  return new SwipeHelper.LongPressListener(){
    @Override public boolean onLongPress(    View v,    int x,    int y){
      dismissPopups();
      if (v.getWindowToken() == null) {
        Log.e(TAG,"String_Node_Str");
        return false;
      }
      final NotificationGuts guts=(NotificationGuts)v.findViewById(R.id.notification_guts);
      if (guts.getVisibility() == View.VISIBLE) {
        Log.e(TAG,"String_Node_Str");
        return false;
      }
      guts.setVisibility(View.VISIBLE);
      final double horz=Math.max(guts.getWidth() - x,x);
      final double vert=Math.max(guts.getActualHeight() - y,y);
      final float r=(float)Math.hypot(horz,vert);
      final Animator a=ViewAnimationUtils.createCircularReveal(guts,x,y,0,r);
      a.setDuration(400);
      a.setInterpolator(mLinearOutSlowIn);
      a.start();
      mNotificationGutsExposed=guts;
      return true;
    }
  }
;
}
Program: 197807
Project: 197807
Buggy source:
@Override public boolean onLongPress(View v,int x,int y){
  dismissPopups();
  if (v.getWindowToken() == null)   return false;
  final NotificationGuts guts=(NotificationGuts)v.findViewById(R.id.notification_guts);
  if (guts == null)   return false;
  if (guts.getVisibility() == View.VISIBLE)   return false;
  guts.setVisibility(View.VISIBLE);
  final double horz=Math.max(guts.getWidth() - x,x);
  final double vert=Math.max(guts.getActualHeight() - y,y);
  final float r=(float)Math.hypot(horz,vert);
  final Animator a=ViewAnimationUtils.createCircularReveal(guts,x,y,0,r);
  a.setDuration(400);
  a.setInterpolator(mLinearOutSlowIn);
  a.start();
  mNotificationGutsExposed=guts;
  return true;
}

Fixed version (ground truth):
@Override public boolean onLongPress(View v,int x,int y){
  dismissPopups();
  if (v.getWindowToken() == null) {
    Log.e(TAG,"String_Node_Str");
    return false;
  }
  final NotificationGuts guts=(NotificationGuts)v.findViewById(R.id.notification_guts);
  if (guts.getVisibility() == View.VISIBLE) {
    Log.e(TAG,"String_Node_Str");
    return false;
  }
  guts.setVisibility(View.VISIBLE);
  final double horz=Math.max(guts.getWidth() - x,x);
  final double vert=Math.max(guts.getActualHeight() - y,y);
  final float r=(float)Math.hypot(horz,vert);
  final Animator a=ViewAnimationUtils.createCircularReveal(guts,x,y,0,r);
  a.setDuration(400);
  a.setInterpolator(mLinearOutSlowIn);
  a.start();
  mNotificationGutsExposed=guts;
  return true;
}
Program: 197808
Project: 197808
Buggy source:
private int getPositionInLinearLayout(View requestedChild){
  int position=0;
  for (int i=0; i < getChildCount(); i++) {
    View child=getChildAt(i);
    if (child == requestedChild) {
      return position;
    }
    if (child.getVisibility() != View.GONE) {
      position+=child.getHeight();
      if (i < getChildCount() - 1) {
        position+=mPaddingBetweenElements;
      }
    }
  }
  return 0;
}

Fixed version (ground truth):
private int getPositionInLinearLayout(View requestedChild){
  int position=0;
  for (int i=0; i < getChildCount(); i++) {
    View child=getChildAt(i);
    if (child == requestedChild) {
      return position;
    }
    if (child.getVisibility() != View.GONE) {
      position+=getIntrinsicHeight(child);
      if (i < getChildCount() - 1) {
        position+=mPaddingBetweenElements;
      }
    }
  }
  return 0;
}
Program: 197809
Project: 197809
Buggy source:
public ExpandableView getChildAtPosition(float touchX,float touchY){
  final int count=getChildCount();
  for (int childIdx=0; childIdx < count; childIdx++) {
    ExpandableView slidingChild=(ExpandableView)getChildAt(childIdx);
    if (slidingChild.getVisibility() == GONE) {
      continue;
    }
    float childTop=slidingChild.getTranslationY();
    float top=childTop + slidingChild.getClipTopAmount();
    float bottom=top + slidingChild.getActualHeight();
    int left=0;
    int right=getWidth();
    if (touchY >= top && touchY <= bottom && touchX >= left && touchX <= right) {
      return slidingChild;
    }
  }
  return null;
}

Fixed version (ground truth):
public ExpandableView getChildAtPosition(float touchX,float touchY){
  final int count=getChildCount();
  for (int childIdx=0; childIdx < count; childIdx++) {
    ExpandableView slidingChild=(ExpandableView)getChildAt(childIdx);
    if (slidingChild.getVisibility() == GONE) {
      continue;
    }
    float childTop=slidingChild.getTranslationY();
    float top=childTop + slidingChild.getClipTopAmount();
    float bottom=childTop + slidingChild.getActualHeight();
    int left=0;
    int right=getWidth();
    if (touchY >= top && touchY <= bottom && touchX >= left && touchX <= right) {
      return slidingChild;
    }
  }
  return null;
}
Program: 197810
Project: 197810
Buggy source:
protected SwipeHelper.LongPressListener getNotificationLongClicker(){
  return new SwipeHelper.LongPressListener(){
    @Override public boolean onLongPress(    View v,    int x,    int y){
      dismissPopups();
      if (v.getWindowToken() == null)       return false;
      final NotificationGuts guts=(NotificationGuts)v.findViewById(R.id.notification_guts);
      if (guts == null)       return false;
      if (guts.getVisibility() == View.VISIBLE)       return false;
      guts.setVisibility(View.VISIBLE);
      final double horz=Math.max(guts.getWidth() - x,x);
      final double vert=Math.max(guts.getActualHeight() - y,y);
      final float r=(float)Math.hypot(horz,vert);
      final Animator a=ViewAnimationUtils.createCircularReveal(guts,x,y,0,r);
      a.setDuration(400);
      a.setInterpolator(mLinearOutSlowIn);
      a.start();
      mNotificationGutsExposed=guts;
      return true;
    }
  }
;
}

Fixed version (ground truth):
protected SwipeHelper.LongPressListener getNotificationLongClicker(){
  return new SwipeHelper.LongPressListener(){
    @Override public boolean onLongPress(    View v,    int x,    int y){
      dismissPopups();
      if (v.getWindowToken() == null) {
        Log.e(TAG,"String_Node_Str");
        return false;
      }
      final NotificationGuts guts=(NotificationGuts)v.findViewById(R.id.notification_guts);
      if (guts.getVisibility() == View.VISIBLE) {
        Log.e(TAG,"String_Node_Str");
        return false;
      }
      guts.setVisibility(View.VISIBLE);
      final double horz=Math.max(guts.getWidth() - x,x);
      final double vert=Math.max(guts.getActualHeight() - y,y);
      final float r=(float)Math.hypot(horz,vert);
      final Animator a=ViewAnimationUtils.createCircularReveal(guts,x,y,0,r);
      a.setDuration(400);
      a.setInterpolator(mLinearOutSlowIn);
      a.start();
      mNotificationGutsExposed=guts;
      return true;
    }
  }
;
}
Program: 197811
Project: 197811
Buggy source:
@Override public boolean onLongPress(View v,int x,int y){
  dismissPopups();
  if (v.getWindowToken() == null)   return false;
  final NotificationGuts guts=(NotificationGuts)v.findViewById(R.id.notification_guts);
  if (guts == null)   return false;
  if (guts.getVisibility() == View.VISIBLE)   return false;
  guts.setVisibility(View.VISIBLE);
  final double horz=Math.max(guts.getWidth() - x,x);
  final double vert=Math.max(guts.getActualHeight() - y,y);
  final float r=(float)Math.hypot(horz,vert);
  final Animator a=ViewAnimationUtils.createCircularReveal(guts,x,y,0,r);
  a.setDuration(400);
  a.setInterpolator(mLinearOutSlowIn);
  a.start();
  mNotificationGutsExposed=guts;
  return true;
}

Fixed version (ground truth):
@Override public boolean onLongPress(View v,int x,int y){
  dismissPopups();
  if (v.getWindowToken() == null) {
    Log.e(TAG,"String_Node_Str");
    return false;
  }
  final NotificationGuts guts=(NotificationGuts)v.findViewById(R.id.notification_guts);
  if (guts.getVisibility() == View.VISIBLE) {
    Log.e(TAG,"String_Node_Str");
    return false;
  }
  guts.setVisibility(View.VISIBLE);
  final double horz=Math.max(guts.getWidth() - x,x);
  final double vert=Math.max(guts.getActualHeight() - y,y);
  final float r=(float)Math.hypot(horz,vert);
  final Animator a=ViewAnimationUtils.createCircularReveal(guts,x,y,0,r);
  a.setDuration(400);
  a.setInterpolator(mLinearOutSlowIn);
  a.start();
  mNotificationGutsExposed=guts;
  return true;
}
Program: 197812
Project: 197812
Buggy source:
private int getPositionInLinearLayout(View requestedChild){
  int position=0;
  for (int i=0; i < getChildCount(); i++) {
    View child=getChildAt(i);
    if (child == requestedChild) {
      return position;
    }
    if (child.getVisibility() != View.GONE) {
      position+=child.getHeight();
      if (i < getChildCount() - 1) {
        position+=mPaddingBetweenElements;
      }
    }
  }
  return 0;
}

Fixed version (ground truth):
private int getPositionInLinearLayout(View requestedChild){
  int position=0;
  for (int i=0; i < getChildCount(); i++) {
    View child=getChildAt(i);
    if (child == requestedChild) {
      return position;
    }
    if (child.getVisibility() != View.GONE) {
      position+=getIntrinsicHeight(child);
      if (i < getChildCount() - 1) {
        position+=mPaddingBetweenElements;
      }
    }
  }
  return 0;
}
Program: 197813
Project: 197813
Buggy source:
public ExpandableView getChildAtPosition(float touchX,float touchY){
  final int count=getChildCount();
  for (int childIdx=0; childIdx < count; childIdx++) {
    ExpandableView slidingChild=(ExpandableView)getChildAt(childIdx);
    if (slidingChild.getVisibility() == GONE) {
      continue;
    }
    float childTop=slidingChild.getTranslationY();
    float top=childTop + slidingChild.getClipTopAmount();
    float bottom=top + slidingChild.getActualHeight();
    int left=0;
    int right=getWidth();
    if (touchY >= top && touchY <= bottom && touchX >= left && touchX <= right) {
      return slidingChild;
    }
  }
  return null;
}

Fixed version (ground truth):
public ExpandableView getChildAtPosition(float touchX,float touchY){
  final int count=getChildCount();
  for (int childIdx=0; childIdx < count; childIdx++) {
    ExpandableView slidingChild=(ExpandableView)getChildAt(childIdx);
    if (slidingChild.getVisibility() == GONE) {
      continue;
    }
    float childTop=slidingChild.getTranslationY();
    float top=childTop + slidingChild.getClipTopAmount();
    float bottom=childTop + slidingChild.getActualHeight();
    int left=0;
    int right=getWidth();
    if (touchY >= top && touchY <= bottom && touchX >= left && touchX <= right) {
      return slidingChild;
    }
  }
  return null;
}
Program: 197814
Project: 197814
Buggy source:
protected SwipeHelper.LongPressListener getNotificationLongClicker(){
  return new SwipeHelper.LongPressListener(){
    @Override public boolean onLongPress(    View v,    int x,    int y){
      dismissPopups();
      if (v.getWindowToken() == null)       return false;
      final NotificationGuts guts=(NotificationGuts)v.findViewById(R.id.notification_guts);
      if (guts == null)       return false;
      if (guts.getVisibility() == View.VISIBLE)       return false;
      guts.setVisibility(View.VISIBLE);
      final double horz=Math.max(guts.getWidth() - x,x);
      final double vert=Math.max(guts.getActualHeight() - y,y);
      final float r=(float)Math.hypot(horz,vert);
      final Animator a=ViewAnimationUtils.createCircularReveal(guts,x,y,0,r);
      a.setDuration(400);
      a.setInterpolator(mLinearOutSlowIn);
      a.start();
      mNotificationGutsExposed=guts;
      return true;
    }
  }
;
}

Fixed version (ground truth):
protected SwipeHelper.LongPressListener getNotificationLongClicker(){
  return new SwipeHelper.LongPressListener(){
    @Override public boolean onLongPress(    View v,    int x,    int y){
      dismissPopups();
      if (v.getWindowToken() == null) {
        Log.e(TAG,"String_Node_Str");
        return false;
      }
      final NotificationGuts guts=(NotificationGuts)v.findViewById(R.id.notification_guts);
      if (guts.getVisibility() == View.VISIBLE) {
        Log.e(TAG,"String_Node_Str");
        return false;
      }
      guts.setVisibility(View.VISIBLE);
      final double horz=Math.max(guts.getWidth() - x,x);
      final double vert=Math.max(guts.getActualHeight() - y,y);
      final float r=(float)Math.hypot(horz,vert);
      final Animator a=ViewAnimationUtils.createCircularReveal(guts,x,y,0,r);
      a.setDuration(400);
      a.setInterpolator(mLinearOutSlowIn);
      a.start();
      mNotificationGutsExposed=guts;
      return true;
    }
  }
;
}
Program: 197815
Project: 197815
Buggy source:
@Override public boolean onLongPress(View v,int x,int y){
  dismissPopups();
  if (v.getWindowToken() == null)   return false;
  final NotificationGuts guts=(NotificationGuts)v.findViewById(R.id.notification_guts);
  if (guts == null)   return false;
  if (guts.getVisibility() == View.VISIBLE)   return false;
  guts.setVisibility(View.VISIBLE);
  final double horz=Math.max(guts.getWidth() - x,x);
  final double vert=Math.max(guts.getActualHeight() - y,y);
  final float r=(float)Math.hypot(horz,vert);
  final Animator a=ViewAnimationUtils.createCircularReveal(guts,x,y,0,r);
  a.setDuration(400);
  a.setInterpolator(mLinearOutSlowIn);
  a.start();
  mNotificationGutsExposed=guts;
  return true;
}

Fixed version (ground truth):
@Override public boolean onLongPress(View v,int x,int y){
  dismissPopups();
  if (v.getWindowToken() == null) {
    Log.e(TAG,"String_Node_Str");
    return false;
  }
  final NotificationGuts guts=(NotificationGuts)v.findViewById(R.id.notification_guts);
  if (guts.getVisibility() == View.VISIBLE) {
    Log.e(TAG,"String_Node_Str");
    return false;
  }
  guts.setVisibility(View.VISIBLE);
  final double horz=Math.max(guts.getWidth() - x,x);
  final double vert=Math.max(guts.getActualHeight() - y,y);
  final float r=(float)Math.hypot(horz,vert);
  final Animator a=ViewAnimationUtils.createCircularReveal(guts,x,y,0,r);
  a.setDuration(400);
  a.setInterpolator(mLinearOutSlowIn);
  a.start();
  mNotificationGutsExposed=guts;
  return true;
}
Program: 197816
Project: 197816
Buggy source:
private int getPositionInLinearLayout(View requestedChild){
  int position=0;
  for (int i=0; i < getChildCount(); i++) {
    View child=getChildAt(i);
    if (child == requestedChild) {
      return position;
    }
    if (child.getVisibility() != View.GONE) {
      position+=child.getHeight();
      if (i < getChildCount() - 1) {
        position+=mPaddingBetweenElements;
      }
    }
  }
  return 0;
}

Fixed version (ground truth):
private int getPositionInLinearLayout(View requestedChild){
  int position=0;
  for (int i=0; i < getChildCount(); i++) {
    View child=getChildAt(i);
    if (child == requestedChild) {
      return position;
    }
    if (child.getVisibility() != View.GONE) {
      position+=getIntrinsicHeight(child);
      if (i < getChildCount() - 1) {
        position+=mPaddingBetweenElements;
      }
    }
  }
  return 0;
}
Program: 197817
Project: 197817
Buggy source:
public ExpandableView getChildAtPosition(float touchX,float touchY){
  final int count=getChildCount();
  for (int childIdx=0; childIdx < count; childIdx++) {
    ExpandableView slidingChild=(ExpandableView)getChildAt(childIdx);
    if (slidingChild.getVisibility() == GONE) {
      continue;
    }
    float childTop=slidingChild.getTranslationY();
    float top=childTop + slidingChild.getClipTopAmount();
    float bottom=top + slidingChild.getActualHeight();
    int left=0;
    int right=getWidth();
    if (touchY >= top && touchY <= bottom && touchX >= left && touchX <= right) {
      return slidingChild;
    }
  }
  return null;
}

Fixed version (ground truth):
public ExpandableView getChildAtPosition(float touchX,float touchY){
  final int count=getChildCount();
  for (int childIdx=0; childIdx < count; childIdx++) {
    ExpandableView slidingChild=(ExpandableView)getChildAt(childIdx);
    if (slidingChild.getVisibility() == GONE) {
      continue;
    }
    float childTop=slidingChild.getTranslationY();
    float top=childTop + slidingChild.getClipTopAmount();
    float bottom=childTop + slidingChild.getActualHeight();
    int left=0;
    int right=getWidth();
    if (touchY >= top && touchY <= bottom && touchX >= left && touchX <= right) {
      return slidingChild;
    }
  }
  return null;
}
Program: 197820
Project: 197820
Buggy source:
@Override @ServiceThreadOnly protected boolean handleReportPhysicalAddress(HdmiCecMessage message){
  assertRunOnServiceThread();
  int path=HdmiUtils.twoBytesToInt(message.getParams());
  int address=message.getSource();
  int type=message.getParams()[2];
  if (updateCecSwitchInfo(address,type,path))   return true;
  if (hasAction(DeviceDiscoveryAction.class)) {
    Slog.i(TAG,"String_Node_Str" + message);
    return true;
  }
  if (!isInDeviceList(path,address)) {
    handleNewDeviceAtTheTailOfActivePath(path);
  }
  startNewDeviceAction(ActiveSource.of(address,path));
  return true;
}

Fixed version (ground truth):
@Override @ServiceThreadOnly protected boolean handleReportPhysicalAddress(HdmiCecMessage message){
  assertRunOnServiceThread();
  int path=HdmiUtils.twoBytesToInt(message.getParams());
  int address=message.getSource();
  int type=message.getParams()[2];
  if (updateCecSwitchInfo(address,type,path))   return true;
  if (hasAction(DeviceDiscoveryAction.class)) {
    Slog.i(TAG,"String_Node_Str" + message);
    return true;
  }
  if (!isInDeviceList(address,path)) {
    handleNewDeviceAtTheTailOfActivePath(path);
  }
  startNewDeviceAction(ActiveSource.of(address,path));
  return true;
}
Program: 197821
Project: 197821
Buggy source:
/** 
 * Whether a device of the specified physical address and logical address exists in a device info list. However, both are minimal condition and it could be different device from the original one.
 * @param logicalAddress logical address of a device to be searched
 * @param physicalAddress physical address of a device to be searched
 * @return true if exist; otherwise false
 */
@ServiceThreadOnly boolean isInDeviceList(int logicalAddress,int physicalAddress){
  assertRunOnServiceThread();
  HdmiDeviceInfo device=getCecDeviceInfo(logicalAddress);
  if (device == null) {
    return false;
  }
  return device.getPhysicalAddress() == physicalAddress;
}

Fixed version (ground truth):
/** 
 * Whether a device of the specified physical address and logical address exists in a device info list. However, both are minimal condition and it could be different device from the original one.
 * @param logicalAddress logical address of a device to be searched
 * @param physicalAddress physical address of a device to be searched
 * @return true if exist; otherwise false
 */
@ServiceThreadOnly private boolean isInDeviceList(int logicalAddress,int physicalAddress){
  assertRunOnServiceThread();
  HdmiDeviceInfo device=getCecDeviceInfo(logicalAddress);
  if (device == null) {
    return false;
  }
  return device.getPhysicalAddress() == physicalAddress;
}
Program: 197822
Project: 197822
Buggy source:
@ServiceThreadOnly void handleRemoveActiveRoutingPath(int path){
  assertRunOnServiceThread();
  if (isTailOfActivePath(path,getActivePath())) {
    removeAction(RoutingControlAction.class);
    int newPath=mService.portIdToPath(getActivePortId());
    mService.sendCecCommand(HdmiCecMessageBuilder.buildRoutingChange(mAddress,getActivePath(),newPath));
    addAndStartAction(new RoutingControlAction(this,getActivePortId(),true,null));
  }
}

Fixed version (ground truth):
@ServiceThreadOnly void handleRemoveActiveRoutingPath(int path){
  assertRunOnServiceThread();
  if (isTailOfActivePath(path,getActivePath())) {
    removeAction(RoutingControlAction.class);
    int newPath=mService.portIdToPath(getActivePortId());
    mService.sendCecCommand(HdmiCecMessageBuilder.buildRoutingChange(mAddress,getActivePath(),newPath));
    mActiveSource.invalidate();
    addAndStartAction(new RoutingControlAction(this,getActivePath(),true,null));
  }
}
Program: 197823
Project: 197823
Buggy source:
/** 
 * Return a list of all   {@link HdmiDeviceInfo}. <p>Declared as package-private. accessed by   {@link HdmiControlService} only.This is not thread-safe. For thread safety, call  {@link #getSafeExternalInputsLocked} whichdoes not include local device.
 */
@ServiceThreadOnly List<HdmiDeviceInfo> getDeviceInfoList(boolean includelLocalDevice){
  assertRunOnServiceThread();
  if (includelLocalDevice) {
    return HdmiUtils.sparseArrayToList(mDeviceInfos);
  }
 else {
    ArrayList<HdmiDeviceInfo> infoList=new ArrayList<>();
    for (int i=0; i < mDeviceInfos.size(); ++i) {
      HdmiDeviceInfo info=mDeviceInfos.valueAt(i);
      if (!isLocalDeviceAddress(info.getLogicalAddress())) {
        infoList.add(info);
      }
    }
    return infoList;
  }
}

Fixed version (ground truth):
/** 
 * Return a list of all   {@link HdmiDeviceInfo}. <p>Declared as package-private. accessed by   {@link HdmiControlService} only.This is not thread-safe. For thread safety, call  {@link #getSafeExternalInputsLocked} whichdoes not include local device.
 */
@ServiceThreadOnly List<HdmiDeviceInfo> getDeviceInfoList(boolean includeLocalDevice){
  assertRunOnServiceThread();
  if (includeLocalDevice) {
    return HdmiUtils.sparseArrayToList(mDeviceInfos);
  }
 else {
    ArrayList<HdmiDeviceInfo> infoList=new ArrayList<>();
    for (int i=0; i < mDeviceInfos.size(); ++i) {
      HdmiDeviceInfo info=mDeviceInfos.valueAt(i);
      if (!isLocalDeviceAddress(info.getLogicalAddress())) {
        infoList.add(info);
      }
    }
    return infoList;
  }
}
Program: 197824
Project: 197824
Buggy source:
@Override protected void dump(final IndentingPrintWriter pw){
  super.dump(pw);
  pw.println("String_Node_Str" + mArcEstablished);
  pw.println("String_Node_Str" + mArcFeatureEnabled);
  pw.println("String_Node_Str" + mSystemAudioActivated);
  pw.println("String_Node_Str" + mSystemAudioMute);
  pw.println("String_Node_Str" + mAutoDeviceOff);
  pw.println("String_Node_Str" + mAutoWakeup);
  pw.println("String_Node_Str" + mSkipRoutingControl);
}

Fixed version (ground truth):
@Override protected void dump(final IndentingPrintWriter pw){
  super.dump(pw);
  pw.println("String_Node_Str" + mArcEstablished);
  pw.println("String_Node_Str" + mArcFeatureEnabled);
  pw.println("String_Node_Str" + mSystemAudioActivated);
  pw.println("String_Node_Str" + mSystemAudioMute);
  pw.println("String_Node_Str" + mAutoDeviceOff);
  pw.println("String_Node_Str" + mAutoWakeup);
  pw.println("String_Node_Str" + mSkipRoutingControl);
  pw.println("String_Node_Str");
  pw.increaseIndent();
  for (  HdmiDeviceInfo info : mSafeAllDeviceInfos) {
    pw.println(info);
  }
  pw.decreaseIndent();
}
Program: 197825
Project: 197825
Buggy source:
@ServiceThreadOnly void updateActiveInput(int path,boolean notifyInputChange){
  assertRunOnServiceThread();
  if (path == getActivePath()) {
    return;
  }
  setPrevPortId(getActivePortId());
  int portId=mService.pathToPortId(path);
  setActivePath(path);
  if (notifyInputChange) {
    ActiveSource activeSource=getActiveSource();
    HdmiDeviceInfo info=getCecDeviceInfo(activeSource.logicalAddress);
    if (info == null) {
      info=new HdmiDeviceInfo(Constants.ADDR_INVALID,path,portId,HdmiDeviceInfo.DEVICE_RESERVED,0,null);
    }
    mService.invokeInputChangeListener(info);
  }
}

Fixed version (ground truth):
@ServiceThreadOnly void updateActiveInput(int path,boolean notifyInputChange){
  assertRunOnServiceThread();
  if (path == getActivePath()) {
    return;
  }
  setPrevPortId(getActivePortId());
  setActivePath(path);
  if (notifyInputChange) {
    ActiveSource activeSource=getActiveSource();
    HdmiDeviceInfo info=getCecDeviceInfo(activeSource.logicalAddress);
    if (info == null) {
      info=new HdmiDeviceInfo(Constants.ADDR_INVALID,path,getActivePortId(),HdmiDeviceInfo.DEVICE_RESERVED,0,null);
    }
    mService.invokeInputChangeListener(info);
  }
}
Program: 197826
Project: 197826
Buggy source:
@Override @ServiceThreadOnly protected boolean handleReportPhysicalAddress(HdmiCecMessage message){
  assertRunOnServiceThread();
  int path=HdmiUtils.twoBytesToInt(message.getParams());
  int address=message.getSource();
  int type=message.getParams()[2];
  if (updateCecSwitchInfo(address,type,path))   return true;
  if (hasAction(DeviceDiscoveryAction.class)) {
    Slog.i(TAG,"String_Node_Str" + message);
    return true;
  }
  if (!isInDeviceList(path,address)) {
    handleNewDeviceAtTheTailOfActivePath(path);
  }
  startNewDeviceAction(ActiveSource.of(address,path));
  return true;
}

Fixed version (ground truth):
@Override @ServiceThreadOnly protected boolean handleReportPhysicalAddress(HdmiCecMessage message){
  assertRunOnServiceThread();
  int path=HdmiUtils.twoBytesToInt(message.getParams());
  int address=message.getSource();
  int type=message.getParams()[2];
  if (updateCecSwitchInfo(address,type,path))   return true;
  if (hasAction(DeviceDiscoveryAction.class)) {
    Slog.i(TAG,"String_Node_Str" + message);
    return true;
  }
  if (!isInDeviceList(address,path)) {
    handleNewDeviceAtTheTailOfActivePath(path);
  }
  startNewDeviceAction(ActiveSource.of(address,path));
  return true;
}
Program: 197827
Project: 197827
Buggy source:
/** 
 * Whether a device of the specified physical address and logical address exists in a device info list. However, both are minimal condition and it could be different device from the original one.
 * @param logicalAddress logical address of a device to be searched
 * @param physicalAddress physical address of a device to be searched
 * @return true if exist; otherwise false
 */
@ServiceThreadOnly boolean isInDeviceList(int logicalAddress,int physicalAddress){
  assertRunOnServiceThread();
  HdmiDeviceInfo device=getCecDeviceInfo(logicalAddress);
  if (device == null) {
    return false;
  }
  return device.getPhysicalAddress() == physicalAddress;
}

Fixed version (ground truth):
/** 
 * Whether a device of the specified physical address and logical address exists in a device info list. However, both are minimal condition and it could be different device from the original one.
 * @param logicalAddress logical address of a device to be searched
 * @param physicalAddress physical address of a device to be searched
 * @return true if exist; otherwise false
 */
@ServiceThreadOnly private boolean isInDeviceList(int logicalAddress,int physicalAddress){
  assertRunOnServiceThread();
  HdmiDeviceInfo device=getCecDeviceInfo(logicalAddress);
  if (device == null) {
    return false;
  }
  return device.getPhysicalAddress() == physicalAddress;
}
Program: 197828
Project: 197828
Buggy source:
@ServiceThreadOnly void handleRemoveActiveRoutingPath(int path){
  assertRunOnServiceThread();
  if (isTailOfActivePath(path,getActivePath())) {
    removeAction(RoutingControlAction.class);
    int newPath=mService.portIdToPath(getActivePortId());
    mService.sendCecCommand(HdmiCecMessageBuilder.buildRoutingChange(mAddress,getActivePath(),newPath));
    addAndStartAction(new RoutingControlAction(this,getActivePortId(),true,null));
  }
}

Fixed version (ground truth):
@ServiceThreadOnly void handleRemoveActiveRoutingPath(int path){
  assertRunOnServiceThread();
  if (isTailOfActivePath(path,getActivePath())) {
    removeAction(RoutingControlAction.class);
    int newPath=mService.portIdToPath(getActivePortId());
    mService.sendCecCommand(HdmiCecMessageBuilder.buildRoutingChange(mAddress,getActivePath(),newPath));
    mActiveSource.invalidate();
    addAndStartAction(new RoutingControlAction(this,getActivePath(),true,null));
  }
}
Program: 197829
Project: 197829
Buggy source:
/** 
 * Return a list of all   {@link HdmiDeviceInfo}. <p>Declared as package-private. accessed by   {@link HdmiControlService} only.This is not thread-safe. For thread safety, call  {@link #getSafeExternalInputsLocked} whichdoes not include local device.
 */
@ServiceThreadOnly List<HdmiDeviceInfo> getDeviceInfoList(boolean includelLocalDevice){
  assertRunOnServiceThread();
  if (includelLocalDevice) {
    return HdmiUtils.sparseArrayToList(mDeviceInfos);
  }
 else {
    ArrayList<HdmiDeviceInfo> infoList=new ArrayList<>();
    for (int i=0; i < mDeviceInfos.size(); ++i) {
      HdmiDeviceInfo info=mDeviceInfos.valueAt(i);
      if (!isLocalDeviceAddress(info.getLogicalAddress())) {
        infoList.add(info);
      }
    }
    return infoList;
  }
}

Fixed version (ground truth):
/** 
 * Return a list of all   {@link HdmiDeviceInfo}. <p>Declared as package-private. accessed by   {@link HdmiControlService} only.This is not thread-safe. For thread safety, call  {@link #getSafeExternalInputsLocked} whichdoes not include local device.
 */
@ServiceThreadOnly List<HdmiDeviceInfo> getDeviceInfoList(boolean includeLocalDevice){
  assertRunOnServiceThread();
  if (includeLocalDevice) {
    return HdmiUtils.sparseArrayToList(mDeviceInfos);
  }
 else {
    ArrayList<HdmiDeviceInfo> infoList=new ArrayList<>();
    for (int i=0; i < mDeviceInfos.size(); ++i) {
      HdmiDeviceInfo info=mDeviceInfos.valueAt(i);
      if (!isLocalDeviceAddress(info.getLogicalAddress())) {
        infoList.add(info);
      }
    }
    return infoList;
  }
}
Program: 197830
Project: 197830
Buggy source:
@Override protected void dump(final IndentingPrintWriter pw){
  super.dump(pw);
  pw.println("String_Node_Str" + mArcEstablished);
  pw.println("String_Node_Str" + mArcFeatureEnabled);
  pw.println("String_Node_Str" + mSystemAudioActivated);
  pw.println("String_Node_Str" + mSystemAudioMute);
  pw.println("String_Node_Str" + mAutoDeviceOff);
  pw.println("String_Node_Str" + mAutoWakeup);
  pw.println("String_Node_Str" + mSkipRoutingControl);
}

Fixed version (ground truth):
@Override protected void dump(final IndentingPrintWriter pw){
  super.dump(pw);
  pw.println("String_Node_Str" + mArcEstablished);
  pw.println("String_Node_Str" + mArcFeatureEnabled);
  pw.println("String_Node_Str" + mSystemAudioActivated);
  pw.println("String_Node_Str" + mSystemAudioMute);
  pw.println("String_Node_Str" + mAutoDeviceOff);
  pw.println("String_Node_Str" + mAutoWakeup);
  pw.println("String_Node_Str" + mSkipRoutingControl);
  pw.println("String_Node_Str");
  pw.increaseIndent();
  for (  HdmiDeviceInfo info : mSafeAllDeviceInfos) {
    pw.println(info);
  }
  pw.decreaseIndent();
}
Program: 197831
Project: 197831
Buggy source:
@ServiceThreadOnly void updateActiveInput(int path,boolean notifyInputChange){
  assertRunOnServiceThread();
  if (path == getActivePath()) {
    return;
  }
  setPrevPortId(getActivePortId());
  int portId=mService.pathToPortId(path);
  setActivePath(path);
  if (notifyInputChange) {
    ActiveSource activeSource=getActiveSource();
    HdmiDeviceInfo info=getCecDeviceInfo(activeSource.logicalAddress);
    if (info == null) {
      info=new HdmiDeviceInfo(Constants.ADDR_INVALID,path,portId,HdmiDeviceInfo.DEVICE_RESERVED,0,null);
    }
    mService.invokeInputChangeListener(info);
  }
}

Fixed version (ground truth):
@ServiceThreadOnly void updateActiveInput(int path,boolean notifyInputChange){
  assertRunOnServiceThread();
  if (path == getActivePath()) {
    return;
  }
  setPrevPortId(getActivePortId());
  setActivePath(path);
  if (notifyInputChange) {
    ActiveSource activeSource=getActiveSource();
    HdmiDeviceInfo info=getCecDeviceInfo(activeSource.logicalAddress);
    if (info == null) {
      info=new HdmiDeviceInfo(Constants.ADDR_INVALID,path,getActivePortId(),HdmiDeviceInfo.DEVICE_RESERVED,0,null);
    }
    mService.invokeInputChangeListener(info);
  }
}
Program: 197832
Project: 197832
Buggy source:
@Override @ServiceThreadOnly protected boolean handleReportPhysicalAddress(HdmiCecMessage message){
  assertRunOnServiceThread();
  int path=HdmiUtils.twoBytesToInt(message.getParams());
  int address=message.getSource();
  int type=message.getParams()[2];
  if (updateCecSwitchInfo(address,type,path))   return true;
  if (hasAction(DeviceDiscoveryAction.class)) {
    Slog.i(TAG,"String_Node_Str" + message);
    return true;
  }
  if (!isInDeviceList(path,address)) {
    handleNewDeviceAtTheTailOfActivePath(path);
  }
  startNewDeviceAction(ActiveSource.of(address,path));
  return true;
}

Fixed version (ground truth):
@Override @ServiceThreadOnly protected boolean handleReportPhysicalAddress(HdmiCecMessage message){
  assertRunOnServiceThread();
  int path=HdmiUtils.twoBytesToInt(message.getParams());
  int address=message.getSource();
  int type=message.getParams()[2];
  if (updateCecSwitchInfo(address,type,path))   return true;
  if (hasAction(DeviceDiscoveryAction.class)) {
    Slog.i(TAG,"String_Node_Str" + message);
    return true;
  }
  if (!isInDeviceList(address,path)) {
    handleNewDeviceAtTheTailOfActivePath(path);
  }
  startNewDeviceAction(ActiveSource.of(address,path));
  return true;
}
Program: 197833
Project: 197833
Buggy source:
/** 
 * Whether a device of the specified physical address and logical address exists in a device info list. However, both are minimal condition and it could be different device from the original one.
 * @param logicalAddress logical address of a device to be searched
 * @param physicalAddress physical address of a device to be searched
 * @return true if exist; otherwise false
 */
@ServiceThreadOnly boolean isInDeviceList(int logicalAddress,int physicalAddress){
  assertRunOnServiceThread();
  HdmiDeviceInfo device=getCecDeviceInfo(logicalAddress);
  if (device == null) {
    return false;
  }
  return device.getPhysicalAddress() == physicalAddress;
}

Fixed version (ground truth):
/** 
 * Whether a device of the specified physical address and logical address exists in a device info list. However, both are minimal condition and it could be different device from the original one.
 * @param logicalAddress logical address of a device to be searched
 * @param physicalAddress physical address of a device to be searched
 * @return true if exist; otherwise false
 */
@ServiceThreadOnly private boolean isInDeviceList(int logicalAddress,int physicalAddress){
  assertRunOnServiceThread();
  HdmiDeviceInfo device=getCecDeviceInfo(logicalAddress);
  if (device == null) {
    return false;
  }
  return device.getPhysicalAddress() == physicalAddress;
}
Program: 197834
Project: 197834
Buggy source:
@ServiceThreadOnly void handleRemoveActiveRoutingPath(int path){
  assertRunOnServiceThread();
  if (isTailOfActivePath(path,getActivePath())) {
    removeAction(RoutingControlAction.class);
    int newPath=mService.portIdToPath(getActivePortId());
    mService.sendCecCommand(HdmiCecMessageBuilder.buildRoutingChange(mAddress,getActivePath(),newPath));
    addAndStartAction(new RoutingControlAction(this,getActivePortId(),true,null));
  }
}

Fixed version (ground truth):
@ServiceThreadOnly void handleRemoveActiveRoutingPath(int path){
  assertRunOnServiceThread();
  if (isTailOfActivePath(path,getActivePath())) {
    removeAction(RoutingControlAction.class);
    int newPath=mService.portIdToPath(getActivePortId());
    mService.sendCecCommand(HdmiCecMessageBuilder.buildRoutingChange(mAddress,getActivePath(),newPath));
    mActiveSource.invalidate();
    addAndStartAction(new RoutingControlAction(this,getActivePath(),true,null));
  }
}