Program: 16800
Project: 16800
Buggy source:
/** 
 * Generates a list of   {@code Parameter} objects from an {@code org.w3c.dom.Node} object containing a set of parameters. The nodemay be any element, but is expected to contain elements param or param_list, as in <pre> {@code <stanza name="foobar://aaa"> <param name="param1">value1</param> <param name="param2">value2</param> <param name="disabled">0</param> <param name="index">default</param> <param_list name="multiValue"> <value>value1</value> <value>value2</value> </param_list> </stanza>}</pre>
 * @param node An {@code org.w3c.dom.Node} object containing the parameter list as children.
 * @return A list of Parameter objects extracted from the XML.
 * @throws com.splunk.modularinput.MalformedDataException If the XML does not specify a valid parameter list.
 */
public static List<Parameter> nodeToParameterList(Node node) throws MalformedDataException {
  List<Parameter> parameters=new ArrayList<Parameter>();
  for (Node child=node.getFirstChild(); child != null; child=child.getNextSibling()) {
    if (child.getNodeType() == child.TEXT_NODE) {
      continue;
    }
    if (child.getNodeName() == "String_Node_Str") {
      String name=child.getAttributes().getNamedItem("String_Node_Str").getNodeValue();
      String value=XmlUtil.textInNode(child,"String_Node_Str" + name + "String_Node_Str");
      parameters.add(new SingleValueParameter(name,value));
    }
 else     if (child.getNodeName() == "String_Node_Str") {
      String name=child.getAttributes().getNamedItem("String_Node_Str").getNodeValue();
      MultiValueParameter parameter=new MultiValueParameter(name);
      for (Node valueNode=child.getFirstChild(); valueNode != null; valueNode=valueNode.getNextSibling()) {
        if (valueNode.getNodeType() == valueNode.TEXT_NODE)         continue;
        if (valueNode.getNodeName() != "String_Node_Str") {
          throw new MalformedDataException("String_Node_Str" + child.getNodeName() + "String_Node_Str"+ valueNode.getNodeName());
        }
 else {
          parameter.appendValue(XmlUtil.textInNode(valueNode,"String_Node_Str" + child.getNodeName() + "String_Node_Str"));
        }
      }
      parameters.add(parameter);
    }
 else {
      throw new MalformedDataException("String_Node_Str" + child.getNodeName());
    }
  }
  return parameters;
}

Fixed version (ground truth):
/** 
 * Generates a list of   {@code Parameter} objects from an {@code org.w3c.dom.Node} object containing a set of parameters. The nodemay be any element, but is expected to contain elements param or param_list, as in <pre> {@code <stanza name="foobar://aaa"> <param name="param1">value1</param> <param name="param2">value2</param> <param name="disabled">0</param> <param name="index">default</param> <param_list name="multiValue"> <value>value1</value> <value>value2</value> </param_list> </stanza>}</pre>
 * @param node An {@code org.w3c.dom.Node} object containing the parameter list as children.
 * @return A list of Parameter objects extracted from the XML.
 * @throws com.splunk.modularinput.MalformedDataException If the XML does not specify a valid parameter list.
 */
public static List<Parameter> nodeToParameterList(Node node) throws MalformedDataException {
  List<Parameter> parameters=new ArrayList<Parameter>();
  for (Node child=node.getFirstChild(); child != null; child=child.getNextSibling()) {
    if (child.getNodeType() == Node.TEXT_NODE) {
      continue;
    }
    if ("String_Node_Str".equals(child.getNodeName())) {
      String name=child.getAttributes().getNamedItem("String_Node_Str").getNodeValue();
      String value=XmlUtil.textInNode(child,"String_Node_Str" + name + "String_Node_Str");
      parameters.add(new SingleValueParameter(name,value));
    }
 else     if ("String_Node_Str".equals(child.getNodeName())) {
      String name=child.getAttributes().getNamedItem("String_Node_Str").getNodeValue();
      MultiValueParameter parameter=new MultiValueParameter(name);
      for (Node valueNode=child.getFirstChild(); valueNode != null; valueNode=valueNode.getNextSibling()) {
        if (valueNode.getNodeType() == Node.TEXT_NODE)         continue;
        if (!"String_Node_Str".equals(valueNode.getNodeName())) {
          throw new MalformedDataException("String_Node_Str" + child.getNodeName() + "String_Node_Str"+ valueNode.getNodeName());
        }
 else {
          parameter.appendValue(XmlUtil.textInNode(valueNode,"String_Node_Str" + child.getNodeName() + "String_Node_Str"));
        }
      }
      parameters.add(parameter);
    }
 else {
      throw new MalformedDataException("String_Node_Str" + child.getNodeName());
    }
  }
  return parameters;
}