Program: 101438
Project: 101438
Buggy source:
/** 
 * Create a stack trace of the code at this point
 * @param ex The Throwable containing the Stack Trace
 * @param discard The number of uppermost stack frames to ignore
 */
private void init(Throwable ex,int discard){
  StringWriter sout=new StringWriter();
  ex.printStackTrace(new PrintWriter(sout));
  String msg=new String(sout.getBuffer());
  String[] calls=StringUtil.split(msg,"String_Node_Str");
  int total=0;
  for (int i=0; i < calls.length - discard; i++) {
    String call=calls[i + discard];
    if (!(call.startsWith("String_Node_Str") || call.indexOf("String_Node_Str") >= 0)) {
      total++;
    }
  }
  classNames=new String[total];
  methodNames=new String[total];
  fileNames=new String[total];
  lineNumbers=new int[total];
  int j=0;
  for (int i=0; i < calls.length - discard; i++) {
    String call=calls[i + discard];
    try {
      if (!(call.startsWith("String_Node_Str") || call.indexOf("String_Node_Str") >= 0)) {
        int spcIndex=call.indexOf(' ');
        int lhsIndex=call.indexOf('(');
        int clnIndex=call.indexOf(':');
        int rhsIndex=call.indexOf(')');
        String fullFn=call.substring(spcIndex + 1,lhsIndex).trim();
        int lastDot=fullFn.lastIndexOf('.');
        classNames[j]=fullFn.substring(0,lastDot).replace('/','.');
        methodNames[j]=fullFn.substring(lastDot + 1);
        if (clnIndex != -1 && lhsIndex < clnIndex) {
          fileNames[j]=call.substring(lhsIndex + 1,clnIndex);
          lineNumbers[j]=Integer.parseInt(call.substring(clnIndex + 1,rhsIndex));
        }
 else {
          fileNames[j]=call.substring(lhsIndex + 1,rhsIndex);
          lineNumbers[j]=0;
        }
        j++;
      }
    }
 catch (    NumberFormatException ex2) {
      classNames[j]="String_Node_Str";
      methodNames[j]=call;
      fileNames[j]="String_Node_Str";
      lineNumbers[j]=0;
      j++;
    }
  }
}

Fixed version (ground truth):
/** 
 * Create a stack trace of the code at this point
 * @param ex The Throwable containing the Stack Trace
 * @param discard The number of uppermost stack frames to ignore
 */
private void init(Throwable ex,int discard){
  StringWriter sout=new StringWriter();
  ex.printStackTrace(new PrintWriter(sout));
  String msg=new String(sout.getBuffer());
  String[] calls=StringUtil.split(msg,"String_Node_Str");
  int total=0;
  for (int i=0; i < calls.length - discard; i++) {
    String call=calls[i + discard];
    if (!(call.startsWith("String_Node_Str") || call.indexOf("String_Node_Str") >= 0)) {
      total++;
    }
  }
  classNames=new String[total];
  methodNames=new String[total];
  fileNames=new String[total];
  lineNumbers=new int[total];
  int j=0;
  for (int i=0; i < calls.length - discard; i++) {
    String call=calls[i + discard];
    boolean oops=false;
    try {
      if (!(call.startsWith("String_Node_Str") || call.indexOf("String_Node_Str") >= 0)) {
        int spcIndex=call.indexOf(' ');
        int lhsIndex=call.indexOf('(');
        int clnIndex=call.indexOf(':');
        int rhsIndex=call.indexOf(')');
        String fullFn=call.substring(spcIndex + 1,lhsIndex).trim();
        int lastDot=fullFn.lastIndexOf('.');
        classNames[j]=fullFn.substring(0,lastDot).replace('/','.');
        methodNames[j]=fullFn.substring(lastDot + 1);
        if (clnIndex != -1 && lhsIndex < clnIndex) {
          fileNames[j]=call.substring(lhsIndex + 1,clnIndex);
          lineNumbers[j]=Integer.parseInt(call.substring(clnIndex + 1,rhsIndex));
        }
 else {
          fileNames[j]=call.substring(lhsIndex + 1,rhsIndex);
          lineNumbers[j]=0;
        }
        j++;
      }
    }
 catch (    NumberFormatException ex2) {
      oops=true;
    }
catch (    StringIndexOutOfBoundsException ex2) {
      oops=true;
    }
    if (oops) {
      classNames[j]="String_Node_Str";
      methodNames[j]=call;
      fileNames[j]="String_Node_Str";
      lineNumbers[j]=0;
      j++;
    }
  }
}