Program: 145246
Project: 145246
Buggy source:
protected static QuestionDef parseControl(IFormElement parent,Element e,FormDef f,int controlType){
  QuestionDef question=new QuestionDef();
  question.setID(serialQuestionID++);
  IDataReference dataRef=null;
  boolean refFromBind=false;
  String ref=e.getAttributeValue(null,"String_Node_Str");
  String bind=e.getAttributeValue(null,"String_Node_Str");
  if (bind != null) {
    DataBinding binding=(DataBinding)bindingsByID.get(bind);
    if (binding == null) {
      throw new XFormParseException("String_Node_Str" + bind + "String_Node_Str");
    }
    dataRef=binding.getReference();
    refFromBind=true;
  }
 else   if (ref != null) {
    dataRef=new XPathReference(ref);
  }
 else {
    if (controlType == Constants.CONTROL_TRIGGER) {
    }
 else {
      throw new XFormParseException("String_Node_Str");
    }
  }
  if (dataRef != null) {
    if (!refFromBind) {
      dataRef=getAbsRef(dataRef,parent);
    }
    question.setBind(dataRef);
    if (controlType == Constants.CONTROL_SELECT_ONE) {
      selectOnes.addElement((TreeReference)dataRef.getReference());
    }
 else     if (controlType == Constants.CONTROL_SELECT_MULTI) {
      selectMultis.addElement((TreeReference)dataRef.getReference());
    }
  }
  question.setControlType(controlType);
  question.setAppearanceAttr(e.getAttributeValue(null,"String_Node_Str"));
  for (int i=0; i < e.getChildCount(); i++) {
    int type=e.getType(i);
    Element child=(type == Node.ELEMENT ? e.getElement(i) : null);
    String childName=(child != null ? child.getName() : null);
    if ("String_Node_Str".equals(childName)) {
      parseQuestionLabel(f,question,child);
    }
 else     if ("String_Node_Str".equals(childName)) {
      parseHint(f,question,child);
    }
 else     if ((controlType == Constants.CONTROL_SELECT_MULTI || controlType == Constants.CONTROL_SELECT_ONE) && "String_Node_Str".equals(childName)) {
      parseItem(f,question,child);
    }
  }
  parent.addChild(question);
  return question;
}

Fixed version (ground truth):
protected static QuestionDef parseControl(IFormElement parent,Element e,FormDef f,int controlType){
  QuestionDef question=new QuestionDef();
  question.setID(serialQuestionID++);
  IDataReference dataRef=null;
  boolean refFromBind=false;
  String ref=e.getAttributeValue(null,"String_Node_Str");
  String bind=e.getAttributeValue(null,"String_Node_Str");
  if (bind != null) {
    DataBinding binding=(DataBinding)bindingsByID.get(bind);
    if (binding == null) {
      throw new XFormParseException("String_Node_Str" + bind + "String_Node_Str");
    }
    dataRef=binding.getReference();
    refFromBind=true;
  }
 else   if (ref != null) {
    dataRef=new XPathReference(ref);
  }
 else {
    if (controlType == Constants.CONTROL_TRIGGER) {
    }
 else {
      throw new XFormParseException("String_Node_Str");
    }
  }
  if (dataRef != null) {
    if (!refFromBind) {
      dataRef=getAbsRef(dataRef,parent);
    }
    question.setBind(dataRef);
    if (controlType == Constants.CONTROL_SELECT_ONE) {
      selectOnes.addElement((TreeReference)dataRef.getReference());
    }
 else     if (controlType == Constants.CONTROL_SELECT_MULTI) {
      selectMultis.addElement((TreeReference)dataRef.getReference());
    }
  }
  boolean isSelect=(controlType == Constants.CONTROL_SELECT_MULTI || controlType == Constants.CONTROL_SELECT_ONE);
  question.setControlType(controlType);
  question.setAppearanceAttr(e.getAttributeValue(null,"String_Node_Str"));
  for (int i=0; i < e.getChildCount(); i++) {
    int type=e.getType(i);
    Element child=(type == Node.ELEMENT ? e.getElement(i) : null);
    String childName=(child != null ? child.getName() : null);
    if ("String_Node_Str".equals(childName)) {
      parseQuestionLabel(f,question,child);
    }
 else     if ("String_Node_Str".equals(childName)) {
      parseHint(f,question,child);
    }
 else     if (isSelect && "String_Node_Str".equals(childName)) {
      parseItem(f,question,child);
    }
  }
  if (isSelect)   question.localizeSelectMap(null);
  parent.addChild(question);
  return question;
}