Program: 131638
Project: 131638
Buggy source:
public void loadFromInputStream(InputStream inputStream) throws IOException {
  BufferedReader reader=new BufferedReader(new InputStreamReader(inputStream));
  String line;
  GrReaderState state=GrReaderState.RootSymbol;
  Pattern spaceRegex=Pattern.compile("String_Node_Str");
  while ((line=reader.readLine()) != null) {
    line=line.trim();
    if (line.startsWith("String_Node_Str") || line.equals("String_Node_Str")) {
      continue;
    }
    if (line.equals("String_Node_Str")) {
      state=GrReaderState.LexicalRules;
      continue;
    }
    if (state == GrReaderState.RootSymbol) {
      rootSymbol=ntAlphabet.lookupIndex(line);
      state=GrReaderState.NonTerminalRules;
      continue;
    }
    String[] splits=spaceRegex.split(line);
    Rule r;
    if (splits.length == 4) {
      String parent=splits[0];
      String child=splits[2];
      double logProb=Double.parseDouble(splits[3]);
      if (state == GrReaderState.LexicalRules) {
        r=getLexicalRule(parent,child,logProb);
        lexRules.add(r);
      }
 else {
        r=getUnaryRule(parent,child,logProb);
        unaryRules.add(r);
      }
    }
 else     if (splits.length == 5 && state == GrReaderState.NonTerminalRules) {
      String parent=splits[0];
      String leftChild=splits[2];
      String rightChild=splits[3];
      double logProb=Double.parseDouble(splits[4]);
      r=getBinaryRule(parent,leftChild,rightChild,logProb);
      binaryRules.add(r);
    }
 else {
      throw new RuntimeException("String_Node_Str" + line);
    }
    allRules.add(r);
  }
  lexAlphabet.stopGrowth();
  ntAlphabet.stopGrowth();
}

Fixed version (ground truth):
public void loadFromInputStream(InputStream inputStream) throws IOException {
  BufferedReader reader=new BufferedReader(new InputStreamReader(inputStream));
  String line;
  GrReaderState state=GrReaderState.RootSymbol;
  Pattern spaceRegex=Pattern.compile("String_Node_Str");
  while ((line=reader.readLine()) != null) {
    line=line.trim();
    if (line.startsWith("String_Node_Str") || line.equals("String_Node_Str")) {
      continue;
    }
    if (line.startsWith("String_Node_Str")) {
      state=GrReaderState.LexicalRules;
      continue;
    }
    if (state == GrReaderState.RootSymbol) {
      if (line.contains("String_Node_Str")) {
        rootSymbol=ntAlphabet.lookupIndex("String_Node_Str");
      }
 else {
        rootSymbol=ntAlphabet.lookupIndex(line);
      }
      state=GrReaderState.NonTerminalRules;
      continue;
    }
    String[] splits=spaceRegex.split(line);
    Rule r;
    if (splits.length == 4) {
      String parent=splits[0];
      String child=splits[2];
      double logProb=Double.parseDouble(splits[3]);
      if (state == GrReaderState.LexicalRules) {
        r=getLexicalRule(parent,child,logProb);
        lexRules.add(r);
      }
 else {
        r=getUnaryRule(parent,child,logProb);
        unaryRules.add(r);
      }
    }
 else     if (splits.length == 5 && state == GrReaderState.NonTerminalRules) {
      String parent=splits[0];
      String leftChild=splits[2];
      String rightChild=splits[3];
      double logProb=Double.parseDouble(splits[4]);
      r=getBinaryRule(parent,leftChild,rightChild,logProb);
      binaryRules.add(r);
    }
 else {
      throw new RuntimeException("String_Node_Str" + line);
    }
    allRules.add(r);
  }
  lexAlphabet.stopGrowth();
  ntAlphabet.stopGrowth();
}