Program: 195484
Project: 195484
Buggy source:
final public String printCurrentState(long now){
  buildWorkingProcs();
  StringWriter sw=new StringWriter();
  PrintWriter pw=new FastPrintWriter(sw,false,1024);
  pw.print("String_Node_Str");
  if (now > mLastSampleTime) {
    pw.print(now - mLastSampleTime);
    pw.print("String_Node_Str");
    pw.print(now - mCurrentSampleTime);
    pw.print("String_Node_Str");
  }
 else {
    pw.print(mLastSampleTime - now);
    pw.print("String_Node_Str");
    pw.print(mCurrentSampleTime - now);
    pw.print("String_Node_Str");
  }
  long sampleTime=mCurrentSampleTime - mLastSampleTime;
  long sampleRealTime=mCurrentSampleRealTime - mLastSampleRealTime;
  long percAwake=sampleRealTime > 0 ? ((sampleTime * 100) / sampleRealTime) : 0;
  if (percAwake != 100) {
    pw.print("String_Node_Str");
    pw.print(percAwake);
    pw.print("String_Node_Str");
  }
  pw.println("String_Node_Str");
  final int totalTime=mRelUserTime + mRelSystemTime + mRelIoWaitTime+ mRelIrqTime+ mRelSoftIrqTime+ mRelIdleTime;
  if (DEBUG)   Slog.i(TAG,"String_Node_Str" + totalTime + "String_Node_Str"+ (mCurrentSampleTime - mLastSampleTime));
  int N=mWorkingProcs.size();
  for (int i=0; i < N; i++) {
    Stats st=mWorkingProcs.get(i);
    printProcessCPU(pw,st.added ? "String_Node_Str" : (st.removed ? "String_Node_Str" : "String_Node_Str"),st.pid,st.name,(int)(st.rel_uptime + 5) / 10,st.rel_utime,st.rel_stime,0,0,0,st.rel_minfaults,st.rel_majfaults);
    if (!st.removed && st.workingThreads != null) {
      int M=st.workingThreads.size();
      for (int j=0; j < M; j++) {
        Stats tst=st.workingThreads.get(j);
        printProcessCPU(pw,tst.added ? "String_Node_Str" : (tst.removed ? "String_Node_Str" : "String_Node_Str"),tst.pid,tst.name,(int)(st.rel_uptime + 5) / 10,tst.rel_utime,tst.rel_stime,0,0,0,0,0);
      }
    }
  }
  printProcessCPU(pw,"String_Node_Str",-1,"String_Node_Str",totalTime,mRelUserTime,mRelSystemTime,mRelIoWaitTime,mRelIrqTime,mRelSoftIrqTime,0,0);
  pw.flush();
  return sw.toString();
}

Fixed version (ground truth):
final public String printCurrentState(long now){
  buildWorkingProcs();
  StringWriter sw=new StringWriter();
  PrintWriter pw=new FastPrintWriter(sw,false,1024);
  pw.print("String_Node_Str");
  if (now > mLastSampleTime) {
    pw.print(now - mLastSampleTime);
    pw.print("String_Node_Str");
    pw.print(now - mCurrentSampleTime);
    pw.print("String_Node_Str");
  }
 else {
    pw.print(mLastSampleTime - now);
    pw.print("String_Node_Str");
    pw.print(mCurrentSampleTime - now);
    pw.print("String_Node_Str");
  }
  long sampleTime=mCurrentSampleTime - mLastSampleTime;
  long sampleRealTime=mCurrentSampleRealTime - mLastSampleRealTime;
  long percAwake=sampleRealTime > 0 ? ((sampleTime * 100) / sampleRealTime) : 0;
  if (percAwake != 100) {
    pw.print("String_Node_Str");
    pw.print(percAwake);
    pw.print("String_Node_Str");
  }
  pw.println("String_Node_Str");
  final int totalTime=mRelUserTime + mRelSystemTime + mRelIoWaitTime+ mRelIrqTime+ mRelSoftIrqTime+ mRelIdleTime;
  if (DEBUG)   Slog.i(TAG,"String_Node_Str" + totalTime + "String_Node_Str"+ (mCurrentSampleTime - mLastSampleTime));
  int N=mWorkingProcs.size();
  for (int i=0; i < N; i++) {
    Stats st=mWorkingProcs.get(i);
    printProcessCPU(pw,st.added ? "String_Node_Str" : (st.removed ? "String_Node_Str" : "String_Node_Str"),st.pid,st.name,(int)st.rel_uptime,st.rel_utime,st.rel_stime,0,0,0,st.rel_minfaults,st.rel_majfaults);
    if (!st.removed && st.workingThreads != null) {
      int M=st.workingThreads.size();
      for (int j=0; j < M; j++) {
        Stats tst=st.workingThreads.get(j);
        printProcessCPU(pw,tst.added ? "String_Node_Str" : (tst.removed ? "String_Node_Str" : "String_Node_Str"),tst.pid,tst.name,(int)st.rel_uptime,tst.rel_utime,tst.rel_stime,0,0,0,0,0);
      }
    }
  }
  printProcessCPU(pw,"String_Node_Str",-1,"String_Node_Str",totalTime,mRelUserTime,mRelSystemTime,mRelIoWaitTime,mRelIrqTime,mRelSoftIrqTime,0,0);
  pw.flush();
  return sw.toString();
}