nus-yam/ex-repair huggingface dataset:
Program: 645
Project: 645
Buggy source:
public static long dumpSingleServiceTime(PrintWriter pw,String prefix,ServiceState service,int serviceType,int curState,long curStartTime,long now){
  long totalTime=0;
  int printedScreen=-1;
  for (int iscreen=0; iscreen < ADJ_COUNT; iscreen+=ADJ_SCREEN_MOD) {
    int printedMem=-1;
    for (int imem=0; imem < ADJ_MEM_FACTOR_COUNT; imem++) {
      int state=imem + iscreen;
      long time=service.getDuration(serviceType,curState,curStartTime,state,now);
      String running="String_Node_Str";
      if (curState == state && pw != null) {
        running="String_Node_Str";
      }
      if (time != 0) {
        if (pw != null) {
          pw.print(prefix);
          printScreenLabel(pw,printedScreen != iscreen ? iscreen : STATE_NOTHING);
          printedScreen=iscreen;
          printMemLabel(pw,printedMem != imem ? imem : STATE_NOTHING);
          printedMem=imem;
          TimeUtils.formatDuration(time,pw);
          pw.println(running);
        }
        totalTime+=time;
      }
    }
  }
  if (totalTime != 0 && pw != null) {
    pw.print(prefix);
    printScreenLabel(pw,STATE_NOTHING);
    pw.print("String_Node_Str");
    TimeUtils.formatDuration(totalTime,pw);
    pw.println();
  }
  return totalTime;
}

Fixed version (ground truth):
public static long dumpSingleServiceTime(PrintWriter pw,String prefix,ServiceState service,int serviceType,int curState,long curStartTime,long now){
  long totalTime=0;
  int printedScreen=-1;
  for (int iscreen=0; iscreen < ADJ_COUNT; iscreen+=ADJ_SCREEN_MOD) {
    int printedMem=-1;
    for (int imem=0; imem < ADJ_MEM_FACTOR_COUNT; imem++) {
      int state=imem + iscreen;
      long time=service.getDuration(serviceType,curState,curStartTime,state,now);
      String running="String_Node_Str";
      if (curState == state && pw != null) {
        running="String_Node_Str";
      }
      if (time != 0) {
        if (pw != null) {
          pw.print(prefix);
          printScreenLabel(pw,printedScreen != iscreen ? iscreen : STATE_NOTHING);
          printedScreen=iscreen;
          printMemLabel(pw,printedMem != imem ? imem : STATE_NOTHING,(char)0);
          printedMem=imem;
          pw.print("String_Node_Str");
          TimeUtils.formatDuration(time,pw);
          pw.println(running);
        }
        totalTime+=time;
      }
    }
  }
  if (totalTime != 0 && pw != null) {
    pw.print(prefix);
    pw.print("String_Node_Str");
    TimeUtils.formatDuration(totalTime,pw);
    pw.println();
  }
  return totalTime;
}
Program: 647
Project: 647
Buggy source:
private void dumpProcessInternalLocked(PrintWriter pw,String prefix,ProcessState proc,boolean dumpAll){
  if (dumpAll) {
    pw.print(prefix);
    pw.print("String_Node_Str");
    pw.print(Integer.toHexString(System.identityHashCode(proc)));
    pw.print("String_Node_Str");
    pw.print(Integer.toHexString(System.identityHashCode(proc.mCommonProcess)));
    pw.print("String_Node_Str");
    pw.println(proc.mPackage);
    if (proc.mMultiPackage) {
      pw.print(prefix);
      pw.print("String_Node_Str");
      pw.println(proc.mMultiPackage);
    }
    if (proc != proc.mCommonProcess) {
      pw.print(prefix);
      pw.print("String_Node_Str");
      pw.print(proc.mCommonProcess.mName);
      pw.print("String_Node_Str");
      pw.print(proc.mCommonProcess.mUid);
      pw.print("String_Node_Str");
      pw.println(proc.mCommonProcess.mPackage);
    }
  }
  pw.print(prefix);
  pw.print("String_Node_Str");
  pw.println(proc.mActive);
  if (proc.mDead) {
    pw.print(prefix);
    pw.print("String_Node_Str");
    pw.println(proc.mDead);
  }
  pw.print(prefix);
  pw.print("String_Node_Str");
  pw.print(proc.mNumActiveServices);
  pw.print("String_Node_Str");
  pw.println(proc.mNumStartedServices);
}

Fixed version (ground truth):
private void dumpProcessInternalLocked(PrintWriter pw,String prefix,ProcessState proc,boolean dumpAll){
  if (dumpAll) {
    pw.print(prefix);
    pw.print("String_Node_Str");
    pw.print(Integer.toHexString(System.identityHashCode(proc)));
    pw.print("String_Node_Str");
    pw.print(Integer.toHexString(System.identityHashCode(proc.mCommonProcess)));
    pw.print("String_Node_Str");
    pw.println(proc.mPackage);
    if (proc.mMultiPackage) {
      pw.print(prefix);
      pw.print("String_Node_Str");
      pw.println(proc.mMultiPackage);
    }
    if (proc != proc.mCommonProcess) {
      pw.print(prefix);
      pw.print("String_Node_Str");
      pw.print(proc.mCommonProcess.mName);
      pw.print("String_Node_Str");
      pw.print(proc.mCommonProcess.mUid);
      pw.print("String_Node_Str");
      pw.println(proc.mCommonProcess.mPackage);
    }
  }
  if (proc.mActive) {
    pw.print(prefix);
    pw.print("String_Node_Str");
    pw.println(proc.mActive);
  }
  if (proc.mDead) {
    pw.print(prefix);
    pw.print("String_Node_Str");
    pw.println(proc.mDead);
  }
  if (proc.mNumActiveServices != 0 || proc.mNumStartedServices != 0) {
    pw.print(prefix);
    pw.print("String_Node_Str");
    pw.print(proc.mNumActiveServices);
    pw.print("String_Node_Str");
    pw.println(proc.mNumStartedServices);
  }
}
Program: 649
Project: 649
Buggy source:
private final List<ProviderInfo> generateApplicationProvidersLocked(ProcessRecord app){
  List<ProviderInfo> providers=null;
  try {
    providers=AppGlobals.getPackageManager().queryContentProviders(app.processName,app.uid,STOCK_PM_FLAGS | PackageManager.GET_URI_PERMISSION_PATTERNS);
  }
 catch (  RemoteException ex) {
  }
  if (DEBUG_MU)   Slog.v(TAG_MU,"String_Node_Str" + app.uid);
  int userId=app.userId;
  if (providers != null) {
    int N=providers.size();
    app.pubProviders.ensureCapacity(N + app.pubProviders.size());
    for (int i=0; i < N; i++) {
      ProviderInfo cpi=(ProviderInfo)providers.get(i);
      boolean singleton=isSingleton(cpi.processName,cpi.applicationInfo,cpi.name,cpi.flags);
      if (singleton && UserHandle.getUserId(app.uid) != 0) {
        providers.remove(i);
        N--;
        i--;
        continue;
      }
      ComponentName comp=new ComponentName(cpi.packageName,cpi.name);
      ContentProviderRecord cpr=mProviderMap.getProviderByClass(comp,userId);
      if (cpr == null) {
        cpr=new ContentProviderRecord(this,cpi,app.info,comp,singleton);
        mProviderMap.putProviderByClass(comp,cpr);
      }
      if (DEBUG_MU)       Slog.v(TAG_MU,"String_Node_Str" + cpr.uid);
      app.pubProviders.put(cpi.name,cpr);
      app.addPackage(cpi.applicationInfo.packageName,mProcessStats);
      ensurePackageDexOpt(cpi.applicationInfo.packageName);
    }
  }
  return providers;
}

Fixed version (ground truth):
private final List<ProviderInfo> generateApplicationProvidersLocked(ProcessRecord app){
  List<ProviderInfo> providers=null;
  try {
    providers=AppGlobals.getPackageManager().queryContentProviders(app.processName,app.uid,STOCK_PM_FLAGS | PackageManager.GET_URI_PERMISSION_PATTERNS);
  }
 catch (  RemoteException ex) {
  }
  if (DEBUG_MU)   Slog.v(TAG_MU,"String_Node_Str" + app.uid);
  int userId=app.userId;
  if (providers != null) {
    int N=providers.size();
    app.pubProviders.ensureCapacity(N + app.pubProviders.size());
    for (int i=0; i < N; i++) {
      ProviderInfo cpi=(ProviderInfo)providers.get(i);
      boolean singleton=isSingleton(cpi.processName,cpi.applicationInfo,cpi.name,cpi.flags);
      if (singleton && UserHandle.getUserId(app.uid) != 0) {
        providers.remove(i);
        N--;
        i--;
        continue;
      }
      ComponentName comp=new ComponentName(cpi.packageName,cpi.name);
      ContentProviderRecord cpr=mProviderMap.getProviderByClass(comp,userId);
      if (cpr == null) {
        cpr=new ContentProviderRecord(this,cpi,app.info,comp,singleton);
        mProviderMap.putProviderByClass(comp,cpr);
      }
      if (DEBUG_MU)       Slog.v(TAG_MU,"String_Node_Str" + cpr.uid);
      app.pubProviders.put(cpi.name,cpr);
      if (!cpi.multiprocess || !"String_Node_Str".equals(cpi.packageName)) {
        app.addPackage(cpi.applicationInfo.packageName,mProcessStats);
      }
      ensurePackageDexOpt(cpi.applicationInfo.packageName);
    }
  }
  return providers;
}
Program: 651
Project: 651
Buggy source:
void startSpecificActivityLocked(ActivityRecord r,boolean andResume,boolean checkConfig){
  ProcessRecord app=mService.getProcessRecordLocked(r.processName,r.info.applicationInfo.uid,true);
  r.task.stack.setLaunchTime(r);
  if (app != null && app.thread != null) {
    try {
      app.addPackage(r.info.packageName,mService.mProcessStats);
      realStartActivityLocked(r,app,andResume,checkConfig);
      return;
    }
 catch (    RemoteException e) {
      Slog.w(TAG,"String_Node_Str" + r.intent.getComponent().flattenToShortString(),e);
    }
  }
  mService.startProcessLocked(r.processName,r.info.applicationInfo,true,0,"String_Node_Str",r.intent.getComponent(),false,false,true);
}

Fixed version (ground truth):
void startSpecificActivityLocked(ActivityRecord r,boolean andResume,boolean checkConfig){
  ProcessRecord app=mService.getProcessRecordLocked(r.processName,r.info.applicationInfo.uid,true);
  r.task.stack.setLaunchTime(r);
  if (app != null && app.thread != null) {
    try {
      if ((r.info.flags & ActivityInfo.FLAG_MULTIPROCESS) == 0 || !"String_Node_Str".equals(r.info.packageName)) {
        app.addPackage(r.info.packageName,mService.mProcessStats);
      }
      realStartActivityLocked(r,app,andResume,checkConfig);
      return;
    }
 catch (    RemoteException e) {
      Slog.w(TAG,"String_Node_Str" + r.intent.getComponent().flattenToShortString(),e);
    }
  }
  mService.startProcessLocked(r.processName,r.info.applicationInfo,true,0,"String_Node_Str",r.intent.getComponent(),false,false,true);
}
Program: 653
Project: 653
Buggy source:
public static long dumpSingleTime(PrintWriter pw,String prefix,long[] durations,int curState,long curStartTime,long now){
  long totalTime=0;
  int printedScreen=-1;
  for (int iscreen=0; iscreen < ADJ_COUNT; iscreen+=ADJ_SCREEN_MOD) {
    int printedMem=-1;
    for (int imem=0; imem < ADJ_MEM_FACTOR_COUNT; imem++) {
      int state=imem + iscreen;
      long time=durations[state];
      String running="String_Node_Str";
      if (curState == state) {
        time+=now - curStartTime;
        if (pw != null) {
          running="String_Node_Str";
        }
      }
      if (time != 0) {
        if (pw != null) {
          pw.print(prefix);
          printScreenLabel(pw,printedScreen != iscreen ? iscreen : STATE_NOTHING);
          printedScreen=iscreen;
          printMemLabel(pw,printedMem != imem ? imem : STATE_NOTHING);
          printedMem=imem;
          TimeUtils.formatDuration(time,pw);
          pw.println(running);
        }
        totalTime+=time;
      }
    }
  }
  if (totalTime != 0 && pw != null) {
    pw.print(prefix);
    printScreenLabel(pw,STATE_NOTHING);
    pw.print("String_Node_Str");
    TimeUtils.formatDuration(totalTime,pw);
    pw.println();
  }
  return totalTime;
}

Fixed version (ground truth):
public static long dumpSingleTime(PrintWriter pw,String prefix,long[] durations,int curState,long curStartTime,long now){
  long totalTime=0;
  int printedScreen=-1;
  for (int iscreen=0; iscreen < ADJ_COUNT; iscreen+=ADJ_SCREEN_MOD) {
    int printedMem=-1;
    for (int imem=0; imem < ADJ_MEM_FACTOR_COUNT; imem++) {
      int state=imem + iscreen;
      long time=durations[state];
      String running="String_Node_Str";
      if (curState == state) {
        time+=now - curStartTime;
        if (pw != null) {
          running="String_Node_Str";
        }
      }
      if (time != 0) {
        if (pw != null) {
          pw.print(prefix);
          printScreenLabel(pw,printedScreen != iscreen ? iscreen : STATE_NOTHING);
          printedScreen=iscreen;
          printMemLabel(pw,printedMem != imem ? imem : STATE_NOTHING,(char)0);
          printedMem=imem;
          pw.print("String_Node_Str");
          TimeUtils.formatDuration(time,pw);
          pw.println(running);
        }
        totalTime+=time;
      }
    }
  }
  if (totalTime != 0 && pw != null) {
    pw.print(prefix);
    pw.print("String_Node_Str");
    TimeUtils.formatDuration(totalTime,pw);
    pw.println();
  }
  return totalTime;
}
Program: 654
Project: 654
Buggy source:
private static void printMemLabel(PrintWriter pw,int offset){
switch (offset) {
case ADJ_NOTHING:
    pw.print("String_Node_Str");
  break;
case ADJ_MEM_FACTOR_NORMAL:
pw.print("String_Node_Str");
break;
case ADJ_MEM_FACTOR_MODERATE:
pw.print("String_Node_Str");
break;
case ADJ_MEM_FACTOR_LOW:
pw.print("String_Node_Str");
break;
case ADJ_MEM_FACTOR_CRITICAL:
pw.print("String_Node_Str");
break;
default :
pw.print("String_Node_Str");
break;
}
}

Fixed version (ground truth):
private static void printMemLabel(PrintWriter pw,int offset,char sep){
switch (offset) {
case ADJ_NOTHING:
    pw.print("String_Node_Str");
  if (sep != 0)   pw.print(' ');
break;
case ADJ_MEM_FACTOR_NORMAL:
pw.print("String_Node_Str");
if (sep != 0) pw.print(sep);
break;
case ADJ_MEM_FACTOR_MODERATE:
pw.print("String_Node_Str");
if (sep != 0) pw.print(sep);
break;
case ADJ_MEM_FACTOR_LOW:
pw.print("String_Node_Str");
if (sep != 0) pw.print(sep);
break;
case ADJ_MEM_FACTOR_CRITICAL:
pw.print("String_Node_Str");
if (sep != 0) pw.print(sep);
break;
default :
pw.print("String_Node_Str");
if (sep != 0) pw.print(sep);
break;
}
}
Program: 655
Project: 655
Buggy source:
public static long dumpSingleServiceTime(PrintWriter pw,String prefix,ServiceState service,int serviceType,int curState,long curStartTime,long now){
  long totalTime=0;
  int printedScreen=-1;
  for (int iscreen=0; iscreen < ADJ_COUNT; iscreen+=ADJ_SCREEN_MOD) {
    int printedMem=-1;
    for (int imem=0; imem < ADJ_MEM_FACTOR_COUNT; imem++) {
      int state=imem + iscreen;
      long time=service.getDuration(serviceType,curState,curStartTime,state,now);
      String running="String_Node_Str";
      if (curState == state && pw != null) {
        running="String_Node_Str";
      }
      if (time != 0) {
        if (pw != null) {
          pw.print(prefix);
          printScreenLabel(pw,printedScreen != iscreen ? iscreen : STATE_NOTHING);
          printedScreen=iscreen;
          printMemLabel(pw,printedMem != imem ? imem : STATE_NOTHING);
          printedMem=imem;
          TimeUtils.formatDuration(time,pw);
          pw.println(running);
        }
        totalTime+=time;
      }
    }
  }
  if (totalTime != 0 && pw != null) {
    pw.print(prefix);
    printScreenLabel(pw,STATE_NOTHING);
    pw.print("String_Node_Str");
    TimeUtils.formatDuration(totalTime,pw);
    pw.println();
  }
  return totalTime;
}

Fixed version (ground truth):
public static long dumpSingleServiceTime(PrintWriter pw,String prefix,ServiceState service,int serviceType,int curState,long curStartTime,long now){
  long totalTime=0;
  int printedScreen=-1;
  for (int iscreen=0; iscreen < ADJ_COUNT; iscreen+=ADJ_SCREEN_MOD) {
    int printedMem=-1;
    for (int imem=0; imem < ADJ_MEM_FACTOR_COUNT; imem++) {
      int state=imem + iscreen;
      long time=service.getDuration(serviceType,curState,curStartTime,state,now);
      String running="String_Node_Str";
      if (curState == state && pw != null) {
        running="String_Node_Str";
      }
      if (time != 0) {
        if (pw != null) {
          pw.print(prefix);
          printScreenLabel(pw,printedScreen != iscreen ? iscreen : STATE_NOTHING);
          printedScreen=iscreen;
          printMemLabel(pw,printedMem != imem ? imem : STATE_NOTHING,(char)0);
          printedMem=imem;
          pw.print("String_Node_Str");
          TimeUtils.formatDuration(time,pw);
          pw.println(running);
        }
        totalTime+=time;
      }
    }
  }
  if (totalTime != 0 && pw != null) {
    pw.print(prefix);
    pw.print("String_Node_Str");
    TimeUtils.formatDuration(totalTime,pw);
    pw.println();
  }
  return totalTime;
}
Program: 657
Project: 657
Buggy source:
private void dumpProcessInternalLocked(PrintWriter pw,String prefix,ProcessState proc,boolean dumpAll){
  if (dumpAll) {
    pw.print(prefix);
    pw.print("String_Node_Str");
    pw.print(Integer.toHexString(System.identityHashCode(proc)));
    pw.print("String_Node_Str");
    pw.print(Integer.toHexString(System.identityHashCode(proc.mCommonProcess)));
    pw.print("String_Node_Str");
    pw.println(proc.mPackage);
    if (proc.mMultiPackage) {
      pw.print(prefix);
      pw.print("String_Node_Str");
      pw.println(proc.mMultiPackage);
    }
    if (proc != proc.mCommonProcess) {
      pw.print(prefix);
      pw.print("String_Node_Str");
      pw.print(proc.mCommonProcess.mName);
      pw.print("String_Node_Str");
      pw.print(proc.mCommonProcess.mUid);
      pw.print("String_Node_Str");
      pw.println(proc.mCommonProcess.mPackage);
    }
  }
  pw.print(prefix);
  pw.print("String_Node_Str");
  pw.println(proc.mActive);
  if (proc.mDead) {
    pw.print(prefix);
    pw.print("String_Node_Str");
    pw.println(proc.mDead);
  }
  pw.print(prefix);
  pw.print("String_Node_Str");
  pw.print(proc.mNumActiveServices);
  pw.print("String_Node_Str");
  pw.println(proc.mNumStartedServices);
}

Fixed version (ground truth):
private void dumpProcessInternalLocked(PrintWriter pw,String prefix,ProcessState proc,boolean dumpAll){
  if (dumpAll) {
    pw.print(prefix);
    pw.print("String_Node_Str");
    pw.print(Integer.toHexString(System.identityHashCode(proc)));
    pw.print("String_Node_Str");
    pw.print(Integer.toHexString(System.identityHashCode(proc.mCommonProcess)));
    pw.print("String_Node_Str");
    pw.println(proc.mPackage);
    if (proc.mMultiPackage) {
      pw.print(prefix);
      pw.print("String_Node_Str");
      pw.println(proc.mMultiPackage);
    }
    if (proc != proc.mCommonProcess) {
      pw.print(prefix);
      pw.print("String_Node_Str");
      pw.print(proc.mCommonProcess.mName);
      pw.print("String_Node_Str");
      pw.print(proc.mCommonProcess.mUid);
      pw.print("String_Node_Str");
      pw.println(proc.mCommonProcess.mPackage);
    }
  }
  if (proc.mActive) {
    pw.print(prefix);
    pw.print("String_Node_Str");
    pw.println(proc.mActive);
  }
  if (proc.mDead) {
    pw.print(prefix);
    pw.print("String_Node_Str");
    pw.println(proc.mDead);
  }
  if (proc.mNumActiveServices != 0 || proc.mNumStartedServices != 0) {
    pw.print(prefix);
    pw.print("String_Node_Str");
    pw.print(proc.mNumActiveServices);
    pw.print("String_Node_Str");
    pw.println(proc.mNumStartedServices);
  }
}
Program: 659
Project: 659
Buggy source:
private final List<ProviderInfo> generateApplicationProvidersLocked(ProcessRecord app){
  List<ProviderInfo> providers=null;
  try {
    providers=AppGlobals.getPackageManager().queryContentProviders(app.processName,app.uid,STOCK_PM_FLAGS | PackageManager.GET_URI_PERMISSION_PATTERNS);
  }
 catch (  RemoteException ex) {
  }
  if (DEBUG_MU)   Slog.v(TAG_MU,"String_Node_Str" + app.uid);
  int userId=app.userId;
  if (providers != null) {
    int N=providers.size();
    app.pubProviders.ensureCapacity(N + app.pubProviders.size());
    for (int i=0; i < N; i++) {
      ProviderInfo cpi=(ProviderInfo)providers.get(i);
      boolean singleton=isSingleton(cpi.processName,cpi.applicationInfo,cpi.name,cpi.flags);
      if (singleton && UserHandle.getUserId(app.uid) != 0) {
        providers.remove(i);
        N--;
        i--;
        continue;
      }
      ComponentName comp=new ComponentName(cpi.packageName,cpi.name);
      ContentProviderRecord cpr=mProviderMap.getProviderByClass(comp,userId);
      if (cpr == null) {
        cpr=new ContentProviderRecord(this,cpi,app.info,comp,singleton);
        mProviderMap.putProviderByClass(comp,cpr);
      }
      if (DEBUG_MU)       Slog.v(TAG_MU,"String_Node_Str" + cpr.uid);
      app.pubProviders.put(cpi.name,cpr);
      app.addPackage(cpi.applicationInfo.packageName,mProcessStats);
      ensurePackageDexOpt(cpi.applicationInfo.packageName);
    }
  }
  return providers;
}

Fixed version (ground truth):
private final List<ProviderInfo> generateApplicationProvidersLocked(ProcessRecord app){
  List<ProviderInfo> providers=null;
  try {
    providers=AppGlobals.getPackageManager().queryContentProviders(app.processName,app.uid,STOCK_PM_FLAGS | PackageManager.GET_URI_PERMISSION_PATTERNS);
  }
 catch (  RemoteException ex) {
  }
  if (DEBUG_MU)   Slog.v(TAG_MU,"String_Node_Str" + app.uid);
  int userId=app.userId;
  if (providers != null) {
    int N=providers.size();
    app.pubProviders.ensureCapacity(N + app.pubProviders.size());
    for (int i=0; i < N; i++) {
      ProviderInfo cpi=(ProviderInfo)providers.get(i);
      boolean singleton=isSingleton(cpi.processName,cpi.applicationInfo,cpi.name,cpi.flags);
      if (singleton && UserHandle.getUserId(app.uid) != 0) {
        providers.remove(i);
        N--;
        i--;
        continue;
      }
      ComponentName comp=new ComponentName(cpi.packageName,cpi.name);
      ContentProviderRecord cpr=mProviderMap.getProviderByClass(comp,userId);
      if (cpr == null) {
        cpr=new ContentProviderRecord(this,cpi,app.info,comp,singleton);
        mProviderMap.putProviderByClass(comp,cpr);
      }
      if (DEBUG_MU)       Slog.v(TAG_MU,"String_Node_Str" + cpr.uid);
      app.pubProviders.put(cpi.name,cpr);
      if (!cpi.multiprocess || !"String_Node_Str".equals(cpi.packageName)) {
        app.addPackage(cpi.applicationInfo.packageName,mProcessStats);
      }
      ensurePackageDexOpt(cpi.applicationInfo.packageName);
    }
  }
  return providers;
}
Program: 661
Project: 661
Buggy source:
void startSpecificActivityLocked(ActivityRecord r,boolean andResume,boolean checkConfig){
  ProcessRecord app=mService.getProcessRecordLocked(r.processName,r.info.applicationInfo.uid,true);
  r.task.stack.setLaunchTime(r);
  if (app != null && app.thread != null) {
    try {
      app.addPackage(r.info.packageName,mService.mProcessStats);
      realStartActivityLocked(r,app,andResume,checkConfig);
      return;
    }
 catch (    RemoteException e) {
      Slog.w(TAG,"String_Node_Str" + r.intent.getComponent().flattenToShortString(),e);
    }
  }
  mService.startProcessLocked(r.processName,r.info.applicationInfo,true,0,"String_Node_Str",r.intent.getComponent(),false,false,true);
}

Fixed version (ground truth):
void startSpecificActivityLocked(ActivityRecord r,boolean andResume,boolean checkConfig){
  ProcessRecord app=mService.getProcessRecordLocked(r.processName,r.info.applicationInfo.uid,true);
  r.task.stack.setLaunchTime(r);
  if (app != null && app.thread != null) {
    try {
      if ((r.info.flags & ActivityInfo.FLAG_MULTIPROCESS) == 0 || !"String_Node_Str".equals(r.info.packageName)) {
        app.addPackage(r.info.packageName,mService.mProcessStats);
      }
      realStartActivityLocked(r,app,andResume,checkConfig);
      return;
    }
 catch (    RemoteException e) {
      Slog.w(TAG,"String_Node_Str" + r.intent.getComponent().flattenToShortString(),e);
    }
  }
  mService.startProcessLocked(r.processName,r.info.applicationInfo,true,0,"String_Node_Str",r.intent.getComponent(),false,false,true);
}
Program: 663
Project: 663
Buggy source:
@Override public void setForcedDisplayDensity(int displayId,int density){
  if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + android.Manifest.permission.WRITE_SECURE_SETTINGS);
  }
  if (displayId != Display.DEFAULT_DISPLAY) {
    throw new IllegalArgumentException("String_Node_Str");
  }
synchronized (mWindowMap) {
    final DisplayContent displayContent=getDisplayContentLocked(displayId);
    if (displayContent != null) {
      setForcedDisplayDensityLocked(displayContent,density);
      Settings.Global.putString(mContext.getContentResolver(),Settings.Global.DISPLAY_DENSITY_FORCED,Integer.toString(density));
    }
  }
}

Fixed version (ground truth):
@Override public void setForcedDisplayDensity(int displayId,int density){
  if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + android.Manifest.permission.WRITE_SECURE_SETTINGS);
  }
  if (displayId != Display.DEFAULT_DISPLAY) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final long ident=Binder.clearCallingIdentity();
  try {
synchronized (mWindowMap) {
      final DisplayContent displayContent=getDisplayContentLocked(displayId);
      if (displayContent != null) {
        setForcedDisplayDensityLocked(displayContent,density);
        Settings.Global.putString(mContext.getContentResolver(),Settings.Global.DISPLAY_DENSITY_FORCED,Integer.toString(density));
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
}
Program: 664
Project: 664
Buggy source:
@Override public void setForcedDisplaySize(int displayId,int width,int height){
  if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + android.Manifest.permission.WRITE_SECURE_SETTINGS);
  }
  if (displayId != Display.DEFAULT_DISPLAY) {
    throw new IllegalArgumentException("String_Node_Str");
  }
synchronized (mWindowMap) {
    final int MIN_WIDTH=200;
    final int MIN_HEIGHT=200;
    final int MAX_SCALE=2;
    final DisplayContent displayContent=getDisplayContentLocked(displayId);
    if (displayContent != null) {
      width=Math.min(Math.max(width,MIN_WIDTH),displayContent.mInitialDisplayWidth * MAX_SCALE);
      height=Math.min(Math.max(height,MIN_HEIGHT),displayContent.mInitialDisplayHeight * MAX_SCALE);
      setForcedDisplaySizeLocked(displayContent,width,height);
      Settings.Global.putString(mContext.getContentResolver(),Settings.Global.DISPLAY_SIZE_FORCED,width + "String_Node_Str" + height);
    }
  }
}

Fixed version (ground truth):
@Override public void setForcedDisplaySize(int displayId,int width,int height){
  if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + android.Manifest.permission.WRITE_SECURE_SETTINGS);
  }
  if (displayId != Display.DEFAULT_DISPLAY) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final long ident=Binder.clearCallingIdentity();
  try {
synchronized (mWindowMap) {
      final int MIN_WIDTH=200;
      final int MIN_HEIGHT=200;
      final int MAX_SCALE=2;
      final DisplayContent displayContent=getDisplayContentLocked(displayId);
      if (displayContent != null) {
        width=Math.min(Math.max(width,MIN_WIDTH),displayContent.mInitialDisplayWidth * MAX_SCALE);
        height=Math.min(Math.max(height,MIN_HEIGHT),displayContent.mInitialDisplayHeight * MAX_SCALE);
        setForcedDisplaySizeLocked(displayContent,width,height);
        Settings.Global.putString(mContext.getContentResolver(),Settings.Global.DISPLAY_SIZE_FORCED,width + "String_Node_Str" + height);
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
}
Program: 665
Project: 665
Buggy source:
@Override public void clearForcedDisplaySize(int displayId){
  if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + android.Manifest.permission.WRITE_SECURE_SETTINGS);
  }
  if (displayId != Display.DEFAULT_DISPLAY) {
    throw new IllegalArgumentException("String_Node_Str");
  }
synchronized (mWindowMap) {
    final DisplayContent displayContent=getDisplayContentLocked(displayId);
    if (displayContent != null) {
      setForcedDisplaySizeLocked(displayContent,displayContent.mInitialDisplayWidth,displayContent.mInitialDisplayHeight);
      Settings.Global.putString(mContext.getContentResolver(),Settings.Global.DISPLAY_SIZE_FORCED,"String_Node_Str");
    }
  }
}

Fixed version (ground truth):
@Override public void clearForcedDisplaySize(int displayId){
  if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + android.Manifest.permission.WRITE_SECURE_SETTINGS);
  }
  if (displayId != Display.DEFAULT_DISPLAY) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final long ident=Binder.clearCallingIdentity();
  try {
synchronized (mWindowMap) {
      final DisplayContent displayContent=getDisplayContentLocked(displayId);
      if (displayContent != null) {
        setForcedDisplaySizeLocked(displayContent,displayContent.mInitialDisplayWidth,displayContent.mInitialDisplayHeight);
        Settings.Global.putString(mContext.getContentResolver(),Settings.Global.DISPLAY_SIZE_FORCED,"String_Node_Str");
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
}
Program: 666
Project: 666
Buggy source:
@Override public void clearForcedDisplayDensity(int displayId){
  if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + android.Manifest.permission.WRITE_SECURE_SETTINGS);
  }
  if (displayId != Display.DEFAULT_DISPLAY) {
    throw new IllegalArgumentException("String_Node_Str");
  }
synchronized (mWindowMap) {
    final DisplayContent displayContent=getDisplayContentLocked(displayId);
    if (displayContent != null) {
      setForcedDisplayDensityLocked(displayContent,displayContent.mInitialDisplayDensity);
      Settings.Global.putString(mContext.getContentResolver(),Settings.Global.DISPLAY_DENSITY_FORCED,"String_Node_Str");
    }
  }
}

Fixed version (ground truth):
@Override public void clearForcedDisplayDensity(int displayId){
  if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + android.Manifest.permission.WRITE_SECURE_SETTINGS);
  }
  if (displayId != Display.DEFAULT_DISPLAY) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final long ident=Binder.clearCallingIdentity();
  try {
synchronized (mWindowMap) {
      final DisplayContent displayContent=getDisplayContentLocked(displayId);
      if (displayContent != null) {
        setForcedDisplayDensityLocked(displayContent,displayContent.mInitialDisplayDensity);
        Settings.Global.putString(mContext.getContentResolver(),Settings.Global.DISPLAY_DENSITY_FORCED,"String_Node_Str");
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
}
Program: 667
Project: 667
Buggy source:
@Override public void setOverscan(int displayId,int left,int top,int right,int bottom){
  if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + android.Manifest.permission.WRITE_SECURE_SETTINGS);
  }
synchronized (mWindowMap) {
    DisplayContent displayContent=getDisplayContentLocked(displayId);
    if (displayContent != null) {
      setOverscanLocked(displayContent,left,top,right,bottom);
    }
  }
}

Fixed version (ground truth):
@Override public void setOverscan(int displayId,int left,int top,int right,int bottom){
  if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + android.Manifest.permission.WRITE_SECURE_SETTINGS);
  }
  final long ident=Binder.clearCallingIdentity();
  try {
synchronized (mWindowMap) {
      DisplayContent displayContent=getDisplayContentLocked(displayId);
      if (displayContent != null) {
        setOverscanLocked(displayContent,left,top,right,bottom);
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
}
Program: 668
Project: 668
Buggy source:
@Override public void setForcedDisplayDensity(int displayId,int density){
  if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + android.Manifest.permission.WRITE_SECURE_SETTINGS);
  }
  if (displayId != Display.DEFAULT_DISPLAY) {
    throw new IllegalArgumentException("String_Node_Str");
  }
synchronized (mWindowMap) {
    final DisplayContent displayContent=getDisplayContentLocked(displayId);
    if (displayContent != null) {
      setForcedDisplayDensityLocked(displayContent,density);
      Settings.Global.putString(mContext.getContentResolver(),Settings.Global.DISPLAY_DENSITY_FORCED,Integer.toString(density));
    }
  }
}

Fixed version (ground truth):
@Override public void setForcedDisplayDensity(int displayId,int density){
  if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + android.Manifest.permission.WRITE_SECURE_SETTINGS);
  }
  if (displayId != Display.DEFAULT_DISPLAY) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final long ident=Binder.clearCallingIdentity();
  try {
synchronized (mWindowMap) {
      final DisplayContent displayContent=getDisplayContentLocked(displayId);
      if (displayContent != null) {
        setForcedDisplayDensityLocked(displayContent,density);
        Settings.Global.putString(mContext.getContentResolver(),Settings.Global.DISPLAY_DENSITY_FORCED,Integer.toString(density));
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
}
Program: 669
Project: 669
Buggy source:
@Override public void setForcedDisplaySize(int displayId,int width,int height){
  if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + android.Manifest.permission.WRITE_SECURE_SETTINGS);
  }
  if (displayId != Display.DEFAULT_DISPLAY) {
    throw new IllegalArgumentException("String_Node_Str");
  }
synchronized (mWindowMap) {
    final int MIN_WIDTH=200;
    final int MIN_HEIGHT=200;
    final int MAX_SCALE=2;
    final DisplayContent displayContent=getDisplayContentLocked(displayId);
    if (displayContent != null) {
      width=Math.min(Math.max(width,MIN_WIDTH),displayContent.mInitialDisplayWidth * MAX_SCALE);
      height=Math.min(Math.max(height,MIN_HEIGHT),displayContent.mInitialDisplayHeight * MAX_SCALE);
      setForcedDisplaySizeLocked(displayContent,width,height);
      Settings.Global.putString(mContext.getContentResolver(),Settings.Global.DISPLAY_SIZE_FORCED,width + "String_Node_Str" + height);
    }
  }
}

Fixed version (ground truth):
@Override public void setForcedDisplaySize(int displayId,int width,int height){
  if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + android.Manifest.permission.WRITE_SECURE_SETTINGS);
  }
  if (displayId != Display.DEFAULT_DISPLAY) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final long ident=Binder.clearCallingIdentity();
  try {
synchronized (mWindowMap) {
      final int MIN_WIDTH=200;
      final int MIN_HEIGHT=200;
      final int MAX_SCALE=2;
      final DisplayContent displayContent=getDisplayContentLocked(displayId);
      if (displayContent != null) {
        width=Math.min(Math.max(width,MIN_WIDTH),displayContent.mInitialDisplayWidth * MAX_SCALE);
        height=Math.min(Math.max(height,MIN_HEIGHT),displayContent.mInitialDisplayHeight * MAX_SCALE);
        setForcedDisplaySizeLocked(displayContent,width,height);
        Settings.Global.putString(mContext.getContentResolver(),Settings.Global.DISPLAY_SIZE_FORCED,width + "String_Node_Str" + height);
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
}
Program: 670
Project: 670
Buggy source:
@Override public void clearForcedDisplaySize(int displayId){
  if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + android.Manifest.permission.WRITE_SECURE_SETTINGS);
  }
  if (displayId != Display.DEFAULT_DISPLAY) {
    throw new IllegalArgumentException("String_Node_Str");
  }
synchronized (mWindowMap) {
    final DisplayContent displayContent=getDisplayContentLocked(displayId);
    if (displayContent != null) {
      setForcedDisplaySizeLocked(displayContent,displayContent.mInitialDisplayWidth,displayContent.mInitialDisplayHeight);
      Settings.Global.putString(mContext.getContentResolver(),Settings.Global.DISPLAY_SIZE_FORCED,"String_Node_Str");
    }
  }
}

Fixed version (ground truth):
@Override public void clearForcedDisplaySize(int displayId){
  if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + android.Manifest.permission.WRITE_SECURE_SETTINGS);
  }
  if (displayId != Display.DEFAULT_DISPLAY) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final long ident=Binder.clearCallingIdentity();
  try {
synchronized (mWindowMap) {
      final DisplayContent displayContent=getDisplayContentLocked(displayId);
      if (displayContent != null) {
        setForcedDisplaySizeLocked(displayContent,displayContent.mInitialDisplayWidth,displayContent.mInitialDisplayHeight);
        Settings.Global.putString(mContext.getContentResolver(),Settings.Global.DISPLAY_SIZE_FORCED,"String_Node_Str");
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
}
Program: 671
Project: 671
Buggy source:
@Override public void clearForcedDisplayDensity(int displayId){
  if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + android.Manifest.permission.WRITE_SECURE_SETTINGS);
  }
  if (displayId != Display.DEFAULT_DISPLAY) {
    throw new IllegalArgumentException("String_Node_Str");
  }
synchronized (mWindowMap) {
    final DisplayContent displayContent=getDisplayContentLocked(displayId);
    if (displayContent != null) {
      setForcedDisplayDensityLocked(displayContent,displayContent.mInitialDisplayDensity);
      Settings.Global.putString(mContext.getContentResolver(),Settings.Global.DISPLAY_DENSITY_FORCED,"String_Node_Str");
    }
  }
}

Fixed version (ground truth):
@Override public void clearForcedDisplayDensity(int displayId){
  if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + android.Manifest.permission.WRITE_SECURE_SETTINGS);
  }
  if (displayId != Display.DEFAULT_DISPLAY) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final long ident=Binder.clearCallingIdentity();
  try {
synchronized (mWindowMap) {
      final DisplayContent displayContent=getDisplayContentLocked(displayId);
      if (displayContent != null) {
        setForcedDisplayDensityLocked(displayContent,displayContent.mInitialDisplayDensity);
        Settings.Global.putString(mContext.getContentResolver(),Settings.Global.DISPLAY_DENSITY_FORCED,"String_Node_Str");
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
}
Program: 672
Project: 672
Buggy source:
@Override public void setOverscan(int displayId,int left,int top,int right,int bottom){
  if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + android.Manifest.permission.WRITE_SECURE_SETTINGS);
  }
synchronized (mWindowMap) {
    DisplayContent displayContent=getDisplayContentLocked(displayId);
    if (displayContent != null) {
      setOverscanLocked(displayContent,left,top,right,bottom);
    }
  }
}

Fixed version (ground truth):
@Override public void setOverscan(int displayId,int left,int top,int right,int bottom){
  if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + android.Manifest.permission.WRITE_SECURE_SETTINGS);
  }
  final long ident=Binder.clearCallingIdentity();
  try {
synchronized (mWindowMap) {
      DisplayContent displayContent=getDisplayContentLocked(displayId);
      if (displayContent != null) {
        setOverscanLocked(displayContent,left,top,right,bottom);
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
}
Program: 673
Project: 673
Buggy source:
public static long dumpSingleTime(PrintWriter pw,String prefix,long[] durations,int curState,long curStartTime,long now){
  long totalTime=0;
  int printedScreen=-1;
  for (int iscreen=0; iscreen < ADJ_COUNT; iscreen+=ADJ_SCREEN_MOD) {
    int printedMem=-1;
    for (int imem=0; imem < ADJ_MEM_FACTOR_COUNT; imem++) {
      int state=imem + iscreen;
      long time=durations[state];
      String running="String_Node_Str";
      if (curState == state) {
        time+=now - curStartTime;
        if (pw != null) {
          running="String_Node_Str";
        }
      }
      if (time != 0) {
        if (pw != null) {
          pw.print(prefix);
          printScreenLabel(pw,printedScreen != iscreen ? iscreen : STATE_NOTHING);
          printedScreen=iscreen;
          printMemLabel(pw,printedMem != imem ? imem : STATE_NOTHING);
          printedMem=imem;
          TimeUtils.formatDuration(time,pw);
          pw.println(running);
        }
        totalTime+=time;
      }
    }
  }
  if (totalTime != 0 && pw != null) {
    pw.print(prefix);
    printScreenLabel(pw,STATE_NOTHING);
    pw.print("String_Node_Str");
    TimeUtils.formatDuration(totalTime,pw);
    pw.println();
  }
  return totalTime;
}

Fixed version (ground truth):
public static long dumpSingleTime(PrintWriter pw,String prefix,long[] durations,int curState,long curStartTime,long now){
  long totalTime=0;
  int printedScreen=-1;
  for (int iscreen=0; iscreen < ADJ_COUNT; iscreen+=ADJ_SCREEN_MOD) {
    int printedMem=-1;
    for (int imem=0; imem < ADJ_MEM_FACTOR_COUNT; imem++) {
      int state=imem + iscreen;
      long time=durations[state];
      String running="String_Node_Str";
      if (curState == state) {
        time+=now - curStartTime;
        if (pw != null) {
          running="String_Node_Str";
        }
      }
      if (time != 0) {
        if (pw != null) {
          pw.print(prefix);
          printScreenLabel(pw,printedScreen != iscreen ? iscreen : STATE_NOTHING);
          printedScreen=iscreen;
          printMemLabel(pw,printedMem != imem ? imem : STATE_NOTHING,(char)0);
          printedMem=imem;
          pw.print("String_Node_Str");
          TimeUtils.formatDuration(time,pw);
          pw.println(running);
        }
        totalTime+=time;
      }
    }
  }
  if (totalTime != 0 && pw != null) {
    pw.print(prefix);
    pw.print("String_Node_Str");
    TimeUtils.formatDuration(totalTime,pw);
    pw.println();
  }
  return totalTime;
}
Program: 674
Project: 674
Buggy source:
private static void printMemLabel(PrintWriter pw,int offset){
switch (offset) {
case ADJ_NOTHING:
    pw.print("String_Node_Str");
  break;
case ADJ_MEM_FACTOR_NORMAL:
pw.print("String_Node_Str");
break;
case ADJ_MEM_FACTOR_MODERATE:
pw.print("String_Node_Str");
break;
case ADJ_MEM_FACTOR_LOW:
pw.print("String_Node_Str");
break;
case ADJ_MEM_FACTOR_CRITICAL:
pw.print("String_Node_Str");
break;
default :
pw.print("String_Node_Str");
break;
}
}

Fixed version (ground truth):
private static void printMemLabel(PrintWriter pw,int offset,char sep){
switch (offset) {
case ADJ_NOTHING:
    pw.print("String_Node_Str");
  if (sep != 0)   pw.print(' ');
break;
case ADJ_MEM_FACTOR_NORMAL:
pw.print("String_Node_Str");
if (sep != 0) pw.print(sep);
break;
case ADJ_MEM_FACTOR_MODERATE:
pw.print("String_Node_Str");
if (sep != 0) pw.print(sep);
break;
case ADJ_MEM_FACTOR_LOW:
pw.print("String_Node_Str");
if (sep != 0) pw.print(sep);
break;
case ADJ_MEM_FACTOR_CRITICAL:
pw.print("String_Node_Str");
if (sep != 0) pw.print(sep);
break;
default :
pw.print("String_Node_Str");
if (sep != 0) pw.print(sep);
break;
}
}
Program: 675
Project: 675
Buggy source:
public static long dumpSingleServiceTime(PrintWriter pw,String prefix,ServiceState service,int serviceType,int curState,long curStartTime,long now){
  long totalTime=0;
  int printedScreen=-1;
  for (int iscreen=0; iscreen < ADJ_COUNT; iscreen+=ADJ_SCREEN_MOD) {
    int printedMem=-1;
    for (int imem=0; imem < ADJ_MEM_FACTOR_COUNT; imem++) {
      int state=imem + iscreen;
      long time=service.getDuration(serviceType,curState,curStartTime,state,now);
      String running="String_Node_Str";
      if (curState == state && pw != null) {
        running="String_Node_Str";
      }
      if (time != 0) {
        if (pw != null) {
          pw.print(prefix);
          printScreenLabel(pw,printedScreen != iscreen ? iscreen : STATE_NOTHING);
          printedScreen=iscreen;
          printMemLabel(pw,printedMem != imem ? imem : STATE_NOTHING);
          printedMem=imem;
          TimeUtils.formatDuration(time,pw);
          pw.println(running);
        }
        totalTime+=time;
      }
    }
  }
  if (totalTime != 0 && pw != null) {
    pw.print(prefix);
    printScreenLabel(pw,STATE_NOTHING);
    pw.print("String_Node_Str");
    TimeUtils.formatDuration(totalTime,pw);
    pw.println();
  }
  return totalTime;
}

Fixed version (ground truth):
public static long dumpSingleServiceTime(PrintWriter pw,String prefix,ServiceState service,int serviceType,int curState,long curStartTime,long now){
  long totalTime=0;
  int printedScreen=-1;
  for (int iscreen=0; iscreen < ADJ_COUNT; iscreen+=ADJ_SCREEN_MOD) {
    int printedMem=-1;
    for (int imem=0; imem < ADJ_MEM_FACTOR_COUNT; imem++) {
      int state=imem + iscreen;
      long time=service.getDuration(serviceType,curState,curStartTime,state,now);
      String running="String_Node_Str";
      if (curState == state && pw != null) {
        running="String_Node_Str";
      }
      if (time != 0) {
        if (pw != null) {
          pw.print(prefix);
          printScreenLabel(pw,printedScreen != iscreen ? iscreen : STATE_NOTHING);
          printedScreen=iscreen;
          printMemLabel(pw,printedMem != imem ? imem : STATE_NOTHING,(char)0);
          printedMem=imem;
          pw.print("String_Node_Str");
          TimeUtils.formatDuration(time,pw);
          pw.println(running);
        }
        totalTime+=time;
      }
    }
  }
  if (totalTime != 0 && pw != null) {
    pw.print(prefix);
    pw.print("String_Node_Str");
    TimeUtils.formatDuration(totalTime,pw);
    pw.println();
  }
  return totalTime;
}