Program: 68731
Project: 68731
Buggy source:
/** 
 * INTERNAL: Given a DatabaseField, return the corresponding values from the document
 */
public Object getValuesIndicatingNoEntry(DatabaseField key,boolean shouldReturnNodes){
  XMLField field=convertToXMLField(key);
  NodeList nodeList=UnmarshalXPathEngine.getInstance().selectNodes(dom,field,field.getNamespaceResolver());
  if (null == nodeList) {
    return null;
  }
  int resultSize=nodeList.getLength();
  Vector result=new Vector(resultSize);
  if (resultSize == 0) {
    return result;
  }
  if (shouldReturnNodes) {
    for (int i=0; i < resultSize; i++) {
      result.add(nodeList.item(i));
    }
    return result;
  }
  Node firstNode=nodeList.item(0);
  if ((firstNode == null) || (firstNode.getNodeType() != Node.ELEMENT_NODE)) {
    if ((field).usesSingleNode() && (resultSize == 1)) {
      Node next=nodeList.item(0);
      if (next == null) {
        result.add(null);
      }
 else {
        Vector list=new Vector();
        String sourceObject=next.getNodeValue();
        StringTokenizer tokenizer=new StringTokenizer(sourceObject,"String_Node_Str");
        while (tokenizer.hasMoreElements()) {
          String token=tokenizer.nextToken();
          Object nextItem=convertValue((Element)next.getParentNode(),field,token);
          list.add(nextItem);
        }
        return list;
      }
    }
    for (int x=0; x < resultSize; x++) {
      Node next=nodeList.item(x);
      if (next == null) {
        result.add(null);
      }
 else {
        result.add(getValueFromElement((Element)next.getParentNode(),next,field));
      }
    }
  }
 else {
    for (int x=0; x < resultSize; x++) {
      result.add(buildNestedRow((Element)nodeList.item(x)));
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * INTERNAL: Given a DatabaseField, return the corresponding values from the document
 */
public Object getValuesIndicatingNoEntry(DatabaseField key,boolean shouldReturnNodes){
  XMLField field=convertToXMLField(key);
  NodeList nodeList=UnmarshalXPathEngine.getInstance().selectNodes(dom,field,field.getNamespaceResolver());
  if (null == nodeList) {
    return null;
  }
  int resultSize=nodeList.getLength();
  Vector result=new Vector(resultSize);
  if (resultSize == 0) {
    return result;
  }
  if (shouldReturnNodes) {
    for (int i=0; i < resultSize; i++) {
      result.add(nodeList.item(i));
    }
    return result;
  }
  Node firstNode=nodeList.item(0);
  if ((firstNode == null) || (firstNode.getNodeType() != Node.ELEMENT_NODE)) {
    if (field.usesSingleNode() && (resultSize == 1)) {
      Node next=nodeList.item(0);
      if (next == null) {
        result.add(null);
      }
 else {
        Vector list=new Vector();
        String sourceObject=next.getNodeValue();
        StringTokenizer tokenizer=new StringTokenizer(sourceObject,"String_Node_Str");
        while (tokenizer.hasMoreElements()) {
          String token=tokenizer.nextToken();
          Object nextItem=convertValue((Element)next.getParentNode(),field,token);
          list.add(nextItem);
        }
        return list;
      }
    }
    for (int x=0; x < resultSize; x++) {
      Node next=nodeList.item(x);
      if (next == null) {
        result.add(null);
      }
 else {
        result.add(getValueFromElement((Element)next.getParentNode(),next,field));
      }
    }
  }
 else {
    for (int x=0; x < resultSize; x++) {
      result.add(buildNestedRow((Element)nodeList.item(x)));
    }
  }
  return result;
}