nus-yam/ex-repair huggingface dataset:
Program: 134
Project: 134
Buggy source:
private boolean collectForceStopServicesLocked(String name,int userId,boolean evenPersistent,boolean doit,ArrayMap<ComponentName,ServiceRecord> services,ArrayList<ServiceRecord> result){
  boolean didSomething=false;
  for (int i=0; i < services.size(); i++) {
    ServiceRecord service=services.valueAt(i);
    if ((name == null || service.packageName.equals(name)) && (service.app == null || evenPersistent || !service.app.persistent)) {
      if (!doit) {
        return true;
      }
      didSomething=true;
      Slog.i(TAG,"String_Node_Str" + service);
      if (service.app != null) {
        service.app.removed=true;
      }
      service.app=null;
      service.isolatedProc=null;
      result.add(service);
    }
  }
  return didSomething;
}

Fixed version (ground truth):
private boolean collectForceStopServicesLocked(String name,int userId,boolean evenPersistent,boolean doit,ArrayMap<ComponentName,ServiceRecord> services,ArrayList<ServiceRecord> result){
  boolean didSomething=false;
  for (int i=0; i < services.size(); i++) {
    ServiceRecord service=services.valueAt(i);
    if ((name == null || service.packageName.equals(name)) && (service.app == null || evenPersistent || !service.app.persistent)) {
      if (!doit) {
        return true;
      }
      didSomething=true;
      Slog.i(TAG,"String_Node_Str" + service);
      if (service.app != null) {
        service.app.removed=true;
        service.app.services.remove(service);
      }
      service.app=null;
      service.isolatedProc=null;
      result.add(service);
    }
  }
  return didSomething;
}
Program: 137
Project: 137
Buggy source:
private boolean collectForceStopServicesLocked(String name,int userId,boolean evenPersistent,boolean doit,ArrayMap<ComponentName,ServiceRecord> services,ArrayList<ServiceRecord> result){
  boolean didSomething=false;
  for (int i=0; i < services.size(); i++) {
    ServiceRecord service=services.valueAt(i);
    if ((name == null || service.packageName.equals(name)) && (service.app == null || evenPersistent || !service.app.persistent)) {
      if (!doit) {
        return true;
      }
      didSomething=true;
      Slog.i(TAG,"String_Node_Str" + service);
      if (service.app != null) {
        service.app.removed=true;
      }
      service.app=null;
      service.isolatedProc=null;
      result.add(service);
    }
  }
  return didSomething;
}

Fixed version (ground truth):
private boolean collectForceStopServicesLocked(String name,int userId,boolean evenPersistent,boolean doit,ArrayMap<ComponentName,ServiceRecord> services,ArrayList<ServiceRecord> result){
  boolean didSomething=false;
  for (int i=0; i < services.size(); i++) {
    ServiceRecord service=services.valueAt(i);
    if ((name == null || service.packageName.equals(name)) && (service.app == null || evenPersistent || !service.app.persistent)) {
      if (!doit) {
        return true;
      }
      didSomething=true;
      Slog.i(TAG,"String_Node_Str" + service);
      if (service.app != null) {
        service.app.removed=true;
        service.app.services.remove(service);
      }
      service.app=null;
      service.isolatedProc=null;
      result.add(service);
    }
  }
  return didSomething;
}
Program: 140
Project: 140
Buggy source:
private boolean collectForceStopServicesLocked(String name,int userId,boolean evenPersistent,boolean doit,ArrayMap<ComponentName,ServiceRecord> services,ArrayList<ServiceRecord> result){
  boolean didSomething=false;
  for (int i=0; i < services.size(); i++) {
    ServiceRecord service=services.valueAt(i);
    if ((name == null || service.packageName.equals(name)) && (service.app == null || evenPersistent || !service.app.persistent)) {
      if (!doit) {
        return true;
      }
      didSomething=true;
      Slog.i(TAG,"String_Node_Str" + service);
      if (service.app != null) {
        service.app.removed=true;
      }
      service.app=null;
      service.isolatedProc=null;
      result.add(service);
    }
  }
  return didSomething;
}

Fixed version (ground truth):
private boolean collectForceStopServicesLocked(String name,int userId,boolean evenPersistent,boolean doit,ArrayMap<ComponentName,ServiceRecord> services,ArrayList<ServiceRecord> result){
  boolean didSomething=false;
  for (int i=0; i < services.size(); i++) {
    ServiceRecord service=services.valueAt(i);
    if ((name == null || service.packageName.equals(name)) && (service.app == null || evenPersistent || !service.app.persistent)) {
      if (!doit) {
        return true;
      }
      didSomething=true;
      Slog.i(TAG,"String_Node_Str" + service);
      if (service.app != null) {
        service.app.removed=true;
        service.app.services.remove(service);
      }
      service.app=null;
      service.isolatedProc=null;
      result.add(service);
    }
  }
  return didSomething;
}
Program: 143
Project: 143
Buggy source:
private boolean collectForceStopServicesLocked(String name,int userId,boolean evenPersistent,boolean doit,ArrayMap<ComponentName,ServiceRecord> services,ArrayList<ServiceRecord> result){
  boolean didSomething=false;
  for (int i=0; i < services.size(); i++) {
    ServiceRecord service=services.valueAt(i);
    if ((name == null || service.packageName.equals(name)) && (service.app == null || evenPersistent || !service.app.persistent)) {
      if (!doit) {
        return true;
      }
      didSomething=true;
      Slog.i(TAG,"String_Node_Str" + service);
      if (service.app != null) {
        service.app.removed=true;
      }
      service.app=null;
      service.isolatedProc=null;
      result.add(service);
    }
  }
  return didSomething;
}

Fixed version (ground truth):
private boolean collectForceStopServicesLocked(String name,int userId,boolean evenPersistent,boolean doit,ArrayMap<ComponentName,ServiceRecord> services,ArrayList<ServiceRecord> result){
  boolean didSomething=false;
  for (int i=0; i < services.size(); i++) {
    ServiceRecord service=services.valueAt(i);
    if ((name == null || service.packageName.equals(name)) && (service.app == null || evenPersistent || !service.app.persistent)) {
      if (!doit) {
        return true;
      }
      didSomething=true;
      Slog.i(TAG,"String_Node_Str" + service);
      if (service.app != null) {
        service.app.removed=true;
        service.app.services.remove(service);
      }
      service.app=null;
      service.isolatedProc=null;
      result.add(service);
    }
  }
  return didSomething;
}
Program: 146
Project: 146
Buggy source:
private boolean collectForceStopServicesLocked(String name,int userId,boolean evenPersistent,boolean doit,ArrayMap<ComponentName,ServiceRecord> services,ArrayList<ServiceRecord> result){
  boolean didSomething=false;
  for (int i=0; i < services.size(); i++) {
    ServiceRecord service=services.valueAt(i);
    if ((name == null || service.packageName.equals(name)) && (service.app == null || evenPersistent || !service.app.persistent)) {
      if (!doit) {
        return true;
      }
      didSomething=true;
      Slog.i(TAG,"String_Node_Str" + service);
      if (service.app != null) {
        service.app.removed=true;
      }
      service.app=null;
      service.isolatedProc=null;
      result.add(service);
    }
  }
  return didSomething;
}

Fixed version (ground truth):
private boolean collectForceStopServicesLocked(String name,int userId,boolean evenPersistent,boolean doit,ArrayMap<ComponentName,ServiceRecord> services,ArrayList<ServiceRecord> result){
  boolean didSomething=false;
  for (int i=0; i < services.size(); i++) {
    ServiceRecord service=services.valueAt(i);
    if ((name == null || service.packageName.equals(name)) && (service.app == null || evenPersistent || !service.app.persistent)) {
      if (!doit) {
        return true;
      }
      didSomething=true;
      Slog.i(TAG,"String_Node_Str" + service);
      if (service.app != null) {
        service.app.removed=true;
        service.app.services.remove(service);
      }
      service.app=null;
      service.isolatedProc=null;
      result.add(service);
    }
  }
  return didSomething;
}
Program: 148
Project: 148
Buggy source:
private static int hashCodeInternal(String locale,String mode,String extraValue,boolean isAuxiliary,boolean overridesImplicitlyEnabledSubtype,boolean isAsciiCapable){
  return Arrays.hashCode(new Object[]{locale,mode,extraValue,isAuxiliary,overridesImplicitlyEnabledSubtype,isAsciiCapable});
}

Fixed version (ground truth):
private static int hashCodeInternal(String locale,String mode,String extraValue,boolean isAuxiliary,boolean overridesImplicitlyEnabledSubtype,boolean isAsciiCapable){
  final boolean needsToCalculateCompatibleHashCode=!isAsciiCapable;
  if (needsToCalculateCompatibleHashCode) {
    return Arrays.hashCode(new Object[]{locale,mode,extraValue,isAuxiliary,overridesImplicitlyEnabledSubtype});
  }
  return Arrays.hashCode(new Object[]{locale,mode,extraValue,isAuxiliary,overridesImplicitlyEnabledSubtype,isAsciiCapable});
}
Program: 149
Project: 149
Buggy source:
private static int hashCodeInternal(String locale,String mode,String extraValue,boolean isAuxiliary,boolean overridesImplicitlyEnabledSubtype,boolean isAsciiCapable){
  return Arrays.hashCode(new Object[]{locale,mode,extraValue,isAuxiliary,overridesImplicitlyEnabledSubtype,isAsciiCapable});
}

Fixed version (ground truth):
private static int hashCodeInternal(String locale,String mode,String extraValue,boolean isAuxiliary,boolean overridesImplicitlyEnabledSubtype,boolean isAsciiCapable){
  final boolean needsToCalculateCompatibleHashCode=!isAsciiCapable;
  if (needsToCalculateCompatibleHashCode) {
    return Arrays.hashCode(new Object[]{locale,mode,extraValue,isAuxiliary,overridesImplicitlyEnabledSubtype});
  }
  return Arrays.hashCode(new Object[]{locale,mode,extraValue,isAuxiliary,overridesImplicitlyEnabledSubtype,isAsciiCapable});
}
Program: 150
Project: 150
Buggy source:
private static int hashCodeInternal(String locale,String mode,String extraValue,boolean isAuxiliary,boolean overridesImplicitlyEnabledSubtype,boolean isAsciiCapable){
  return Arrays.hashCode(new Object[]{locale,mode,extraValue,isAuxiliary,overridesImplicitlyEnabledSubtype,isAsciiCapable});
}

Fixed version (ground truth):
private static int hashCodeInternal(String locale,String mode,String extraValue,boolean isAuxiliary,boolean overridesImplicitlyEnabledSubtype,boolean isAsciiCapable){
  final boolean needsToCalculateCompatibleHashCode=!isAsciiCapable;
  if (needsToCalculateCompatibleHashCode) {
    return Arrays.hashCode(new Object[]{locale,mode,extraValue,isAuxiliary,overridesImplicitlyEnabledSubtype});
  }
  return Arrays.hashCode(new Object[]{locale,mode,extraValue,isAuxiliary,overridesImplicitlyEnabledSubtype,isAsciiCapable});
}
Program: 151
Project: 151
Buggy source:
private static int hashCodeInternal(String locale,String mode,String extraValue,boolean isAuxiliary,boolean overridesImplicitlyEnabledSubtype,boolean isAsciiCapable){
  return Arrays.hashCode(new Object[]{locale,mode,extraValue,isAuxiliary,overridesImplicitlyEnabledSubtype,isAsciiCapable});
}

Fixed version (ground truth):
private static int hashCodeInternal(String locale,String mode,String extraValue,boolean isAuxiliary,boolean overridesImplicitlyEnabledSubtype,boolean isAsciiCapable){
  final boolean needsToCalculateCompatibleHashCode=!isAsciiCapable;
  if (needsToCalculateCompatibleHashCode) {
    return Arrays.hashCode(new Object[]{locale,mode,extraValue,isAuxiliary,overridesImplicitlyEnabledSubtype});
  }
  return Arrays.hashCode(new Object[]{locale,mode,extraValue,isAuxiliary,overridesImplicitlyEnabledSubtype,isAsciiCapable});
}
Program: 152
Project: 152
Buggy source:
/** 
 * Sets the padding. The view may add on the space required to display the scrollbars, depending on the style and visibility of the scrollbars. So the values returned from   {@link #getPaddingLeft},   {@link #getPaddingTop},  {@link #getPaddingRight} and {@link #getPaddingBottom} may be differentfrom the values set in this call.
 * @attr ref android.R.styleable#View_padding
 * @attr ref android.R.styleable#View_paddingBottom
 * @attr ref android.R.styleable#View_paddingLeft
 * @attr ref android.R.styleable#View_paddingRight
 * @attr ref android.R.styleable#View_paddingTop
 * @param left the left padding in pixels
 * @param top the top padding in pixels
 * @param right the right padding in pixels
 * @param bottom the bottom padding in pixels
 */
public void setPadding(int left,int top,int right,int bottom){
  resetResolvedPadding();
  mUserPaddingStart=UNDEFINED_PADDING;
  mUserPaddingEnd=UNDEFINED_PADDING;
  mUserPaddingLeftInitial=left;
  mUserPaddingRightInitial=right;
  mUseBackgroundPadding=false;
  internalSetPadding(left,top,right,bottom);
}

Fixed version (ground truth):
/** 
 * Sets the padding. The view may add on the space required to display the scrollbars, depending on the style and visibility of the scrollbars. So the values returned from   {@link #getPaddingLeft},   {@link #getPaddingTop},  {@link #getPaddingRight} and {@link #getPaddingBottom} may be differentfrom the values set in this call.
 * @attr ref android.R.styleable#View_padding
 * @attr ref android.R.styleable#View_paddingBottom
 * @attr ref android.R.styleable#View_paddingLeft
 * @attr ref android.R.styleable#View_paddingRight
 * @attr ref android.R.styleable#View_paddingTop
 * @param left the left padding in pixels
 * @param top the top padding in pixels
 * @param right the right padding in pixels
 * @param bottom the bottom padding in pixels
 */
public void setPadding(int left,int top,int right,int bottom){
  resetResolvedPadding();
  mUserPaddingStart=UNDEFINED_PADDING;
  mUserPaddingEnd=UNDEFINED_PADDING;
  mUserPaddingLeftInitial=left;
  mUserPaddingRightInitial=right;
  internalSetPadding(left,top,right,bottom);
}
Program: 154
Project: 154
Buggy source:
/** 
 * Sets the relative padding. The view may add on the space required to display the scrollbars, depending on the style and visibility of the scrollbars. So the values returned from   {@link #getPaddingStart},   {@link #getPaddingTop},  {@link #getPaddingEnd} and {@link #getPaddingBottom} may be differentfrom the values set in this call.
 * @attr ref android.R.styleable#View_padding
 * @attr ref android.R.styleable#View_paddingBottom
 * @attr ref android.R.styleable#View_paddingStart
 * @attr ref android.R.styleable#View_paddingEnd
 * @attr ref android.R.styleable#View_paddingTop
 * @param start the start padding in pixels
 * @param top the top padding in pixels
 * @param end the end padding in pixels
 * @param bottom the bottom padding in pixels
 */
public void setPaddingRelative(int start,int top,int end,int bottom){
  resetResolvedPadding();
  mUserPaddingStart=start;
  mUserPaddingEnd=end;
  mUseBackgroundPadding=false;
switch (getLayoutDirection()) {
case LAYOUT_DIRECTION_RTL:
    mUserPaddingLeftInitial=end;
  mUserPaddingRightInitial=start;
internalSetPadding(end,top,start,bottom);
break;
case LAYOUT_DIRECTION_LTR:
default :
mUserPaddingLeftInitial=start;
mUserPaddingRightInitial=end;
internalSetPadding(start,top,end,bottom);
}
}

Fixed version (ground truth):
/** 
 * Sets the relative padding. The view may add on the space required to display the scrollbars, depending on the style and visibility of the scrollbars. So the values returned from   {@link #getPaddingStart},   {@link #getPaddingTop},  {@link #getPaddingEnd} and {@link #getPaddingBottom} may be differentfrom the values set in this call.
 * @attr ref android.R.styleable#View_padding
 * @attr ref android.R.styleable#View_paddingBottom
 * @attr ref android.R.styleable#View_paddingStart
 * @attr ref android.R.styleable#View_paddingEnd
 * @attr ref android.R.styleable#View_paddingTop
 * @param start the start padding in pixels
 * @param top the top padding in pixels
 * @param end the end padding in pixels
 * @param bottom the bottom padding in pixels
 */
public void setPaddingRelative(int start,int top,int end,int bottom){
  resetResolvedPadding();
  mUserPaddingStart=start;
  mUserPaddingEnd=end;
switch (getLayoutDirection()) {
case LAYOUT_DIRECTION_RTL:
    mUserPaddingLeftInitial=end;
  mUserPaddingRightInitial=start;
internalSetPadding(end,top,start,bottom);
break;
case LAYOUT_DIRECTION_LTR:
default :
mUserPaddingLeftInitial=start;
mUserPaddingRightInitial=end;
internalSetPadding(start,top,end,bottom);
}
}
Program: 156
Project: 156
Buggy source:
/** 
 * Sets the padding. The view may add on the space required to display the scrollbars, depending on the style and visibility of the scrollbars. So the values returned from   {@link #getPaddingLeft},   {@link #getPaddingTop},  {@link #getPaddingRight} and {@link #getPaddingBottom} may be differentfrom the values set in this call.
 * @attr ref android.R.styleable#View_padding
 * @attr ref android.R.styleable#View_paddingBottom
 * @attr ref android.R.styleable#View_paddingLeft
 * @attr ref android.R.styleable#View_paddingRight
 * @attr ref android.R.styleable#View_paddingTop
 * @param left the left padding in pixels
 * @param top the top padding in pixels
 * @param right the right padding in pixels
 * @param bottom the bottom padding in pixels
 */
public void setPadding(int left,int top,int right,int bottom){
  resetResolvedPadding();
  mUserPaddingStart=UNDEFINED_PADDING;
  mUserPaddingEnd=UNDEFINED_PADDING;
  mUserPaddingLeftInitial=left;
  mUserPaddingRightInitial=right;
  mUseBackgroundPadding=false;
  internalSetPadding(left,top,right,bottom);
}

Fixed version (ground truth):
/** 
 * Sets the padding. The view may add on the space required to display the scrollbars, depending on the style and visibility of the scrollbars. So the values returned from   {@link #getPaddingLeft},   {@link #getPaddingTop},  {@link #getPaddingRight} and {@link #getPaddingBottom} may be differentfrom the values set in this call.
 * @attr ref android.R.styleable#View_padding
 * @attr ref android.R.styleable#View_paddingBottom
 * @attr ref android.R.styleable#View_paddingLeft
 * @attr ref android.R.styleable#View_paddingRight
 * @attr ref android.R.styleable#View_paddingTop
 * @param left the left padding in pixels
 * @param top the top padding in pixels
 * @param right the right padding in pixels
 * @param bottom the bottom padding in pixels
 */
public void setPadding(int left,int top,int right,int bottom){
  resetResolvedPadding();
  mUserPaddingStart=UNDEFINED_PADDING;
  mUserPaddingEnd=UNDEFINED_PADDING;
  mUserPaddingLeftInitial=left;
  mUserPaddingRightInitial=right;
  internalSetPadding(left,top,right,bottom);
}
Program: 158
Project: 158
Buggy source:
/** 
 * Sets the relative padding. The view may add on the space required to display the scrollbars, depending on the style and visibility of the scrollbars. So the values returned from   {@link #getPaddingStart},   {@link #getPaddingTop},  {@link #getPaddingEnd} and {@link #getPaddingBottom} may be differentfrom the values set in this call.
 * @attr ref android.R.styleable#View_padding
 * @attr ref android.R.styleable#View_paddingBottom
 * @attr ref android.R.styleable#View_paddingStart
 * @attr ref android.R.styleable#View_paddingEnd
 * @attr ref android.R.styleable#View_paddingTop
 * @param start the start padding in pixels
 * @param top the top padding in pixels
 * @param end the end padding in pixels
 * @param bottom the bottom padding in pixels
 */
public void setPaddingRelative(int start,int top,int end,int bottom){
  resetResolvedPadding();
  mUserPaddingStart=start;
  mUserPaddingEnd=end;
  mUseBackgroundPadding=false;
switch (getLayoutDirection()) {
case LAYOUT_DIRECTION_RTL:
    mUserPaddingLeftInitial=end;
  mUserPaddingRightInitial=start;
internalSetPadding(end,top,start,bottom);
break;
case LAYOUT_DIRECTION_LTR:
default :
mUserPaddingLeftInitial=start;
mUserPaddingRightInitial=end;
internalSetPadding(start,top,end,bottom);
}
}

Fixed version (ground truth):
/** 
 * Sets the relative padding. The view may add on the space required to display the scrollbars, depending on the style and visibility of the scrollbars. So the values returned from   {@link #getPaddingStart},   {@link #getPaddingTop},  {@link #getPaddingEnd} and {@link #getPaddingBottom} may be differentfrom the values set in this call.
 * @attr ref android.R.styleable#View_padding
 * @attr ref android.R.styleable#View_paddingBottom
 * @attr ref android.R.styleable#View_paddingStart
 * @attr ref android.R.styleable#View_paddingEnd
 * @attr ref android.R.styleable#View_paddingTop
 * @param start the start padding in pixels
 * @param top the top padding in pixels
 * @param end the end padding in pixels
 * @param bottom the bottom padding in pixels
 */
public void setPaddingRelative(int start,int top,int end,int bottom){
  resetResolvedPadding();
  mUserPaddingStart=start;
  mUserPaddingEnd=end;
switch (getLayoutDirection()) {
case LAYOUT_DIRECTION_RTL:
    mUserPaddingLeftInitial=end;
  mUserPaddingRightInitial=start;
internalSetPadding(end,top,start,bottom);
break;
case LAYOUT_DIRECTION_LTR:
default :
mUserPaddingLeftInitial=start;
mUserPaddingRightInitial=end;
internalSetPadding(start,top,end,bottom);
}
}
Program: 160
Project: 160
Buggy source:
/** 
 * Sets the padding. The view may add on the space required to display the scrollbars, depending on the style and visibility of the scrollbars. So the values returned from   {@link #getPaddingLeft},   {@link #getPaddingTop},  {@link #getPaddingRight} and {@link #getPaddingBottom} may be differentfrom the values set in this call.
 * @attr ref android.R.styleable#View_padding
 * @attr ref android.R.styleable#View_paddingBottom
 * @attr ref android.R.styleable#View_paddingLeft
 * @attr ref android.R.styleable#View_paddingRight
 * @attr ref android.R.styleable#View_paddingTop
 * @param left the left padding in pixels
 * @param top the top padding in pixels
 * @param right the right padding in pixels
 * @param bottom the bottom padding in pixels
 */
public void setPadding(int left,int top,int right,int bottom){
  resetResolvedPadding();
  mUserPaddingStart=UNDEFINED_PADDING;
  mUserPaddingEnd=UNDEFINED_PADDING;
  mUserPaddingLeftInitial=left;
  mUserPaddingRightInitial=right;
  mUseBackgroundPadding=false;
  internalSetPadding(left,top,right,bottom);
}

Fixed version (ground truth):
/** 
 * Sets the padding. The view may add on the space required to display the scrollbars, depending on the style and visibility of the scrollbars. So the values returned from   {@link #getPaddingLeft},   {@link #getPaddingTop},  {@link #getPaddingRight} and {@link #getPaddingBottom} may be differentfrom the values set in this call.
 * @attr ref android.R.styleable#View_padding
 * @attr ref android.R.styleable#View_paddingBottom
 * @attr ref android.R.styleable#View_paddingLeft
 * @attr ref android.R.styleable#View_paddingRight
 * @attr ref android.R.styleable#View_paddingTop
 * @param left the left padding in pixels
 * @param top the top padding in pixels
 * @param right the right padding in pixels
 * @param bottom the bottom padding in pixels
 */
public void setPadding(int left,int top,int right,int bottom){
  resetResolvedPadding();
  mUserPaddingStart=UNDEFINED_PADDING;
  mUserPaddingEnd=UNDEFINED_PADDING;
  mUserPaddingLeftInitial=left;
  mUserPaddingRightInitial=right;
  internalSetPadding(left,top,right,bottom);
}
Program: 162
Project: 162
Buggy source:
/** 
 * Sets the relative padding. The view may add on the space required to display the scrollbars, depending on the style and visibility of the scrollbars. So the values returned from   {@link #getPaddingStart},   {@link #getPaddingTop},  {@link #getPaddingEnd} and {@link #getPaddingBottom} may be differentfrom the values set in this call.
 * @attr ref android.R.styleable#View_padding
 * @attr ref android.R.styleable#View_paddingBottom
 * @attr ref android.R.styleable#View_paddingStart
 * @attr ref android.R.styleable#View_paddingEnd
 * @attr ref android.R.styleable#View_paddingTop
 * @param start the start padding in pixels
 * @param top the top padding in pixels
 * @param end the end padding in pixels
 * @param bottom the bottom padding in pixels
 */
public void setPaddingRelative(int start,int top,int end,int bottom){
  resetResolvedPadding();
  mUserPaddingStart=start;
  mUserPaddingEnd=end;
  mUseBackgroundPadding=false;
switch (getLayoutDirection()) {
case LAYOUT_DIRECTION_RTL:
    mUserPaddingLeftInitial=end;
  mUserPaddingRightInitial=start;
internalSetPadding(end,top,start,bottom);
break;
case LAYOUT_DIRECTION_LTR:
default :
mUserPaddingLeftInitial=start;
mUserPaddingRightInitial=end;
internalSetPadding(start,top,end,bottom);
}
}

Fixed version (ground truth):
/** 
 * Sets the relative padding. The view may add on the space required to display the scrollbars, depending on the style and visibility of the scrollbars. So the values returned from   {@link #getPaddingStart},   {@link #getPaddingTop},  {@link #getPaddingEnd} and {@link #getPaddingBottom} may be differentfrom the values set in this call.
 * @attr ref android.R.styleable#View_padding
 * @attr ref android.R.styleable#View_paddingBottom
 * @attr ref android.R.styleable#View_paddingStart
 * @attr ref android.R.styleable#View_paddingEnd
 * @attr ref android.R.styleable#View_paddingTop
 * @param start the start padding in pixels
 * @param top the top padding in pixels
 * @param end the end padding in pixels
 * @param bottom the bottom padding in pixels
 */
public void setPaddingRelative(int start,int top,int end,int bottom){
  resetResolvedPadding();
  mUserPaddingStart=start;
  mUserPaddingEnd=end;
switch (getLayoutDirection()) {
case LAYOUT_DIRECTION_RTL:
    mUserPaddingLeftInitial=end;
  mUserPaddingRightInitial=start;
internalSetPadding(end,top,start,bottom);
break;
case LAYOUT_DIRECTION_LTR:
default :
mUserPaddingLeftInitial=start;
mUserPaddingRightInitial=end;
internalSetPadding(start,top,end,bottom);
}
}
Program: 164
Project: 164
Buggy source:
/** 
 * Sets the padding. The view may add on the space required to display the scrollbars, depending on the style and visibility of the scrollbars. So the values returned from   {@link #getPaddingLeft},   {@link #getPaddingTop},  {@link #getPaddingRight} and {@link #getPaddingBottom} may be differentfrom the values set in this call.
 * @attr ref android.R.styleable#View_padding
 * @attr ref android.R.styleable#View_paddingBottom
 * @attr ref android.R.styleable#View_paddingLeft
 * @attr ref android.R.styleable#View_paddingRight
 * @attr ref android.R.styleable#View_paddingTop
 * @param left the left padding in pixels
 * @param top the top padding in pixels
 * @param right the right padding in pixels
 * @param bottom the bottom padding in pixels
 */
public void setPadding(int left,int top,int right,int bottom){
  resetResolvedPadding();
  mUserPaddingStart=UNDEFINED_PADDING;
  mUserPaddingEnd=UNDEFINED_PADDING;
  mUserPaddingLeftInitial=left;
  mUserPaddingRightInitial=right;
  mUseBackgroundPadding=false;
  internalSetPadding(left,top,right,bottom);
}

Fixed version (ground truth):
/** 
 * Sets the padding. The view may add on the space required to display the scrollbars, depending on the style and visibility of the scrollbars. So the values returned from   {@link #getPaddingLeft},   {@link #getPaddingTop},  {@link #getPaddingRight} and {@link #getPaddingBottom} may be differentfrom the values set in this call.
 * @attr ref android.R.styleable#View_padding
 * @attr ref android.R.styleable#View_paddingBottom
 * @attr ref android.R.styleable#View_paddingLeft
 * @attr ref android.R.styleable#View_paddingRight
 * @attr ref android.R.styleable#View_paddingTop
 * @param left the left padding in pixels
 * @param top the top padding in pixels
 * @param right the right padding in pixels
 * @param bottom the bottom padding in pixels
 */
public void setPadding(int left,int top,int right,int bottom){
  resetResolvedPadding();
  mUserPaddingStart=UNDEFINED_PADDING;
  mUserPaddingEnd=UNDEFINED_PADDING;
  mUserPaddingLeftInitial=left;
  mUserPaddingRightInitial=right;
  internalSetPadding(left,top,right,bottom);
}
Program: 166
Project: 166
Buggy source:
/** 
 * Sets the relative padding. The view may add on the space required to display the scrollbars, depending on the style and visibility of the scrollbars. So the values returned from   {@link #getPaddingStart},   {@link #getPaddingTop},  {@link #getPaddingEnd} and {@link #getPaddingBottom} may be differentfrom the values set in this call.
 * @attr ref android.R.styleable#View_padding
 * @attr ref android.R.styleable#View_paddingBottom
 * @attr ref android.R.styleable#View_paddingStart
 * @attr ref android.R.styleable#View_paddingEnd
 * @attr ref android.R.styleable#View_paddingTop
 * @param start the start padding in pixels
 * @param top the top padding in pixels
 * @param end the end padding in pixels
 * @param bottom the bottom padding in pixels
 */
public void setPaddingRelative(int start,int top,int end,int bottom){
  resetResolvedPadding();
  mUserPaddingStart=start;
  mUserPaddingEnd=end;
  mUseBackgroundPadding=false;
switch (getLayoutDirection()) {
case LAYOUT_DIRECTION_RTL:
    mUserPaddingLeftInitial=end;
  mUserPaddingRightInitial=start;
internalSetPadding(end,top,start,bottom);
break;
case LAYOUT_DIRECTION_LTR:
default :
mUserPaddingLeftInitial=start;
mUserPaddingRightInitial=end;
internalSetPadding(start,top,end,bottom);
}
}

Fixed version (ground truth):
/** 
 * Sets the relative padding. The view may add on the space required to display the scrollbars, depending on the style and visibility of the scrollbars. So the values returned from   {@link #getPaddingStart},   {@link #getPaddingTop},  {@link #getPaddingEnd} and {@link #getPaddingBottom} may be differentfrom the values set in this call.
 * @attr ref android.R.styleable#View_padding
 * @attr ref android.R.styleable#View_paddingBottom
 * @attr ref android.R.styleable#View_paddingStart
 * @attr ref android.R.styleable#View_paddingEnd
 * @attr ref android.R.styleable#View_paddingTop
 * @param start the start padding in pixels
 * @param top the top padding in pixels
 * @param end the end padding in pixels
 * @param bottom the bottom padding in pixels
 */
public void setPaddingRelative(int start,int top,int end,int bottom){
  resetResolvedPadding();
  mUserPaddingStart=start;
  mUserPaddingEnd=end;
switch (getLayoutDirection()) {
case LAYOUT_DIRECTION_RTL:
    mUserPaddingLeftInitial=end;
  mUserPaddingRightInitial=start;
internalSetPadding(end,top,start,bottom);
break;
case LAYOUT_DIRECTION_LTR:
default :
mUserPaddingLeftInitial=start;
mUserPaddingRightInitial=end;
internalSetPadding(start,top,end,bottom);
}
}
Program: 168
Project: 168
Buggy source:
/** 
 * Sets the padding. The view may add on the space required to display the scrollbars, depending on the style and visibility of the scrollbars. So the values returned from   {@link #getPaddingLeft},   {@link #getPaddingTop},  {@link #getPaddingRight} and {@link #getPaddingBottom} may be differentfrom the values set in this call.
 * @attr ref android.R.styleable#View_padding
 * @attr ref android.R.styleable#View_paddingBottom
 * @attr ref android.R.styleable#View_paddingLeft
 * @attr ref android.R.styleable#View_paddingRight
 * @attr ref android.R.styleable#View_paddingTop
 * @param left the left padding in pixels
 * @param top the top padding in pixels
 * @param right the right padding in pixels
 * @param bottom the bottom padding in pixels
 */
public void setPadding(int left,int top,int right,int bottom){
  resetResolvedPadding();
  mUserPaddingStart=UNDEFINED_PADDING;
  mUserPaddingEnd=UNDEFINED_PADDING;
  mUserPaddingLeftInitial=left;
  mUserPaddingRightInitial=right;
  mUseBackgroundPadding=false;
  internalSetPadding(left,top,right,bottom);
}

Fixed version (ground truth):
/** 
 * Sets the padding. The view may add on the space required to display the scrollbars, depending on the style and visibility of the scrollbars. So the values returned from   {@link #getPaddingLeft},   {@link #getPaddingTop},  {@link #getPaddingRight} and {@link #getPaddingBottom} may be differentfrom the values set in this call.
 * @attr ref android.R.styleable#View_padding
 * @attr ref android.R.styleable#View_paddingBottom
 * @attr ref android.R.styleable#View_paddingLeft
 * @attr ref android.R.styleable#View_paddingRight
 * @attr ref android.R.styleable#View_paddingTop
 * @param left the left padding in pixels
 * @param top the top padding in pixels
 * @param right the right padding in pixels
 * @param bottom the bottom padding in pixels
 */
public void setPadding(int left,int top,int right,int bottom){
  resetResolvedPadding();
  mUserPaddingStart=UNDEFINED_PADDING;
  mUserPaddingEnd=UNDEFINED_PADDING;
  mUserPaddingLeftInitial=left;
  mUserPaddingRightInitial=right;
  internalSetPadding(left,top,right,bottom);
}
Program: 170
Project: 170
Buggy source:
/** 
 * Sets the relative padding. The view may add on the space required to display the scrollbars, depending on the style and visibility of the scrollbars. So the values returned from   {@link #getPaddingStart},   {@link #getPaddingTop},  {@link #getPaddingEnd} and {@link #getPaddingBottom} may be differentfrom the values set in this call.
 * @attr ref android.R.styleable#View_padding
 * @attr ref android.R.styleable#View_paddingBottom
 * @attr ref android.R.styleable#View_paddingStart
 * @attr ref android.R.styleable#View_paddingEnd
 * @attr ref android.R.styleable#View_paddingTop
 * @param start the start padding in pixels
 * @param top the top padding in pixels
 * @param end the end padding in pixels
 * @param bottom the bottom padding in pixels
 */
public void setPaddingRelative(int start,int top,int end,int bottom){
  resetResolvedPadding();
  mUserPaddingStart=start;
  mUserPaddingEnd=end;
  mUseBackgroundPadding=false;
switch (getLayoutDirection()) {
case LAYOUT_DIRECTION_RTL:
    mUserPaddingLeftInitial=end;
  mUserPaddingRightInitial=start;
internalSetPadding(end,top,start,bottom);
break;
case LAYOUT_DIRECTION_LTR:
default :
mUserPaddingLeftInitial=start;
mUserPaddingRightInitial=end;
internalSetPadding(start,top,end,bottom);
}
}

Fixed version (ground truth):
/** 
 * Sets the relative padding. The view may add on the space required to display the scrollbars, depending on the style and visibility of the scrollbars. So the values returned from   {@link #getPaddingStart},   {@link #getPaddingTop},  {@link #getPaddingEnd} and {@link #getPaddingBottom} may be differentfrom the values set in this call.
 * @attr ref android.R.styleable#View_padding
 * @attr ref android.R.styleable#View_paddingBottom
 * @attr ref android.R.styleable#View_paddingStart
 * @attr ref android.R.styleable#View_paddingEnd
 * @attr ref android.R.styleable#View_paddingTop
 * @param start the start padding in pixels
 * @param top the top padding in pixels
 * @param end the end padding in pixels
 * @param bottom the bottom padding in pixels
 */
public void setPaddingRelative(int start,int top,int end,int bottom){
  resetResolvedPadding();
  mUserPaddingStart=start;
  mUserPaddingEnd=end;
switch (getLayoutDirection()) {
case LAYOUT_DIRECTION_RTL:
    mUserPaddingLeftInitial=end;
  mUserPaddingRightInitial=start;
internalSetPadding(end,top,start,bottom);
break;
case LAYOUT_DIRECTION_LTR:
default :
mUserPaddingLeftInitial=start;
mUserPaddingRightInitial=end;
internalSetPadding(start,top,end,bottom);
}
}
Program: 173
Project: 173
Buggy source:
private void serviceProcessGoneLocked(ServiceRecord r){
  if (r.tracker != null) {
    int memFactor=mAm.mProcessStats.getMemFactorLocked();
    long now=SystemClock.uptimeMillis();
    r.tracker.setExecuting(false,memFactor,now);
    r.tracker.setBound(false,memFactor,now);
  }
  serviceDoneExecutingLocked(r,true,true);
}

Fixed version (ground truth):
private void serviceProcessGoneLocked(ServiceRecord r){
  if (r.tracker != null) {
    int memFactor=mAm.mProcessStats.getMemFactorLocked();
    long now=SystemClock.uptimeMillis();
    r.tracker.setExecuting(false,memFactor,now);
    r.tracker.setBound(false,memFactor,now);
    r.tracker.setStarted(false,memFactor,now);
  }
  serviceDoneExecutingLocked(r,true,true);
}
Program: 175
Project: 175
Buggy source:
private void serviceProcessGoneLocked(ServiceRecord r){
  if (r.tracker != null) {
    int memFactor=mAm.mProcessStats.getMemFactorLocked();
    long now=SystemClock.uptimeMillis();
    r.tracker.setExecuting(false,memFactor,now);
    r.tracker.setBound(false,memFactor,now);
  }
  serviceDoneExecutingLocked(r,true,true);
}

Fixed version (ground truth):
private void serviceProcessGoneLocked(ServiceRecord r){
  if (r.tracker != null) {
    int memFactor=mAm.mProcessStats.getMemFactorLocked();
    long now=SystemClock.uptimeMillis();
    r.tracker.setExecuting(false,memFactor,now);
    r.tracker.setBound(false,memFactor,now);
    r.tracker.setStarted(false,memFactor,now);
  }
  serviceDoneExecutingLocked(r,true,true);
}
Program: 176
Project: 176
Buggy source:
/** 
 * Sets the padding. The view may add on the space required to display the scrollbars, depending on the style and visibility of the scrollbars. So the values returned from   {@link #getPaddingLeft},   {@link #getPaddingTop},  {@link #getPaddingRight} and {@link #getPaddingBottom} may be differentfrom the values set in this call.
 * @attr ref android.R.styleable#View_padding
 * @attr ref android.R.styleable#View_paddingBottom
 * @attr ref android.R.styleable#View_paddingLeft
 * @attr ref android.R.styleable#View_paddingRight
 * @attr ref android.R.styleable#View_paddingTop
 * @param left the left padding in pixels
 * @param top the top padding in pixels
 * @param right the right padding in pixels
 * @param bottom the bottom padding in pixels
 */
public void setPadding(int left,int top,int right,int bottom){
  resetResolvedPadding();
  mUserPaddingStart=UNDEFINED_PADDING;
  mUserPaddingEnd=UNDEFINED_PADDING;
  mUserPaddingLeftInitial=left;
  mUserPaddingRightInitial=right;
  mUseBackgroundPadding=false;
  internalSetPadding(left,top,right,bottom);
}

Fixed version (ground truth):
/** 
 * Sets the padding. The view may add on the space required to display the scrollbars, depending on the style and visibility of the scrollbars. So the values returned from   {@link #getPaddingLeft},   {@link #getPaddingTop},  {@link #getPaddingRight} and {@link #getPaddingBottom} may be differentfrom the values set in this call.
 * @attr ref android.R.styleable#View_padding
 * @attr ref android.R.styleable#View_paddingBottom
 * @attr ref android.R.styleable#View_paddingLeft
 * @attr ref android.R.styleable#View_paddingRight
 * @attr ref android.R.styleable#View_paddingTop
 * @param left the left padding in pixels
 * @param top the top padding in pixels
 * @param right the right padding in pixels
 * @param bottom the bottom padding in pixels
 */
public void setPadding(int left,int top,int right,int bottom){
  resetResolvedPadding();
  mUserPaddingStart=UNDEFINED_PADDING;
  mUserPaddingEnd=UNDEFINED_PADDING;
  mUserPaddingLeftInitial=left;
  mUserPaddingRightInitial=right;
  internalSetPadding(left,top,right,bottom);
}
Program: 178
Project: 178
Buggy source:
/** 
 * Sets the relative padding. The view may add on the space required to display the scrollbars, depending on the style and visibility of the scrollbars. So the values returned from   {@link #getPaddingStart},   {@link #getPaddingTop},  {@link #getPaddingEnd} and {@link #getPaddingBottom} may be differentfrom the values set in this call.
 * @attr ref android.R.styleable#View_padding
 * @attr ref android.R.styleable#View_paddingBottom
 * @attr ref android.R.styleable#View_paddingStart
 * @attr ref android.R.styleable#View_paddingEnd
 * @attr ref android.R.styleable#View_paddingTop
 * @param start the start padding in pixels
 * @param top the top padding in pixels
 * @param end the end padding in pixels
 * @param bottom the bottom padding in pixels
 */
public void setPaddingRelative(int start,int top,int end,int bottom){
  resetResolvedPadding();
  mUserPaddingStart=start;
  mUserPaddingEnd=end;
  mUseBackgroundPadding=false;
switch (getLayoutDirection()) {
case LAYOUT_DIRECTION_RTL:
    mUserPaddingLeftInitial=end;
  mUserPaddingRightInitial=start;
internalSetPadding(end,top,start,bottom);
break;
case LAYOUT_DIRECTION_LTR:
default :
mUserPaddingLeftInitial=start;
mUserPaddingRightInitial=end;
internalSetPadding(start,top,end,bottom);
}
}

Fixed version (ground truth):
/** 
 * Sets the relative padding. The view may add on the space required to display the scrollbars, depending on the style and visibility of the scrollbars. So the values returned from   {@link #getPaddingStart},   {@link #getPaddingTop},  {@link #getPaddingEnd} and {@link #getPaddingBottom} may be differentfrom the values set in this call.
 * @attr ref android.R.styleable#View_padding
 * @attr ref android.R.styleable#View_paddingBottom
 * @attr ref android.R.styleable#View_paddingStart
 * @attr ref android.R.styleable#View_paddingEnd
 * @attr ref android.R.styleable#View_paddingTop
 * @param start the start padding in pixels
 * @param top the top padding in pixels
 * @param end the end padding in pixels
 * @param bottom the bottom padding in pixels
 */
public void setPaddingRelative(int start,int top,int end,int bottom){
  resetResolvedPadding();
  mUserPaddingStart=start;
  mUserPaddingEnd=end;
switch (getLayoutDirection()) {
case LAYOUT_DIRECTION_RTL:
    mUserPaddingLeftInitial=end;
  mUserPaddingRightInitial=start;
internalSetPadding(end,top,start,bottom);
break;
case LAYOUT_DIRECTION_LTR:
default :
mUserPaddingLeftInitial=start;
mUserPaddingRightInitial=end;
internalSetPadding(start,top,end,bottom);
}
}
Program: 180
Project: 180
Buggy source:
static RouteInfo makeWifiDisplayRoute(WifiDisplay display,WifiDisplayStatus wfdStatus){
  final RouteInfo newRoute=new RouteInfo(sStatic.mSystemCategory);
  newRoute.mDeviceAddress=display.getDeviceAddress();
  newRoute.mSupportedTypes=ROUTE_TYPE_LIVE_AUDIO | ROUTE_TYPE_LIVE_VIDEO | ROUTE_TYPE_REMOTE_DISPLAY;
  newRoute.mVolumeHandling=RouteInfo.PLAYBACK_VOLUME_FIXED;
  newRoute.mPlaybackType=RouteInfo.PLAYBACK_TYPE_REMOTE;
  newRoute.setStatusCode(getWifiDisplayStatusCode(display,wfdStatus));
  newRoute.mEnabled=isWifiDisplayEnabled(display,wfdStatus);
  newRoute.mName=display.getFriendlyDisplayName();
  newRoute.mDescription=sStatic.mResources.getText(com.android.internal.R.string.wireless_display_route_description);
  newRoute.mPresentationDisplay=choosePresentationDisplayForRoute(newRoute,sStatic.getAllPresentationDisplays());
  return newRoute;
}

Fixed version (ground truth):
static RouteInfo makeWifiDisplayRoute(WifiDisplay display,WifiDisplayStatus wfdStatus){
  final RouteInfo newRoute=new RouteInfo(sStatic.mSystemCategory);
  newRoute.mDeviceAddress=display.getDeviceAddress();
  newRoute.mSupportedTypes=ROUTE_TYPE_LIVE_AUDIO | ROUTE_TYPE_LIVE_VIDEO | ROUTE_TYPE_REMOTE_DISPLAY;
  newRoute.mVolumeHandling=RouteInfo.PLAYBACK_VOLUME_FIXED;
  newRoute.mPlaybackType=RouteInfo.PLAYBACK_TYPE_REMOTE;
  newRoute.setStatusCode(getWifiDisplayStatusCode(display,wfdStatus));
  newRoute.mEnabled=isWifiDisplayEnabled(display,wfdStatus);
  newRoute.mName=display.getFriendlyDisplayName();
  newRoute.mDescription=sStatic.mResources.getText(com.android.internal.R.string.wireless_display_route_description);
  newRoute.updatePresentationDisplay();
  return newRoute;
}
Program: 181
Project: 181
Buggy source:
RouteInfo makeGlobalRoute(MediaRouterClientState.RouteInfo globalRoute){
  RouteInfo route=new RouteInfo(sStatic.mSystemCategory);
  route.mGlobalRouteId=globalRoute.id;
  route.mName=globalRoute.name;
  route.mDescription=globalRoute.description;
  route.mSupportedTypes=globalRoute.supportedTypes;
  route.mEnabled=globalRoute.enabled;
  route.setStatusCode(globalRoute.statusCode);
  route.mPlaybackType=globalRoute.playbackType;
  route.mPlaybackStream=globalRoute.playbackStream;
  route.mVolume=globalRoute.volume;
  route.mVolumeMax=globalRoute.volumeMax;
  route.mVolumeHandling=globalRoute.volumeHandling;
  route.mPresentationDisplay=getDisplayForGlobalRoute(globalRoute);
  return route;
}

Fixed version (ground truth):
RouteInfo makeGlobalRoute(MediaRouterClientState.RouteInfo globalRoute){
  RouteInfo route=new RouteInfo(sStatic.mSystemCategory);
  route.mGlobalRouteId=globalRoute.id;
  route.mName=globalRoute.name;
  route.mDescription=globalRoute.description;
  route.mSupportedTypes=globalRoute.supportedTypes;
  route.mEnabled=globalRoute.enabled;
  route.setStatusCode(globalRoute.statusCode);
  route.mPlaybackType=globalRoute.playbackType;
  route.mPlaybackStream=globalRoute.playbackStream;
  route.mVolume=globalRoute.volume;
  route.mVolumeMax=globalRoute.volumeMax;
  route.mVolumeHandling=globalRoute.volumeHandling;
  route.mPresentationDisplayId=globalRoute.presentationDisplayId;
  route.updatePresentationDisplay();
  return route;
}
Program: 182
Project: 182
Buggy source:
void startMonitoringRoutes(Context appContext){
  mDefaultAudioVideo=new RouteInfo(mSystemCategory);
  mDefaultAudioVideo.mNameResId=com.android.internal.R.string.default_audio_route_name;
  mDefaultAudioVideo.mSupportedTypes=ROUTE_TYPE_LIVE_AUDIO | ROUTE_TYPE_LIVE_VIDEO;
  mDefaultAudioVideo.mPresentationDisplay=choosePresentationDisplayForRoute(mDefaultAudioVideo,getAllPresentationDisplays());
  addRouteStatic(mDefaultAudioVideo);
  updateWifiDisplayStatus(mDisplayService.getWifiDisplayStatus());
  appContext.registerReceiver(new WifiDisplayStatusChangedReceiver(),new IntentFilter(DisplayManager.ACTION_WIFI_DISPLAY_STATUS_CHANGED));
  appContext.registerReceiver(new VolumeChangeReceiver(),new IntentFilter(AudioManager.VOLUME_CHANGED_ACTION));
  mDisplayService.registerDisplayListener(this,mHandler);
  AudioRoutesInfo newAudioRoutes=null;
  try {
    newAudioRoutes=mAudioService.startWatchingRoutes(mAudioRoutesObserver);
  }
 catch (  RemoteException e) {
  }
  if (newAudioRoutes != null) {
    updateAudioRoutes(newAudioRoutes);
  }
  rebindAsUser(UserHandle.myUserId());
  if (mSelectedRoute == null) {
    selectDefaultRouteStatic();
  }
}

Fixed version (ground truth):
void startMonitoringRoutes(Context appContext){
  mDefaultAudioVideo=new RouteInfo(mSystemCategory);
  mDefaultAudioVideo.mNameResId=com.android.internal.R.string.default_audio_route_name;
  mDefaultAudioVideo.mSupportedTypes=ROUTE_TYPE_LIVE_AUDIO | ROUTE_TYPE_LIVE_VIDEO;
  mDefaultAudioVideo.updatePresentationDisplay();
  addRouteStatic(mDefaultAudioVideo);
  updateWifiDisplayStatus(mDisplayService.getWifiDisplayStatus());
  appContext.registerReceiver(new WifiDisplayStatusChangedReceiver(),new IntentFilter(DisplayManager.ACTION_WIFI_DISPLAY_STATUS_CHANGED));
  appContext.registerReceiver(new VolumeChangeReceiver(),new IntentFilter(AudioManager.VOLUME_CHANGED_ACTION));
  mDisplayService.registerDisplayListener(this,mHandler);
  AudioRoutesInfo newAudioRoutes=null;
  try {
    newAudioRoutes=mAudioService.startWatchingRoutes(mAudioRoutesObserver);
  }
 catch (  RemoteException e) {
  }
  if (newAudioRoutes != null) {
    updateAudioRoutes(newAudioRoutes);
  }
  rebindAsUser(UserHandle.myUserId());
  if (mSelectedRoute == null) {
    selectDefaultRouteStatic();
  }
}
Program: 183
Project: 183
Buggy source:
private void updatePresentationDisplays(int changedDisplayId){
  final Display[] displays=getAllPresentationDisplays();
  final int count=mRoutes.size();
  for (int i=0; i < count; i++) {
    final RouteInfo info=mRoutes.get(i);
    Display display=choosePresentationDisplayForRoute(info,displays);
    if (display != info.mPresentationDisplay || (display != null && display.getDisplayId() == changedDisplayId)) {
      info.mPresentationDisplay=display;
      dispatchRoutePresentationDisplayChanged(info);
    }
  }
}

Fixed version (ground truth):
private void updatePresentationDisplays(int changedDisplayId){
  final int count=mRoutes.size();
  for (int i=0; i < count; i++) {
    final RouteInfo route=mRoutes.get(i);
    if (route.updatePresentationDisplay() || (route.mPresentationDisplay != null && route.mPresentationDisplay.getDisplayId() == changedDisplayId)) {
      dispatchRoutePresentationDisplayChanged(route);
    }
  }
}
Program: 185
Project: 185
Buggy source:
RemoteDisplay findRemoteDisplay(String id){
  return mDisplays.get(id);
}

Fixed version (ground truth):
/** 
 * Finds the remote display with the specified id, returns null if not found.
 * @param id Id of the remote display.
 */
public RemoteDisplay findRemoteDisplay(String id){
  return mDisplays.get(id);
}