nus-yam/ex-repair huggingface dataset:
Program: 199966
Project: 199966
Buggy source:
/** 
 * Get the LTE signal level as an asu value between 0..97, 99 is unknown Asu is calculated based on 3GPP RSRP. Refer to 3GPP 27.007 (Ver 10.3.0) Sec 8.69
 */
@Override public int getAsuLevel(){
  final int cdmaDbm=getCdmaDbm();
  final int cdmaEcio=getCdmaEcio();
  int cdmaAsuLevel;
  int ecioAsuLevel;
  if (cdmaDbm >= -75)   cdmaAsuLevel=16;
 else   if (cdmaDbm >= -82)   cdmaAsuLevel=8;
 else   if (cdmaDbm >= -90)   cdmaAsuLevel=4;
 else   if (cdmaDbm >= -95)   cdmaAsuLevel=2;
 else   if (cdmaDbm >= -100)   cdmaAsuLevel=1;
 else   cdmaAsuLevel=99;
  if (cdmaEcio >= -90)   ecioAsuLevel=16;
 else   if (cdmaEcio >= -100)   ecioAsuLevel=8;
 else   if (cdmaEcio >= -115)   ecioAsuLevel=4;
 else   if (cdmaEcio >= -130)   ecioAsuLevel=2;
 else   if (cdmaEcio >= -150)   ecioAsuLevel=1;
 else   ecioAsuLevel=99;
  int level=(cdmaAsuLevel < ecioAsuLevel) ? cdmaAsuLevel : ecioAsuLevel;
  if (DBG)   log("String_Node_Str" + level);
  return level;
}

Fixed version (ground truth):
/** 
 * Get the signal level as an asu value between 0..97, 99 is unknown Asu is calculated based on 3GPP RSRP. Refer to 3GPP 27.007 (Ver 10.3.0) Sec 8.69
 */
@Override public int getAsuLevel(){
  final int cdmaDbm=getCdmaDbm();
  final int cdmaEcio=getCdmaEcio();
  int cdmaAsuLevel;
  int ecioAsuLevel;
  if (cdmaDbm >= -75)   cdmaAsuLevel=16;
 else   if (cdmaDbm >= -82)   cdmaAsuLevel=8;
 else   if (cdmaDbm >= -90)   cdmaAsuLevel=4;
 else   if (cdmaDbm >= -95)   cdmaAsuLevel=2;
 else   if (cdmaDbm >= -100)   cdmaAsuLevel=1;
 else   cdmaAsuLevel=99;
  if (cdmaEcio >= -90)   ecioAsuLevel=16;
 else   if (cdmaEcio >= -100)   ecioAsuLevel=8;
 else   if (cdmaEcio >= -115)   ecioAsuLevel=4;
 else   if (cdmaEcio >= -130)   ecioAsuLevel=2;
 else   if (cdmaEcio >= -150)   ecioAsuLevel=1;
 else   ecioAsuLevel=99;
  int level=(cdmaAsuLevel < ecioAsuLevel) ? cdmaAsuLevel : ecioAsuLevel;
  if (DBG)   log("String_Node_Str" + level);
  return level;
}
Program: 199967
Project: 199967
Buggy source:
/** 
 * Given a start and stop distance, return in dst the intervening segment(s). If the segment is zero-length, return false, else return true. startD and stopD are pinned to legal values (0..getLength()). If startD <= stopD then return false (and leave dst untouched). Begin the segment with a moveTo if startWithMoveTo is true
 */
public boolean getSegment(float startD,float stopD,Path dst,boolean startWithMoveTo){
  return native_getSegment(native_instance,startD,stopD,dst.ni(),startWithMoveTo);
}

Fixed version (ground truth):
/** 
 * Given a start and stop distance, return in dst the intervening segment(s). If the segment is zero-length, return false, else return true. startD and stopD are pinned to legal values (0..getLength()). If startD <= stopD then return false (and leave dst untouched). Begin the segment with a moveTo if startWithMoveTo is true. <p>On   {@link android.os.Build.VERSION_CODES#KITKAT} and earlierreleases, the resulting path may not display on a hardware-accelerated Canvas. A simple workaround is to add a single operation to this path, such as <code>dst.rLineTo(0, 0)</code>.</p>
 */
public boolean getSegment(float startD,float stopD,Path dst,boolean startWithMoveTo){
  dst.isSimplePath=false;
  return native_getSegment(native_instance,startD,stopD,dst.ni(),startWithMoveTo);
}
Program: 199968
Project: 199968
Buggy source:
/** 
 * Given a start and stop distance, return in dst the intervening segment(s). If the segment is zero-length, return false, else return true. startD and stopD are pinned to legal values (0..getLength()). If startD <= stopD then return false (and leave dst untouched). Begin the segment with a moveTo if startWithMoveTo is true
 */
public boolean getSegment(float startD,float stopD,Path dst,boolean startWithMoveTo){
  return native_getSegment(native_instance,startD,stopD,dst.ni(),startWithMoveTo);
}

Fixed version (ground truth):
/** 
 * Given a start and stop distance, return in dst the intervening segment(s). If the segment is zero-length, return false, else return true. startD and stopD are pinned to legal values (0..getLength()). If startD <= stopD then return false (and leave dst untouched). Begin the segment with a moveTo if startWithMoveTo is true. <p>On   {@link android.os.Build.VERSION_CODES#KITKAT} and earlierreleases, the resulting path may not display on a hardware-accelerated Canvas. A simple workaround is to add a single operation to this path, such as <code>dst.rLineTo(0, 0)</code>.</p>
 */
public boolean getSegment(float startD,float stopD,Path dst,boolean startWithMoveTo){
  dst.isSimplePath=false;
  return native_getSegment(native_instance,startD,stopD,dst.ni(),startWithMoveTo);
}
Program: 199969
Project: 199969
Buggy source:
/** 
 * Get the LTE signal level as an asu value between 0..97, 99 is unknown Asu is calculated based on 3GPP RSRP. Refer to 3GPP 27.007 (Ver 10.3.0) Sec 8.69
 */
@Override public int getAsuLevel(){
  final int cdmaDbm=getCdmaDbm();
  final int cdmaEcio=getCdmaEcio();
  int cdmaAsuLevel;
  int ecioAsuLevel;
  if (cdmaDbm >= -75)   cdmaAsuLevel=16;
 else   if (cdmaDbm >= -82)   cdmaAsuLevel=8;
 else   if (cdmaDbm >= -90)   cdmaAsuLevel=4;
 else   if (cdmaDbm >= -95)   cdmaAsuLevel=2;
 else   if (cdmaDbm >= -100)   cdmaAsuLevel=1;
 else   cdmaAsuLevel=99;
  if (cdmaEcio >= -90)   ecioAsuLevel=16;
 else   if (cdmaEcio >= -100)   ecioAsuLevel=8;
 else   if (cdmaEcio >= -115)   ecioAsuLevel=4;
 else   if (cdmaEcio >= -130)   ecioAsuLevel=2;
 else   if (cdmaEcio >= -150)   ecioAsuLevel=1;
 else   ecioAsuLevel=99;
  int level=(cdmaAsuLevel < ecioAsuLevel) ? cdmaAsuLevel : ecioAsuLevel;
  if (DBG)   log("String_Node_Str" + level);
  return level;
}

Fixed version (ground truth):
/** 
 * Get the signal level as an asu value between 0..97, 99 is unknown Asu is calculated based on 3GPP RSRP. Refer to 3GPP 27.007 (Ver 10.3.0) Sec 8.69
 */
@Override public int getAsuLevel(){
  final int cdmaDbm=getCdmaDbm();
  final int cdmaEcio=getCdmaEcio();
  int cdmaAsuLevel;
  int ecioAsuLevel;
  if (cdmaDbm >= -75)   cdmaAsuLevel=16;
 else   if (cdmaDbm >= -82)   cdmaAsuLevel=8;
 else   if (cdmaDbm >= -90)   cdmaAsuLevel=4;
 else   if (cdmaDbm >= -95)   cdmaAsuLevel=2;
 else   if (cdmaDbm >= -100)   cdmaAsuLevel=1;
 else   cdmaAsuLevel=99;
  if (cdmaEcio >= -90)   ecioAsuLevel=16;
 else   if (cdmaEcio >= -100)   ecioAsuLevel=8;
 else   if (cdmaEcio >= -115)   ecioAsuLevel=4;
 else   if (cdmaEcio >= -130)   ecioAsuLevel=2;
 else   if (cdmaEcio >= -150)   ecioAsuLevel=1;
 else   ecioAsuLevel=99;
  int level=(cdmaAsuLevel < ecioAsuLevel) ? cdmaAsuLevel : ecioAsuLevel;
  if (DBG)   log("String_Node_Str" + level);
  return level;
}
Program: 199970
Project: 199970
Buggy source:
/** 
 * Get the LTE signal level as an asu value between 0..97, 99 is unknown Asu is calculated based on 3GPP RSRP. Refer to 3GPP 27.007 (Ver 10.3.0) Sec 8.69
 */
@Override public int getAsuLevel(){
  final int cdmaDbm=getCdmaDbm();
  final int cdmaEcio=getCdmaEcio();
  int cdmaAsuLevel;
  int ecioAsuLevel;
  if (cdmaDbm >= -75)   cdmaAsuLevel=16;
 else   if (cdmaDbm >= -82)   cdmaAsuLevel=8;
 else   if (cdmaDbm >= -90)   cdmaAsuLevel=4;
 else   if (cdmaDbm >= -95)   cdmaAsuLevel=2;
 else   if (cdmaDbm >= -100)   cdmaAsuLevel=1;
 else   cdmaAsuLevel=99;
  if (cdmaEcio >= -90)   ecioAsuLevel=16;
 else   if (cdmaEcio >= -100)   ecioAsuLevel=8;
 else   if (cdmaEcio >= -115)   ecioAsuLevel=4;
 else   if (cdmaEcio >= -130)   ecioAsuLevel=2;
 else   if (cdmaEcio >= -150)   ecioAsuLevel=1;
 else   ecioAsuLevel=99;
  int level=(cdmaAsuLevel < ecioAsuLevel) ? cdmaAsuLevel : ecioAsuLevel;
  if (DBG)   log("String_Node_Str" + level);
  return level;
}

Fixed version (ground truth):
/** 
 * Get the signal level as an asu value between 0..97, 99 is unknown Asu is calculated based on 3GPP RSRP. Refer to 3GPP 27.007 (Ver 10.3.0) Sec 8.69
 */
@Override public int getAsuLevel(){
  final int cdmaDbm=getCdmaDbm();
  final int cdmaEcio=getCdmaEcio();
  int cdmaAsuLevel;
  int ecioAsuLevel;
  if (cdmaDbm >= -75)   cdmaAsuLevel=16;
 else   if (cdmaDbm >= -82)   cdmaAsuLevel=8;
 else   if (cdmaDbm >= -90)   cdmaAsuLevel=4;
 else   if (cdmaDbm >= -95)   cdmaAsuLevel=2;
 else   if (cdmaDbm >= -100)   cdmaAsuLevel=1;
 else   cdmaAsuLevel=99;
  if (cdmaEcio >= -90)   ecioAsuLevel=16;
 else   if (cdmaEcio >= -100)   ecioAsuLevel=8;
 else   if (cdmaEcio >= -115)   ecioAsuLevel=4;
 else   if (cdmaEcio >= -130)   ecioAsuLevel=2;
 else   if (cdmaEcio >= -150)   ecioAsuLevel=1;
 else   ecioAsuLevel=99;
  int level=(cdmaAsuLevel < ecioAsuLevel) ? cdmaAsuLevel : ecioAsuLevel;
  if (DBG)   log("String_Node_Str" + level);
  return level;
}
Program: 199971
Project: 199971
Buggy source:
/** 
 * Given a start and stop distance, return in dst the intervening segment(s). If the segment is zero-length, return false, else return true. startD and stopD are pinned to legal values (0..getLength()). If startD <= stopD then return false (and leave dst untouched). Begin the segment with a moveTo if startWithMoveTo is true
 */
public boolean getSegment(float startD,float stopD,Path dst,boolean startWithMoveTo){
  return native_getSegment(native_instance,startD,stopD,dst.ni(),startWithMoveTo);
}

Fixed version (ground truth):
/** 
 * Given a start and stop distance, return in dst the intervening segment(s). If the segment is zero-length, return false, else return true. startD and stopD are pinned to legal values (0..getLength()). If startD <= stopD then return false (and leave dst untouched). Begin the segment with a moveTo if startWithMoveTo is true. <p>On   {@link android.os.Build.VERSION_CODES#KITKAT} and earlierreleases, the resulting path may not display on a hardware-accelerated Canvas. A simple workaround is to add a single operation to this path, such as <code>dst.rLineTo(0, 0)</code>.</p>
 */
public boolean getSegment(float startD,float stopD,Path dst,boolean startWithMoveTo){
  dst.isSimplePath=false;
  return native_getSegment(native_instance,startD,stopD,dst.ni(),startWithMoveTo);
}
Program: 199976
Project: 199976
Buggy source:
ComponentName startServiceInnerLocked(ServiceMap smap,Intent service,ServiceRecord r,boolean callerFg,boolean addToStarting){
  ProcessStats.ServiceState stracker=r.getTracker();
  if (stracker != null) {
    stracker.setStarted(true,mAm.mProcessStats.getMemFactorLocked(),r.lastActivity);
  }
  r.callStart=false;
synchronized (r.stats.getBatteryStats()) {
    r.stats.startRunningLocked();
  }
  String error=bringUpServiceLocked(r,service.getFlags(),callerFg,false);
  if (error != null) {
    return new ComponentName("String_Node_Str",error);
  }
  if (r.startRequested && addToStarting) {
    boolean first=smap.mStartingBackground.size() == 0;
    smap.mStartingBackground.add(r);
    r.startingBgTimeout=SystemClock.uptimeMillis() + BG_START_TIMEOUT;
    if (DEBUG_DELAYED_SERVICE) {
      RuntimeException here=new RuntimeException("String_Node_Str");
      here.fillInStackTrace();
      Slog.v(TAG,"String_Node_Str" + first + "String_Node_Str"+ r,here);
    }
 else     if (DEBUG_DELAYED_STATS) {
      Slog.v(TAG,"String_Node_Str" + first + "String_Node_Str"+ r);
    }
    if (first) {
      smap.rescheduleDelayedStarts();
    }
  }
 else   if (callerFg) {
    smap.ensureNotStartingBackground(r);
  }
  return r.name;
}

Fixed version (ground truth):
ComponentName startServiceInnerLocked(ServiceMap smap,Intent service,ServiceRecord r,boolean callerFg,boolean addToStarting){
  ProcessStats.ServiceState stracker=r.getTracker();
  if (stracker != null) {
    stracker.setStarted(true,mAm.mProcessStats.getMemFactorLocked(),r.lastActivity);
  }
  r.callStart=false;
synchronized (r.stats.getBatteryStats()) {
    r.stats.startRunningLocked();
  }
  String error=bringUpServiceLocked(r,service.getFlags(),callerFg,false);
  if (error != null) {
    return new ComponentName("String_Node_Str",error);
  }
  if (r.startRequested && addToStarting) {
    boolean first=smap.mStartingBackground.size() == 0;
    smap.mStartingBackground.add(r);
    r.startingBgTimeout=SystemClock.uptimeMillis() + BG_START_TIMEOUT;
    if (DEBUG_DELAYED_SERVICE) {
      RuntimeException here=new RuntimeException("String_Node_Str");
      here.fillInStackTrace();
      Slog.v(TAG,"String_Node_Str" + first + "String_Node_Str"+ r,here);
    }
 else     if (DEBUG_DELAYED_STARTS) {
      Slog.v(TAG,"String_Node_Str" + first + "String_Node_Str"+ r);
    }
    if (first) {
      smap.rescheduleDelayedStarts();
    }
  }
 else   if (callerFg) {
    smap.ensureNotStartingBackground(r);
  }
  return r.name;
}
Program: 199978
Project: 199978
Buggy source:
void ensureNotStartingBackground(ServiceRecord r){
  if (mStartingBackground.remove(r)) {
    if (DEBUG_DELAYED_STATS)     Slog.v(TAG,"String_Node_Str" + r);
    rescheduleDelayedStarts();
  }
  if (mDelayedStartList.remove(r)) {
    if (DEBUG_DELAYED_STATS)     Slog.v(TAG,"String_Node_Str" + r);
  }
}

Fixed version (ground truth):
void ensureNotStartingBackground(ServiceRecord r){
  if (mStartingBackground.remove(r)) {
    if (DEBUG_DELAYED_STARTS)     Slog.v(TAG,"String_Node_Str" + r);
    rescheduleDelayedStarts();
  }
  if (mDelayedStartList.remove(r)) {
    if (DEBUG_DELAYED_STARTS)     Slog.v(TAG,"String_Node_Str" + r);
  }
}
Program: 199983
Project: 199983
Buggy source:
ComponentName startServiceInnerLocked(ServiceMap smap,Intent service,ServiceRecord r,boolean callerFg,boolean addToStarting){
  ProcessStats.ServiceState stracker=r.getTracker();
  if (stracker != null) {
    stracker.setStarted(true,mAm.mProcessStats.getMemFactorLocked(),r.lastActivity);
  }
  r.callStart=false;
synchronized (r.stats.getBatteryStats()) {
    r.stats.startRunningLocked();
  }
  String error=bringUpServiceLocked(r,service.getFlags(),callerFg,false);
  if (error != null) {
    return new ComponentName("String_Node_Str",error);
  }
  if (r.startRequested && addToStarting) {
    boolean first=smap.mStartingBackground.size() == 0;
    smap.mStartingBackground.add(r);
    r.startingBgTimeout=SystemClock.uptimeMillis() + BG_START_TIMEOUT;
    if (DEBUG_DELAYED_SERVICE) {
      RuntimeException here=new RuntimeException("String_Node_Str");
      here.fillInStackTrace();
      Slog.v(TAG,"String_Node_Str" + first + "String_Node_Str"+ r,here);
    }
 else     if (DEBUG_DELAYED_STATS) {
      Slog.v(TAG,"String_Node_Str" + first + "String_Node_Str"+ r);
    }
    if (first) {
      smap.rescheduleDelayedStarts();
    }
  }
 else   if (callerFg) {
    smap.ensureNotStartingBackground(r);
  }
  return r.name;
}

Fixed version (ground truth):
ComponentName startServiceInnerLocked(ServiceMap smap,Intent service,ServiceRecord r,boolean callerFg,boolean addToStarting){
  ProcessStats.ServiceState stracker=r.getTracker();
  if (stracker != null) {
    stracker.setStarted(true,mAm.mProcessStats.getMemFactorLocked(),r.lastActivity);
  }
  r.callStart=false;
synchronized (r.stats.getBatteryStats()) {
    r.stats.startRunningLocked();
  }
  String error=bringUpServiceLocked(r,service.getFlags(),callerFg,false);
  if (error != null) {
    return new ComponentName("String_Node_Str",error);
  }
  if (r.startRequested && addToStarting) {
    boolean first=smap.mStartingBackground.size() == 0;
    smap.mStartingBackground.add(r);
    r.startingBgTimeout=SystemClock.uptimeMillis() + BG_START_TIMEOUT;
    if (DEBUG_DELAYED_SERVICE) {
      RuntimeException here=new RuntimeException("String_Node_Str");
      here.fillInStackTrace();
      Slog.v(TAG,"String_Node_Str" + first + "String_Node_Str"+ r,here);
    }
 else     if (DEBUG_DELAYED_STARTS) {
      Slog.v(TAG,"String_Node_Str" + first + "String_Node_Str"+ r);
    }
    if (first) {
      smap.rescheduleDelayedStarts();
    }
  }
 else   if (callerFg) {
    smap.ensureNotStartingBackground(r);
  }
  return r.name;
}
Program: 199985
Project: 199985
Buggy source:
void ensureNotStartingBackground(ServiceRecord r){
  if (mStartingBackground.remove(r)) {
    if (DEBUG_DELAYED_STATS)     Slog.v(TAG,"String_Node_Str" + r);
    rescheduleDelayedStarts();
  }
  if (mDelayedStartList.remove(r)) {
    if (DEBUG_DELAYED_STATS)     Slog.v(TAG,"String_Node_Str" + r);
  }
}

Fixed version (ground truth):
void ensureNotStartingBackground(ServiceRecord r){
  if (mStartingBackground.remove(r)) {
    if (DEBUG_DELAYED_STARTS)     Slog.v(TAG,"String_Node_Str" + r);
    rescheduleDelayedStarts();
  }
  if (mDelayedStartList.remove(r)) {
    if (DEBUG_DELAYED_STARTS)     Slog.v(TAG,"String_Node_Str" + r);
  }
}
Program: 199990
Project: 199990
Buggy source:
ComponentName startServiceInnerLocked(ServiceMap smap,Intent service,ServiceRecord r,boolean callerFg,boolean addToStarting){
  ProcessStats.ServiceState stracker=r.getTracker();
  if (stracker != null) {
    stracker.setStarted(true,mAm.mProcessStats.getMemFactorLocked(),r.lastActivity);
  }
  r.callStart=false;
synchronized (r.stats.getBatteryStats()) {
    r.stats.startRunningLocked();
  }
  String error=bringUpServiceLocked(r,service.getFlags(),callerFg,false);
  if (error != null) {
    return new ComponentName("String_Node_Str",error);
  }
  if (r.startRequested && addToStarting) {
    boolean first=smap.mStartingBackground.size() == 0;
    smap.mStartingBackground.add(r);
    r.startingBgTimeout=SystemClock.uptimeMillis() + BG_START_TIMEOUT;
    if (DEBUG_DELAYED_SERVICE) {
      RuntimeException here=new RuntimeException("String_Node_Str");
      here.fillInStackTrace();
      Slog.v(TAG,"String_Node_Str" + first + "String_Node_Str"+ r,here);
    }
 else     if (DEBUG_DELAYED_STATS) {
      Slog.v(TAG,"String_Node_Str" + first + "String_Node_Str"+ r);
    }
    if (first) {
      smap.rescheduleDelayedStarts();
    }
  }
 else   if (callerFg) {
    smap.ensureNotStartingBackground(r);
  }
  return r.name;
}

Fixed version (ground truth):
ComponentName startServiceInnerLocked(ServiceMap smap,Intent service,ServiceRecord r,boolean callerFg,boolean addToStarting){
  ProcessStats.ServiceState stracker=r.getTracker();
  if (stracker != null) {
    stracker.setStarted(true,mAm.mProcessStats.getMemFactorLocked(),r.lastActivity);
  }
  r.callStart=false;
synchronized (r.stats.getBatteryStats()) {
    r.stats.startRunningLocked();
  }
  String error=bringUpServiceLocked(r,service.getFlags(),callerFg,false);
  if (error != null) {
    return new ComponentName("String_Node_Str",error);
  }
  if (r.startRequested && addToStarting) {
    boolean first=smap.mStartingBackground.size() == 0;
    smap.mStartingBackground.add(r);
    r.startingBgTimeout=SystemClock.uptimeMillis() + BG_START_TIMEOUT;
    if (DEBUG_DELAYED_SERVICE) {
      RuntimeException here=new RuntimeException("String_Node_Str");
      here.fillInStackTrace();
      Slog.v(TAG,"String_Node_Str" + first + "String_Node_Str"+ r,here);
    }
 else     if (DEBUG_DELAYED_STARTS) {
      Slog.v(TAG,"String_Node_Str" + first + "String_Node_Str"+ r);
    }
    if (first) {
      smap.rescheduleDelayedStarts();
    }
  }
 else   if (callerFg) {
    smap.ensureNotStartingBackground(r);
  }
  return r.name;
}
Program: 199992
Project: 199992
Buggy source:
void ensureNotStartingBackground(ServiceRecord r){
  if (mStartingBackground.remove(r)) {
    if (DEBUG_DELAYED_STATS)     Slog.v(TAG,"String_Node_Str" + r);
    rescheduleDelayedStarts();
  }
  if (mDelayedStartList.remove(r)) {
    if (DEBUG_DELAYED_STATS)     Slog.v(TAG,"String_Node_Str" + r);
  }
}

Fixed version (ground truth):
void ensureNotStartingBackground(ServiceRecord r){
  if (mStartingBackground.remove(r)) {
    if (DEBUG_DELAYED_STARTS)     Slog.v(TAG,"String_Node_Str" + r);
    rescheduleDelayedStarts();
  }
  if (mDelayedStartList.remove(r)) {
    if (DEBUG_DELAYED_STARTS)     Slog.v(TAG,"String_Node_Str" + r);
  }
}
Program: 199997
Project: 199997
Buggy source:
ComponentName startServiceInnerLocked(ServiceMap smap,Intent service,ServiceRecord r,boolean callerFg,boolean addToStarting){
  ProcessStats.ServiceState stracker=r.getTracker();
  if (stracker != null) {
    stracker.setStarted(true,mAm.mProcessStats.getMemFactorLocked(),r.lastActivity);
  }
  r.callStart=false;
synchronized (r.stats.getBatteryStats()) {
    r.stats.startRunningLocked();
  }
  String error=bringUpServiceLocked(r,service.getFlags(),callerFg,false);
  if (error != null) {
    return new ComponentName("String_Node_Str",error);
  }
  if (r.startRequested && addToStarting) {
    boolean first=smap.mStartingBackground.size() == 0;
    smap.mStartingBackground.add(r);
    r.startingBgTimeout=SystemClock.uptimeMillis() + BG_START_TIMEOUT;
    if (DEBUG_DELAYED_SERVICE) {
      RuntimeException here=new RuntimeException("String_Node_Str");
      here.fillInStackTrace();
      Slog.v(TAG,"String_Node_Str" + first + "String_Node_Str"+ r,here);
    }
 else     if (DEBUG_DELAYED_STATS) {
      Slog.v(TAG,"String_Node_Str" + first + "String_Node_Str"+ r);
    }
    if (first) {
      smap.rescheduleDelayedStarts();
    }
  }
 else   if (callerFg) {
    smap.ensureNotStartingBackground(r);
  }
  return r.name;
}

Fixed version (ground truth):
ComponentName startServiceInnerLocked(ServiceMap smap,Intent service,ServiceRecord r,boolean callerFg,boolean addToStarting){
  ProcessStats.ServiceState stracker=r.getTracker();
  if (stracker != null) {
    stracker.setStarted(true,mAm.mProcessStats.getMemFactorLocked(),r.lastActivity);
  }
  r.callStart=false;
synchronized (r.stats.getBatteryStats()) {
    r.stats.startRunningLocked();
  }
  String error=bringUpServiceLocked(r,service.getFlags(),callerFg,false);
  if (error != null) {
    return new ComponentName("String_Node_Str",error);
  }
  if (r.startRequested && addToStarting) {
    boolean first=smap.mStartingBackground.size() == 0;
    smap.mStartingBackground.add(r);
    r.startingBgTimeout=SystemClock.uptimeMillis() + BG_START_TIMEOUT;
    if (DEBUG_DELAYED_SERVICE) {
      RuntimeException here=new RuntimeException("String_Node_Str");
      here.fillInStackTrace();
      Slog.v(TAG,"String_Node_Str" + first + "String_Node_Str"+ r,here);
    }
 else     if (DEBUG_DELAYED_STARTS) {
      Slog.v(TAG,"String_Node_Str" + first + "String_Node_Str"+ r);
    }
    if (first) {
      smap.rescheduleDelayedStarts();
    }
  }
 else   if (callerFg) {
    smap.ensureNotStartingBackground(r);
  }
  return r.name;
}
Program: 199999
Project: 199999
Buggy source:
void ensureNotStartingBackground(ServiceRecord r){
  if (mStartingBackground.remove(r)) {
    if (DEBUG_DELAYED_STATS)     Slog.v(TAG,"String_Node_Str" + r);
    rescheduleDelayedStarts();
  }
  if (mDelayedStartList.remove(r)) {
    if (DEBUG_DELAYED_STATS)     Slog.v(TAG,"String_Node_Str" + r);
  }
}

Fixed version (ground truth):
void ensureNotStartingBackground(ServiceRecord r){
  if (mStartingBackground.remove(r)) {
    if (DEBUG_DELAYED_STARTS)     Slog.v(TAG,"String_Node_Str" + r);
    rescheduleDelayedStarts();
  }
  if (mDelayedStartList.remove(r)) {
    if (DEBUG_DELAYED_STARTS)     Slog.v(TAG,"String_Node_Str" + r);
  }
}