Program: 63440
Project: 63440
Buggy source:
private void load(InputStream inputStream) throws ConfigError {
  DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
  Document document;
  try {
    DocumentBuilder builder=factory.newDocumentBuilder();
    document=builder.parse(inputStream);
  }
 catch (  Throwable e) {
    throw new ConfigError("String_Node_Str",e);
  }
  Element documentElement=document.getDocumentElement();
  if (!documentElement.getNodeName().equals("String_Node_Str")) {
    throw new ConfigError("String_Node_Str");
  }
  if (!documentElement.hasAttribute("String_Node_Str")) {
    throw new ConfigError("String_Node_Str");
  }
  if (!documentElement.hasAttribute("String_Node_Str")) {
    throw new ConfigError("String_Node_Str");
  }
  setVersion("String_Node_Str" + documentElement.getAttribute("String_Node_Str") + "String_Node_Str"+ documentElement.getAttribute("String_Node_Str"));
  NodeList componentsNode=documentElement.getElementsByTagName("String_Node_Str");
  if (componentsNode.getLength() > 0) {
    NodeList componentNodes=componentsNode.item(0).getChildNodes();
    for (int i=0; i < componentNodes.getLength(); i++) {
      Node componentNode=componentNodes.item(i);
      if (componentNode.getNodeName().equals("String_Node_Str")) {
        String name=getAttribute(componentNode,"String_Node_Str");
        if (name == null) {
          throw new ConfigError("String_Node_Str");
        }
        components.put(name,componentNode);
      }
    }
  }
  NodeList fieldsNode=documentElement.getElementsByTagName("String_Node_Str");
  if (fieldsNode.getLength() == 0) {
    throw new ConfigError("String_Node_Str");
  }
  NodeList fieldNodes=fieldsNode.item(0).getChildNodes();
  if (fieldNodes.getLength() == 0) {
    throw new ConfigError("String_Node_Str");
  }
  for (int i=0; i < fieldNodes.getLength(); i++) {
    Node fieldNode=fieldNodes.item(i);
    if (fieldNode.getNodeName().equals("String_Node_Str")) {
      String name=getAttribute(fieldNode,"String_Node_Str");
      if (name == null) {
        throw new ConfigError("String_Node_Str");
      }
      String number=getAttribute(fieldNode,"String_Node_Str");
      if (number == null) {
        throw new ConfigError("String_Node_Str" + name + "String_Node_Str");
      }
      int num=Integer.parseInt(number);
      String type=getAttribute(fieldNode,"String_Node_Str");
      if (type == null) {
        throw new ConfigError("String_Node_Str" + name + "String_Node_Str");
      }
      addField(num);
      addFieldType(num,FieldType.fromName(getVersion(),type));
      addFieldName(num,name);
      NodeList valueNodes=fieldNode.getChildNodes();
      for (int j=0; j < valueNodes.getLength(); j++) {
        Node valueNode=valueNodes.item(j);
        if (valueNode.getNodeName().equals("String_Node_Str")) {
          String enumeration=getAttribute(valueNode,"String_Node_Str");
          if (enumeration == null) {
            throw new ConfigError("String_Node_Str" + name);
          }
          addFieldValue(num,enumeration);
          String description=getAttribute(valueNode,"String_Node_Str");
          if (description != null) {
            addValueName(num,enumeration,description);
          }
        }
      }
    }
  }
  NodeList headerNode=documentElement.getElementsByTagName("String_Node_Str");
  if (headerNode.getLength() == 0) {
    throw new ConfigError("String_Node_Str");
  }
  NodeList headerFieldNodes=headerNode.item(0).getChildNodes();
  if (headerFieldNodes.getLength() == 0) {
    throw new ConfigError("String_Node_Str");
  }
  for (int i=0; i < headerFieldNodes.getLength(); i++) {
    Node headerFieldNode=headerFieldNodes.item(i);
    String nodeName=headerFieldNode.getNodeName();
    if (nodeName.equals("String_Node_Str") || nodeName.equals("String_Node_Str")) {
      String name=getAttribute(headerFieldNode,"String_Node_Str");
      if (name == null) {
        throw new ConfigError("String_Node_Str" + nodeName + "String_Node_Str");
      }
      String required="String_Node_Str";
      addHeaderField(lookupXMLFieldNumber(document,name),required.equals("String_Node_Str"));
    }
  }
  NodeList trailerNode=documentElement.getElementsByTagName("String_Node_Str");
  if (trailerNode.getLength() == 0) {
    throw new ConfigError("String_Node_Str");
  }
  NodeList trailerFieldNodes=trailerNode.item(0).getChildNodes();
  for (int i=0; i < trailerFieldNodes.getLength(); i++) {
    Node trailerFieldNode=trailerFieldNodes.item(i);
    String nodeName=trailerFieldNode.getNodeName();
    if (nodeName.equals("String_Node_Str") || nodeName.equals("String_Node_Str")) {
      String name=getAttribute(trailerFieldNode,"String_Node_Str");
      if (name == null) {
        throw new ConfigError("String_Node_Str" + nodeName + "String_Node_Str");
      }
      String required="String_Node_Str";
      addTrailerField(lookupXMLFieldNumber(document,name),required.equals("String_Node_Str"));
    }
  }
  NodeList messagesNode=documentElement.getElementsByTagName("String_Node_Str");
  if (messagesNode.getLength() == 0) {
    throw new ConfigError("String_Node_Str");
  }
  NodeList messageNodes=messagesNode.item(0).getChildNodes();
  if (messageNodes.getLength() == 0) {
    throw new ConfigError("String_Node_Str");
  }
  for (int i=0; i < messageNodes.getLength(); i++) {
    Node messageNode=messageNodes.item(i);
    if (messageNode.getNodeName().equals("String_Node_Str")) {
      String msgtype=getAttribute(messageNode,"String_Node_Str");
      if (msgtype == null) {
        throw new ConfigError("String_Node_Str");
      }
      addMsgType(msgtype);
      String name=getAttribute(messageNode,"String_Node_Str");
      if (name != null) {
        addValueName(MsgType.FIELD,msgtype,name);
      }
      NodeList messageFieldNodes=messageNode.getChildNodes();
      if (messageFieldNodes.getLength() == 0) {
        throw new ConfigError("String_Node_Str");
      }
      for (int j=0; j < messageFieldNodes.getLength(); j++) {
        Node messageFieldNode=messageFieldNodes.item(j);
        if (messageFieldNode.getNodeName().equals("String_Node_Str") || messageFieldNode.getNodeName().equals("String_Node_Str")) {
          name=getAttribute(messageFieldNode,"String_Node_Str");
          if (name == null) {
            throw new ConfigError("String_Node_Str");
          }
          int num=lookupXMLFieldNumber(document,name);
          addMsgField(msgtype,num);
          String required=getAttribute(messageFieldNode,"String_Node_Str",NO);
          if (required == null) {
            throw new ConfigError("String_Node_Str" + messageFieldNode.getNodeName() + "String_Node_Str");
          }
          if (required.equalsIgnoreCase("String_Node_Str")) {
            addRequiredField(msgtype,num);
          }
        }
 else         if (messageFieldNode.getNodeName().equals("String_Node_Str")) {
          String required=getAttribute(messageFieldNode,"String_Node_Str");
          if (required == null) {
            throw new ConfigError("String_Node_Str");
          }
          addXMLComponentFields(document,messageFieldNode,msgtype,this,required.equalsIgnoreCase("String_Node_Str"));
        }
        if (messageFieldNode.getNodeName().equals("String_Node_Str")) {
          String required=getAttribute(messageFieldNode,"String_Node_Str");
          if (required == null) {
            throw new ConfigError("String_Node_Str");
          }
          addXMLGroup(document,messageFieldNode,msgtype,this,required.equalsIgnoreCase("String_Node_Str"));
        }
      }
    }
  }
}

Fixed version (ground truth):
private void load(InputStream inputStream) throws ConfigError {
  DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
  Document document;
  try {
    DocumentBuilder builder=factory.newDocumentBuilder();
    document=builder.parse(inputStream);
  }
 catch (  Throwable e) {
    throw new ConfigError("String_Node_Str",e);
  }
  Element documentElement=document.getDocumentElement();
  if (!documentElement.getNodeName().equals("String_Node_Str")) {
    throw new ConfigError("String_Node_Str");
  }
  if (!documentElement.hasAttribute("String_Node_Str")) {
    throw new ConfigError("String_Node_Str");
  }
  if (!documentElement.hasAttribute("String_Node_Str")) {
    throw new ConfigError("String_Node_Str");
  }
  setVersion("String_Node_Str" + documentElement.getAttribute("String_Node_Str") + "String_Node_Str"+ documentElement.getAttribute("String_Node_Str"));
  NodeList componentsNode=documentElement.getElementsByTagName("String_Node_Str");
  if (componentsNode.getLength() > 0) {
    NodeList componentNodes=componentsNode.item(0).getChildNodes();
    for (int i=0; i < componentNodes.getLength(); i++) {
      Node componentNode=componentNodes.item(i);
      if (componentNode.getNodeName().equals("String_Node_Str")) {
        String name=getAttribute(componentNode,"String_Node_Str");
        if (name == null) {
          throw new ConfigError("String_Node_Str");
        }
        components.put(name,componentNode);
      }
    }
  }
  NodeList fieldsNode=documentElement.getElementsByTagName("String_Node_Str");
  if (fieldsNode.getLength() == 0) {
    throw new ConfigError("String_Node_Str");
  }
  NodeList fieldNodes=fieldsNode.item(0).getChildNodes();
  if (fieldNodes.getLength() == 0) {
    throw new ConfigError("String_Node_Str");
  }
  for (int i=0; i < fieldNodes.getLength(); i++) {
    Node fieldNode=fieldNodes.item(i);
    if (fieldNode.getNodeName().equals("String_Node_Str")) {
      String name=getAttribute(fieldNode,"String_Node_Str");
      if (name == null) {
        throw new ConfigError("String_Node_Str");
      }
      String number=getAttribute(fieldNode,"String_Node_Str");
      if (number == null) {
        throw new ConfigError("String_Node_Str" + name + "String_Node_Str");
      }
      int num=Integer.parseInt(number);
      String type=getAttribute(fieldNode,"String_Node_Str");
      if (type == null) {
        throw new ConfigError("String_Node_Str" + name + "String_Node_Str");
      }
      addField(num);
      addFieldType(num,FieldType.fromName(getVersion(),type));
      addFieldName(num,name);
      NodeList valueNodes=fieldNode.getChildNodes();
      for (int j=0; j < valueNodes.getLength(); j++) {
        Node valueNode=valueNodes.item(j);
        if (valueNode.getNodeName().equals("String_Node_Str")) {
          String enumeration=getAttribute(valueNode,"String_Node_Str");
          if (enumeration == null) {
            throw new ConfigError("String_Node_Str" + name);
          }
          addFieldValue(num,enumeration);
          String description=getAttribute(valueNode,"String_Node_Str");
          if (description != null) {
            addValueName(num,enumeration,description);
          }
        }
      }
    }
  }
  NodeList headerNode=documentElement.getElementsByTagName("String_Node_Str");
  if (headerNode.getLength() == 0) {
    throw new ConfigError("String_Node_Str");
  }
  NodeList headerFieldNodes=headerNode.item(0).getChildNodes();
  if (headerFieldNodes.getLength() == 0) {
    throw new ConfigError("String_Node_Str");
  }
  for (int i=0; i < headerFieldNodes.getLength(); i++) {
    Node headerFieldNode=headerFieldNodes.item(i);
    String nodeName=headerFieldNode.getNodeName();
    if (nodeName.equals("String_Node_Str") || nodeName.equals("String_Node_Str")) {
      String name=getAttribute(headerFieldNode,"String_Node_Str");
      if (name == null) {
        throw new ConfigError("String_Node_Str" + nodeName + "String_Node_Str");
      }
      String required=getAttribute(headerFieldNode,"String_Node_Str",NO);
      if (required == null) {
        throw new ConfigError("String_Node_Str" + headerFieldNode.getNodeName() + "String_Node_Str");
      }
      addHeaderField(lookupXMLFieldNumber(document,name),required.equalsIgnoreCase("String_Node_Str"));
    }
  }
  NodeList trailerNode=documentElement.getElementsByTagName("String_Node_Str");
  if (trailerNode.getLength() == 0) {
    throw new ConfigError("String_Node_Str");
  }
  NodeList trailerFieldNodes=trailerNode.item(0).getChildNodes();
  for (int i=0; i < trailerFieldNodes.getLength(); i++) {
    Node trailerFieldNode=trailerFieldNodes.item(i);
    String nodeName=trailerFieldNode.getNodeName();
    if (nodeName.equals("String_Node_Str") || nodeName.equals("String_Node_Str")) {
      String name=getAttribute(trailerFieldNode,"String_Node_Str");
      if (name == null) {
        throw new ConfigError("String_Node_Str" + nodeName + "String_Node_Str");
      }
      String required=getAttribute(trailerFieldNode,"String_Node_Str",NO);
      if (required == null) {
        throw new ConfigError("String_Node_Str" + trailerFieldNode.getNodeName() + "String_Node_Str");
      }
      addTrailerField(lookupXMLFieldNumber(document,name),required.equalsIgnoreCase("String_Node_Str"));
    }
  }
  NodeList messagesNode=documentElement.getElementsByTagName("String_Node_Str");
  if (messagesNode.getLength() == 0) {
    throw new ConfigError("String_Node_Str");
  }
  NodeList messageNodes=messagesNode.item(0).getChildNodes();
  if (messageNodes.getLength() == 0) {
    throw new ConfigError("String_Node_Str");
  }
  for (int i=0; i < messageNodes.getLength(); i++) {
    Node messageNode=messageNodes.item(i);
    if (messageNode.getNodeName().equals("String_Node_Str")) {
      String msgtype=getAttribute(messageNode,"String_Node_Str");
      if (msgtype == null) {
        throw new ConfigError("String_Node_Str");
      }
      addMsgType(msgtype);
      String name=getAttribute(messageNode,"String_Node_Str");
      if (name != null) {
        addValueName(MsgType.FIELD,msgtype,name);
      }
      NodeList messageFieldNodes=messageNode.getChildNodes();
      if (messageFieldNodes.getLength() == 0) {
        throw new ConfigError("String_Node_Str");
      }
      for (int j=0; j < messageFieldNodes.getLength(); j++) {
        Node messageFieldNode=messageFieldNodes.item(j);
        if (messageFieldNode.getNodeName().equals("String_Node_Str") || messageFieldNode.getNodeName().equals("String_Node_Str")) {
          name=getAttribute(messageFieldNode,"String_Node_Str");
          if (name == null) {
            throw new ConfigError("String_Node_Str");
          }
          int num=lookupXMLFieldNumber(document,name);
          addMsgField(msgtype,num);
          String required=getAttribute(messageFieldNode,"String_Node_Str",NO);
          if (required == null) {
            throw new ConfigError("String_Node_Str" + messageFieldNode.getNodeName() + "String_Node_Str");
          }
          if (required.equalsIgnoreCase("String_Node_Str")) {
            addRequiredField(msgtype,num);
          }
        }
 else         if (messageFieldNode.getNodeName().equals("String_Node_Str")) {
          String required=getAttribute(messageFieldNode,"String_Node_Str");
          if (required == null) {
            throw new ConfigError("String_Node_Str");
          }
          addXMLComponentFields(document,messageFieldNode,msgtype,this,required.equalsIgnoreCase("String_Node_Str"));
        }
        if (messageFieldNode.getNodeName().equals("String_Node_Str")) {
          String required=getAttribute(messageFieldNode,"String_Node_Str");
          if (required == null) {
            throw new ConfigError("String_Node_Str");
          }
          addXMLGroup(document,messageFieldNode,msgtype,this,required.equalsIgnoreCase("String_Node_Str"));
        }
      }
    }
  }
}