Program: 109948
Project: 109948
Buggy source:
private ArrayList<Question> unifyQuestions() throws MalformedURLException, SurveyException {
  Question tempQ=null;
  ArrayList<Question> qlist=new ArrayList<Question>();
  ArrayList<CSVEntry> questions=lexemes.get(Survey.QUESTION);
  ArrayList<CSVEntry> options=lexemes.get(Survey.OPTIONS);
  ArrayList<CSVEntry> resources=(lexemes.containsKey(Survey.RESOURCE)) ? lexemes.get(Survey.RESOURCE) : null;
  ArrayList<CSVEntry> correlates=(lexemes.containsKey(Survey.CORRELATION)) ? lexemes.get(Survey.CORRELATION) : null;
  int index=0;
  for (int i=0; i < questions.size(); i++) {
    CSVEntry question=questions.get(i);
    CSVEntry option=options.get(i);
    LOGGER.log(Level.INFO,tempQ + "String_Node_Str" + question.contents+ "String_Node_Str"+ option.contents);
    if (newQuestion(question,option,tempQ,i)) {
      tempQ=new Question(question.lineNo,question.colNo);
      tempQ.data.add(parseComponent(question));
      tempQ.options=new HashMap<String,Component>();
      tempQ.index=index;
      qlist.add(tempQ);
      index++;
    }
    if (resources != null && resources.get(i).contents != null) {
      CSVEntry resource=resources.get(i);
      String potentialURL=resource.contents.trim();
      if (!potentialURL.equals("String_Node_Str"))       tempQ.data.add(new URLComponent(potentialURL,resource.lineNo,resource.colNo));
    }
    if (correlates != null && correlates.get(i).contents != null) {
      CSVEntry correlation=correlates.get(i);
      if (correlationMap.containsKey(correlation.contents)) {
        List<Question> qs=correlationMap.get(correlation.contents);
        qs.add(tempQ);
      }
 else       correlationMap.put(correlation.contents,Arrays.asList(new Question[]{tempQ}));
    }
    tempQ.sourceLineNos.add(option.lineNo);
    tempQ.exclusive=assignBool(tempQ.exclusive,Survey.EXCLUSIVE,i,this);
    tempQ.ordered=assignBool(tempQ.ordered,Survey.ORDERED,i,this);
    tempQ.randomize=assignBool(tempQ.randomize,Survey.RANDOMIZE,i,this);
    tempQ.freetext=assignBool(tempQ.freetext,Survey.FREETEXT,i,this);
    if (tempQ.freetext)     tempQ.options.put(Survey.FREETEXT,new StringComponent("String_Node_Str",option.lineNo,option.colNo));
    if (tempQ.otherValues.isEmpty())     for (    String col : headers) {
      boolean known=false;
      for (int j=0; j < Survey.knownHeaders.length; j++)       if (Survey.knownHeaders[j].equals(col)) {
        known=true;
        break;
      }
      if (!known) {
        String val=lexemes.get(col).get(i).contents;
        LOGGER.log(Level.DEBUG,"String_Node_Str" + val);
        tempQ.otherValues.put(col,val);
      }
    }
    LOGGER.log(Level.DEBUG,"String_Node_Str" + tempQ.otherValues.size());
  }
  return qlist;
}

Fixed version (ground truth):
private ArrayList<Question> unifyQuestions() throws MalformedURLException, SurveyException {
  Question tempQ=null;
  ArrayList<Question> qlist=new ArrayList<Question>();
  ArrayList<CSVEntry> questions=lexemes.get(Survey.QUESTION);
  ArrayList<CSVEntry> options=lexemes.get(Survey.OPTIONS);
  ArrayList<CSVEntry> resources=(lexemes.containsKey(Survey.RESOURCE)) ? lexemes.get(Survey.RESOURCE) : null;
  ArrayList<CSVEntry> correlates=(lexemes.containsKey(Survey.CORRELATION)) ? lexemes.get(Survey.CORRELATION) : null;
  int index=0;
  for (int i=0; i < questions.size(); i++) {
    CSVEntry question=questions.get(i);
    CSVEntry option=options.get(i);
    LOGGER.log(Level.INFO,tempQ + "String_Node_Str" + question.contents+ "String_Node_Str"+ option.contents);
    if (newQuestion(question,option,tempQ,i)) {
      tempQ=new Question(question.lineNo,question.colNo);
      tempQ.data.add(parseComponent(question));
      tempQ.options=new HashMap<String,Component>();
      tempQ.index=index;
      qlist.add(tempQ);
      index++;
    }
    if (resources != null && resources.get(i).contents != null) {
      CSVEntry resource=resources.get(i);
      String potentialURL=resource.contents.trim();
      if (!potentialURL.equals("String_Node_Str"))       tempQ.data.add(new URLComponent(potentialURL,resource.lineNo,resource.colNo));
    }
    if (correlates != null && correlates.get(i).contents != null) {
      CSVEntry correlation=correlates.get(i);
      if (correlationMap.containsKey(correlation.contents)) {
        List<Question> qs=correlationMap.get(correlation.contents);
        qs.add(tempQ);
      }
 else       correlationMap.put(correlation.contents,Arrays.asList(new Question[]{tempQ}));
    }
    tempQ.options.put(Component.makeComponentId(option.lineNo,option.colNo),parseComponent(option));
    tempQ.sourceLineNos.add(option.lineNo);
    tempQ.exclusive=assignBool(tempQ.exclusive,Survey.EXCLUSIVE,i,this);
    tempQ.ordered=assignBool(tempQ.ordered,Survey.ORDERED,i,this);
    tempQ.randomize=assignBool(tempQ.randomize,Survey.RANDOMIZE,i,this);
    tempQ.freetext=assignBool(tempQ.freetext,Survey.FREETEXT,i,this);
    if (tempQ.freetext)     tempQ.options.put(Survey.FREETEXT,new StringComponent("String_Node_Str",option.lineNo,option.colNo));
    if (tempQ.otherValues.isEmpty())     for (    String col : headers) {
      boolean known=false;
      for (int j=0; j < Survey.knownHeaders.length; j++)       if (Survey.knownHeaders[j].equals(col)) {
        known=true;
        break;
      }
      if (!known) {
        String val=lexemes.get(col).get(i).contents;
        LOGGER.log(Level.DEBUG,"String_Node_Str" + val);
        tempQ.otherValues.put(col,val);
      }
    }
    LOGGER.log(Level.DEBUG,"String_Node_Str" + tempQ.otherValues.size());
  }
  return qlist;
}