Program: 193448
Project: 193448
Buggy source:
final boolean dumpLocked(FileDescriptor fd,PrintWriter pw,String[] args,int opti,boolean dumpAll,String dumpPackage,boolean needSep){
  if (mParallelBroadcasts.size() > 0 || mOrderedBroadcasts.size() > 0 || mPendingBroadcast != null) {
    boolean printed=false;
    for (int i=mParallelBroadcasts.size() - 1; i >= 0; i--) {
      BroadcastRecord br=mParallelBroadcasts.get(i);
      if (dumpPackage != null && !dumpPackage.equals(br.callerPackage)) {
        continue;
      }
      if (!printed) {
        if (needSep) {
          pw.println();
        }
        needSep=true;
        printed=true;
        pw.println("String_Node_Str" + mQueueName + "String_Node_Str");
      }
      pw.println("String_Node_Str" + mQueueName + "String_Node_Str"+ i+ "String_Node_Str");
      br.dump(pw,"String_Node_Str");
    }
    printed=false;
    needSep=true;
    for (int i=mOrderedBroadcasts.size() - 1; i >= 0; i--) {
      BroadcastRecord br=mOrderedBroadcasts.get(i);
      if (dumpPackage != null && !dumpPackage.equals(br.callerPackage)) {
        continue;
      }
      if (!printed) {
        if (needSep) {
          pw.println();
        }
        needSep=true;
        printed=true;
        pw.println("String_Node_Str" + mQueueName + "String_Node_Str");
      }
      pw.println("String_Node_Str" + mQueueName + "String_Node_Str"+ i+ "String_Node_Str");
      mOrderedBroadcasts.get(i).dump(pw,"String_Node_Str");
    }
    if (dumpPackage == null || (mPendingBroadcast != null && dumpPackage.equals(mPendingBroadcast.callerPackage))) {
      if (needSep) {
        pw.println();
      }
      pw.println("String_Node_Str" + mQueueName + "String_Node_Str");
      if (mPendingBroadcast != null) {
        mPendingBroadcast.dump(pw,"String_Node_Str");
      }
 else {
        pw.println("String_Node_Str");
      }
      needSep=true;
    }
  }
  int i;
  boolean printed=false;
  i=-1;
  int lastIndex=mHistoryNext;
  int ringIndex=lastIndex;
  do {
    ringIndex=ringAdvance(ringIndex,-1,MAX_BROADCAST_HISTORY);
    BroadcastRecord r=mBroadcastHistory[ringIndex];
    if (r == null) {
      continue;
    }
    i++;
    if (dumpPackage != null && !dumpPackage.equals(r.callerPackage)) {
      continue;
    }
    if (!printed) {
      if (needSep) {
        pw.println();
      }
      needSep=true;
      pw.println("String_Node_Str" + mQueueName + "String_Node_Str");
      printed=true;
    }
    if (dumpAll) {
      pw.print("String_Node_Str" + mQueueName + "String_Node_Str");
      pw.print(i);
      pw.println("String_Node_Str");
      r.dump(pw,"String_Node_Str");
    }
 else {
      pw.print("String_Node_Str");
      pw.print(i);
      pw.print("String_Node_Str");
      pw.println(r);
      pw.print("String_Node_Str");
      pw.println(r.intent.toShortString(false,true,true,false));
      if (r.targetComp != null && r.targetComp != r.intent.getComponent()) {
        pw.print("String_Node_Str");
        pw.println(r.targetComp.toShortString());
      }
      Bundle bundle=r.intent.getExtras();
      if (bundle != null) {
        pw.print("String_Node_Str");
        pw.println(bundle.toString());
      }
    }
  }
 while (ringIndex != lastIndex);
  if (dumpPackage == null) {
    lastIndex=ringIndex=mSummaryHistoryNext;
    if (dumpAll) {
      printed=false;
      i=-1;
    }
 else {
      for (int j=i; j > 0 && ringIndex != lastIndex; ) {
        ringIndex=ringAdvance(ringIndex,-1,MAX_BROADCAST_SUMMARY_HISTORY);
        BroadcastRecord r=mBroadcastHistory[ringIndex];
        if (r == null) {
          continue;
        }
        j--;
      }
    }
    SimpleDateFormat sdf=new SimpleDateFormat("String_Node_Str");
    do {
      ringIndex=ringAdvance(ringIndex,-1,MAX_BROADCAST_SUMMARY_HISTORY);
      Intent intent=mBroadcastSummaryHistory[ringIndex];
      if (intent == null) {
        continue;
      }
      if (!printed) {
        if (needSep) {
          pw.println();
        }
        needSep=true;
        pw.println("String_Node_Str" + mQueueName + "String_Node_Str");
        printed=true;
      }
      if (!dumpAll && i >= 50) {
        pw.println("String_Node_Str");
        break;
      }
      i++;
      pw.print("String_Node_Str");
      pw.print(i);
      pw.print("String_Node_Str");
      pw.println(intent.toShortString(false,true,true,false));
      pw.print("String_Node_Str");
      pw.print(sdf.format(new Date(mSummaryHistoryEnqueueTime[ringIndex])));
      pw.print("String_Node_Str");
      pw.print(sdf.format(new Date(mSummaryHistoryDispatchTime[ringIndex])));
      pw.print("String_Node_Str");
      pw.println(sdf.format(new Date(mSummaryHistoryFinishTime[ringIndex])));
      Bundle bundle=intent.getExtras();
      if (bundle != null) {
        pw.print("String_Node_Str");
        pw.println(bundle.toString());
      }
    }
 while (ringIndex != lastIndex);
  }
  return needSep;
}

Fixed version (ground truth):
final boolean dumpLocked(FileDescriptor fd,PrintWriter pw,String[] args,int opti,boolean dumpAll,String dumpPackage,boolean needSep){
  SimpleDateFormat sdf=new SimpleDateFormat("String_Node_Str");
  if (mParallelBroadcasts.size() > 0 || mOrderedBroadcasts.size() > 0 || mPendingBroadcast != null) {
    boolean printed=false;
    for (int i=mParallelBroadcasts.size() - 1; i >= 0; i--) {
      BroadcastRecord br=mParallelBroadcasts.get(i);
      if (dumpPackage != null && !dumpPackage.equals(br.callerPackage)) {
        continue;
      }
      if (!printed) {
        if (needSep) {
          pw.println();
        }
        needSep=true;
        printed=true;
        pw.println("String_Node_Str" + mQueueName + "String_Node_Str");
      }
      pw.println("String_Node_Str" + mQueueName + "String_Node_Str"+ i+ "String_Node_Str");
      br.dump(pw,"String_Node_Str",sdf);
    }
    printed=false;
    needSep=true;
    for (int i=mOrderedBroadcasts.size() - 1; i >= 0; i--) {
      BroadcastRecord br=mOrderedBroadcasts.get(i);
      if (dumpPackage != null && !dumpPackage.equals(br.callerPackage)) {
        continue;
      }
      if (!printed) {
        if (needSep) {
          pw.println();
        }
        needSep=true;
        printed=true;
        pw.println("String_Node_Str" + mQueueName + "String_Node_Str");
      }
      pw.println("String_Node_Str" + mQueueName + "String_Node_Str"+ i+ "String_Node_Str");
      mOrderedBroadcasts.get(i).dump(pw,"String_Node_Str",sdf);
    }
    if (dumpPackage == null || (mPendingBroadcast != null && dumpPackage.equals(mPendingBroadcast.callerPackage))) {
      if (needSep) {
        pw.println();
      }
      pw.println("String_Node_Str" + mQueueName + "String_Node_Str");
      if (mPendingBroadcast != null) {
        mPendingBroadcast.dump(pw,"String_Node_Str",sdf);
      }
 else {
        pw.println("String_Node_Str");
      }
      needSep=true;
    }
  }
  int i;
  boolean printed=false;
  i=-1;
  int lastIndex=mHistoryNext;
  int ringIndex=lastIndex;
  do {
    ringIndex=ringAdvance(ringIndex,-1,MAX_BROADCAST_HISTORY);
    BroadcastRecord r=mBroadcastHistory[ringIndex];
    if (r == null) {
      continue;
    }
    i++;
    if (dumpPackage != null && !dumpPackage.equals(r.callerPackage)) {
      continue;
    }
    if (!printed) {
      if (needSep) {
        pw.println();
      }
      needSep=true;
      pw.println("String_Node_Str" + mQueueName + "String_Node_Str");
      printed=true;
    }
    if (dumpAll) {
      pw.print("String_Node_Str" + mQueueName + "String_Node_Str");
      pw.print(i);
      pw.println("String_Node_Str");
      r.dump(pw,"String_Node_Str",sdf);
    }
 else {
      pw.print("String_Node_Str");
      pw.print(i);
      pw.print("String_Node_Str");
      pw.println(r);
      pw.print("String_Node_Str");
      pw.println(r.intent.toShortString(false,true,true,false));
      if (r.targetComp != null && r.targetComp != r.intent.getComponent()) {
        pw.print("String_Node_Str");
        pw.println(r.targetComp.toShortString());
      }
      Bundle bundle=r.intent.getExtras();
      if (bundle != null) {
        pw.print("String_Node_Str");
        pw.println(bundle.toString());
      }
    }
  }
 while (ringIndex != lastIndex);
  if (dumpPackage == null) {
    lastIndex=ringIndex=mSummaryHistoryNext;
    if (dumpAll) {
      printed=false;
      i=-1;
    }
 else {
      for (int j=i; j > 0 && ringIndex != lastIndex; ) {
        ringIndex=ringAdvance(ringIndex,-1,MAX_BROADCAST_SUMMARY_HISTORY);
        BroadcastRecord r=mBroadcastHistory[ringIndex];
        if (r == null) {
          continue;
        }
        j--;
      }
    }
    do {
      ringIndex=ringAdvance(ringIndex,-1,MAX_BROADCAST_SUMMARY_HISTORY);
      Intent intent=mBroadcastSummaryHistory[ringIndex];
      if (intent == null) {
        continue;
      }
      if (!printed) {
        if (needSep) {
          pw.println();
        }
        needSep=true;
        pw.println("String_Node_Str" + mQueueName + "String_Node_Str");
        printed=true;
      }
      if (!dumpAll && i >= 50) {
        pw.println("String_Node_Str");
        break;
      }
      i++;
      pw.print("String_Node_Str");
      pw.print(i);
      pw.print("String_Node_Str");
      pw.println(intent.toShortString(false,true,true,false));
      pw.print("String_Node_Str");
      TimeUtils.formatDuration(mSummaryHistoryDispatchTime[ringIndex] - mSummaryHistoryEnqueueTime[ringIndex],pw);
      pw.print("String_Node_Str");
      TimeUtils.formatDuration(mSummaryHistoryFinishTime[ringIndex] - mSummaryHistoryDispatchTime[ringIndex],pw);
      pw.println("String_Node_Str");
      pw.print("String_Node_Str");
      pw.print(sdf.format(new Date(mSummaryHistoryEnqueueTime[ringIndex])));
      pw.print("String_Node_Str");
      pw.print(sdf.format(new Date(mSummaryHistoryDispatchTime[ringIndex])));
      pw.print("String_Node_Str");
      pw.println(sdf.format(new Date(mSummaryHistoryFinishTime[ringIndex])));
      Bundle bundle=intent.getExtras();
      if (bundle != null) {
        pw.print("String_Node_Str");
        pw.println(bundle.toString());
      }
    }
 while (ringIndex != lastIndex);
  }
  return needSep;
}