Program: 109933
Project: 109933
Buggy source:
public Survey parse() throws MalformedURLException, SurveyException {
  Map<String,ArrayList<CSVEntry>> lexemes=csvLexer.entries;
  Survey survey=new Survey();
  survey.encoding=csvLexer.encoding;
  survey.source=csvLexer.filename;
  survey.sourceName=new File(csvLexer.filename).getName().split("String_Node_Str")[0];
  for (  String key : lexemes.keySet())   CSVEntry.sort(lexemes.get(key));
  ArrayList<Question> questions=unifyQuestions();
  survey.questions=questions;
  if (lexemes.containsKey(Survey.BLOCK)) {
    ArrayList<Block> blocks=initializeBlocks();
    unifyBlocks(lexemes.get(Survey.BLOCK),blocks,lexemes.get(Survey.QUESTION),questions);
    survey.blocks=blocks;
  }
 else   survey.blocks=new ArrayList<Block>();
  unifyBranching(survey);
  for (  Question q : questions) {
    Block b=q.block;
    int[] bid=b.getBlockId();
    for (int i=0; i < bid.length; i++) {
      int[] ancestor=new int[i + 1];
      for (int j=0; j <= i; j++)       ancestor[i]=j;
      String ancestorId=Block.idToString(ancestor);
      assert(this.allBlockLookUp.containsKey(ancestorId));
    }
  }
  Collections.sort(survey.blocks);
  survey.resetQuestionIndices();
  Collections.sort(survey.questions);
  for (  String id : this.allBlockLookUp.keySet())   System.out.println(id);
  for (  Question q : survey.questions) {
    System.out.println(q.toString() + q.block.strId);
    Block currentBlock=q.block;
    int[] parentBlockId=q.block.parentBlockID;
    while (parentBlockId != null) {
      System.out.println("String_Node_Str" + Block.idToString(parentBlockId));
      currentBlock=this.allBlockLookUp.get(Block.idToString(parentBlockId));
      System.out.println("String_Node_Str" + Block.idToString(currentBlock.getBlockId()));
      parentBlockId=currentBlock.parentBlockID;
    }
  }
  survey.correlationMap=this.correlationMap;
  return survey;
}

Fixed version (ground truth):
public Survey parse() throws MalformedURLException, SurveyException {
  Map<String,ArrayList<CSVEntry>> lexemes=csvLexer.entries;
  Survey survey=new Survey();
  survey.encoding=csvLexer.encoding;
  survey.source=csvLexer.filename;
  survey.sourceName=new File(csvLexer.filename).getName().split("String_Node_Str")[0];
  for (  String key : lexemes.keySet())   CSVEntry.sort(lexemes.get(key));
  ArrayList<Question> questions=unifyQuestions();
  survey.questions=questions;
  if (lexemes.containsKey(Survey.BLOCK)) {
    ArrayList<Block> blocks=initializeBlocks();
    unifyBlocks(lexemes.get(Survey.BLOCK),blocks,lexemes.get(Survey.QUESTION),questions);
    survey.blocks=blocks;
  }
 else   survey.blocks=new ArrayList<Block>();
  unifyBranching(survey);
  for (  Question q : questions) {
    Block b=q.block;
    int[] bid=b.getBlockId();
    for (int i=0; i < bid.length; i++) {
      int[] ancestor=new int[i + 1];
      for (int j=0; j <= i; j++)       ancestor[i]=j;
      String ancestorId=Block.idToString(ancestor);
      assert(this.allBlockLookUp.containsKey(ancestorId));
    }
  }
  Collections.sort(survey.blocks);
  survey.resetQuestionIndices();
  Collections.sort(survey.questions);
  for (  Question q : survey.questions) {
    System.out.println(q.toString() + q.block.strId);
    Block currentBlock=q.block;
    int[] parentBlockId=q.block.parentBlockID;
    while (parentBlockId != null) {
      assert(this.allBlockLookUp.get(Block.idToString(parentBlockId)).subBlocks.contains(currentBlock));
      System.out.println("String_Node_Str" + Block.idToString(parentBlockId));
      currentBlock=this.allBlockLookUp.get(Block.idToString(parentBlockId));
      System.out.println("String_Node_Str" + Block.idToString(currentBlock.getBlockId()));
      parentBlockId=currentBlock.parentBlockID;
    }
  }
  survey.correlationMap=this.correlationMap;
  return survey;
}