Program: 109912
Project: 109912
Buggy source:
/** 
 * Returns an empty survey response.
 * @return SurveyResponse object.
 * @throws SurveyException
 */
public SurveyResponse getResponse() throws SurveyException {
  final Map<Question,List<SurveyDatum>> responseMap=this.responseMap;
  final List<IQuestionResponse> questionResponses=new ArrayList<>();
  for (  final Map.Entry<Question,List<SurveyDatum>> e : responseMap.entrySet()) {
    questionResponses.add(new IQuestionResponse(){
      List<Question> questions=new ArrayList<>(responseMap.keySet());
      @Override public Question getQuestion(){
        return e.getKey();
      }
      @Override public List<OptTuple> getOpts(){
        List<OptTuple> retval=new ArrayList<>();
        for (        SurveyDatum c : e.getValue()) {
          retval.add(new OptTuple(c,c.getIndex()));
        }
        return retval;
      }
      @Override public int getIndexSeen(){
        return questions.indexOf(e.getKey());
      }
      @Override public SurveyDatum getAnswer() throws SurveyException {
        if (this.getQuestion().exclusive)         return this.getOpts().get(0).c;
 else         throw new RuntimeException("String_Node_Str");
      }
      @Override public List<SurveyDatum> getAnswers() throws SurveyException {
        if (this.getQuestion().exclusive)         throw new RuntimeException("String_Node_Str");
        List<SurveyDatum> answers=new ArrayList<>();
        for (        OptTuple optTuple : this.getOpts())         answers.add(optTuple.c);
        return answers;
      }
      @Override public int compareTo(      Object o){
        if (o instanceof IQuestionResponse) {
          IQuestionResponse that=(IQuestionResponse)o;
          return this.getQuestion().compareTo(that.getQuestion());
        }
 else         throw new RuntimeException(String.format("String_Node_Str",this.getClass().getName(),o.getClass().getName()));
      }
    }
);
  }
  return new SurveyResponse(survey,questionResponses,SurveyResponse.gensym.next(),0.0,0.0,KnownValidityStatus.MAYBE);
}

Fixed version (ground truth):
/** 
 * Returns an empty survey response.
 * @return SurveyResponse object.
 * @throws SurveyException
 */
public SurveyResponse getResponse() throws SurveyException {
  final Map<Question,List<SurveyDatum>> responseMap=this.responseMap;
  final List<Question> questionList=this.questionList;
  final List<IQuestionResponse> questionResponses=new ArrayList<>();
  for (  final Map.Entry<Question,List<SurveyDatum>> e : responseMap.entrySet()) {
    questionResponses.add(new IQuestionResponse(){
      List<Question> questions=new ArrayList<>(responseMap.keySet());
      @Override public Question getQuestion(){
        return e.getKey();
      }
      @Override public List<OptTuple> getOpts(){
        List<OptTuple> retval=new ArrayList<>();
        for (        SurveyDatum c : e.getValue()) {
          retval.add(new OptTuple(c,c.getIndex()));
        }
        return retval;
      }
      @Override public int getIndexSeen(){
        return questionList.indexOf(e.getKey());
      }
      @Override public SurveyDatum getAnswer() throws SurveyException {
        if (this.getQuestion().exclusive)         return this.getOpts().get(0).c;
 else         throw new RuntimeException("String_Node_Str");
      }
      @Override public List<SurveyDatum> getAnswers() throws SurveyException {
        if (this.getQuestion().exclusive)         throw new RuntimeException("String_Node_Str");
        List<SurveyDatum> answers=new ArrayList<>();
        for (        OptTuple optTuple : this.getOpts())         answers.add(optTuple.c);
        return answers;
      }
      @Override public int compareTo(      Object o){
        if (o instanceof IQuestionResponse) {
          IQuestionResponse that=(IQuestionResponse)o;
          return this.getQuestion().compareTo(that.getQuestion());
        }
 else         throw new RuntimeException(String.format("String_Node_Str",this.getClass().getName(),o.getClass().getName()));
      }
    }
);
  }
  return new SurveyResponse(survey,questionResponses,SurveyResponse.gensym.next(),0.0,0.0,KnownValidityStatus.MAYBE);
}