Program: 190665
Project: 190665
Buggy source:
/** 
 * Determines the target node of the "bindings" element by using the inherited target node, then put the result into the "result" map and the "scd" map.
 * @param inheritedTarget The current target node. This always exists, even if the user starts specifying targets via SCD (in that case this inherited target is just not going to be used.)
 * @param inheritedSCD If the ancestor &lt;bindings> node specifies @scd to specify the target via SCD, then this parameter represents that context.
 */
private void buildTargetNodeMap(Element bindings,@NotNull Node inheritedTarget,@Nullable SCDBasedBindingSet.Target inheritedSCD,Map<Element,Node> result,SCDBasedBindingSet scdResult){
  Node target=inheritedTarget;
  validate(bindings);
  if (bindings.getAttributeNode("String_Node_Str") != null) {
    String schemaLocation=bindings.getAttribute("String_Node_Str");
    try {
      schemaLocation=new URL(new URL(forest.getSystemId(bindings.getOwnerDocument())),schemaLocation).toExternalForm();
    }
 catch (    MalformedURLException e) {
    }
    target=forest.get(schemaLocation).getDocumentElement();
    if (target == null) {
      reportError(bindings,Messages.format(Messages.ERR_INCORRECT_SCHEMA_REFERENCE,schemaLocation,EditDistance.findNearest(schemaLocation,forest.listSystemIDs())));
      return;
    }
  }
  if (bindings.getAttributeNode("String_Node_Str") != null) {
    String nodeXPath=bindings.getAttribute("String_Node_Str");
    NodeList nlst;
    try {
      xpath.setNamespaceContext(new NamespaceContextImpl(bindings));
      nlst=(NodeList)xpath.evaluate(nodeXPath,target,XPathConstants.NODESET);
    }
 catch (    XPathExpressionException e) {
      reportError(bindings,Messages.format(Messages.ERR_XPATH_EVAL,e.getMessage()),e);
      return;
    }
    if (nlst.getLength() == 0) {
      reportError(bindings,Messages.format(Messages.NO_XPATH_EVAL_TO_NO_TARGET,nodeXPath));
      return;
    }
    if (nlst.getLength() != 1) {
      reportError(bindings,Messages.format(Messages.NO_XPATH_EVAL_TOO_MANY_TARGETS,nodeXPath,nlst.getLength()));
      return;
    }
    Node rnode=nlst.item(0);
    if (!(rnode instanceof Element)) {
      reportError(bindings,Messages.format(Messages.NO_XPATH_EVAL_TO_NON_ELEMENT,nodeXPath));
      return;
    }
    if (!forest.logic.checkIfValidTargetNode(forest,bindings,(Element)rnode)) {
      reportError(bindings,Messages.format(Messages.XPATH_EVAL_TO_NON_SCHEMA_ELEMENT,nodeXPath,rnode.getNodeName()));
      return;
    }
    target=rnode;
  }
  if (bindings.getAttributeNode("String_Node_Str") != null) {
    String scdPath=bindings.getAttribute("String_Node_Str");
    if (!enableSCD) {
      reportError(bindings,Messages.format(Messages.SCD_NOT_ENABLED));
      enableSCD=true;
    }
    try {
      inheritedSCD=scdResult.createNewTarget(inheritedSCD,bindings,SCD.create(scdPath,new NamespaceContextImpl(bindings)));
    }
 catch (    ParseException e) {
      reportError(bindings,Messages.format(Messages.ERR_SCD_EVAL,e.getMessage()),e);
      return;
    }
  }
  if (inheritedSCD != null)   inheritedSCD.addBinidng(bindings);
 else   result.put(bindings,target);
  Element[] children=DOMUtils.getChildElements(bindings,Const.JAXB_NSURI,"String_Node_Str");
  for (  Element value : children)   buildTargetNodeMap(value,target,inheritedSCD,result,scdResult);
}

Fixed version (ground truth):
/** 
 * Determines the target node of the "bindings" element by using the inherited target node, then put the result into the "result" map and the "scd" map.
 * @param inheritedTarget The current target node. This always exists, even if the user starts specifying targets via SCD (in that case this inherited target is just not going to be used.)
 * @param inheritedSCD If the ancestor &lt;bindings> node specifies @scd to specify the target via SCD, then this parameter represents that context.
 */
private void buildTargetNodeMap(Element bindings,@NotNull Node inheritedTarget,@Nullable SCDBasedBindingSet.Target inheritedSCD,Map<Element,Node> result,SCDBasedBindingSet scdResult){
  Node target=inheritedTarget;
  validate(bindings);
  if (bindings.getAttributeNode("String_Node_Str") != null) {
    String schemaLocation=bindings.getAttribute("String_Node_Str");
    try {
      schemaLocation=new URL(new URL(forest.getSystemId(bindings.getOwnerDocument())),schemaLocation).toExternalForm();
    }
 catch (    MalformedURLException e) {
    }
    target=forest.get(schemaLocation);
    if (target == null) {
      reportError(bindings,Messages.format(Messages.ERR_INCORRECT_SCHEMA_REFERENCE,schemaLocation,EditDistance.findNearest(schemaLocation,forest.listSystemIDs())));
      return;
    }
    target=((Document)target).getDocumentElement();
  }
  if (bindings.getAttributeNode("String_Node_Str") != null) {
    String nodeXPath=bindings.getAttribute("String_Node_Str");
    NodeList nlst;
    try {
      xpath.setNamespaceContext(new NamespaceContextImpl(bindings));
      nlst=(NodeList)xpath.evaluate(nodeXPath,target,XPathConstants.NODESET);
    }
 catch (    XPathExpressionException e) {
      reportError(bindings,Messages.format(Messages.ERR_XPATH_EVAL,e.getMessage()),e);
      return;
    }
    if (nlst.getLength() == 0) {
      reportError(bindings,Messages.format(Messages.NO_XPATH_EVAL_TO_NO_TARGET,nodeXPath));
      return;
    }
    if (nlst.getLength() != 1) {
      reportError(bindings,Messages.format(Messages.NO_XPATH_EVAL_TOO_MANY_TARGETS,nodeXPath,nlst.getLength()));
      return;
    }
    Node rnode=nlst.item(0);
    if (!(rnode instanceof Element)) {
      reportError(bindings,Messages.format(Messages.NO_XPATH_EVAL_TO_NON_ELEMENT,nodeXPath));
      return;
    }
    if (!forest.logic.checkIfValidTargetNode(forest,bindings,(Element)rnode)) {
      reportError(bindings,Messages.format(Messages.XPATH_EVAL_TO_NON_SCHEMA_ELEMENT,nodeXPath,rnode.getNodeName()));
      return;
    }
    target=rnode;
  }
  if (bindings.getAttributeNode("String_Node_Str") != null) {
    String scdPath=bindings.getAttribute("String_Node_Str");
    if (!enableSCD) {
      reportError(bindings,Messages.format(Messages.SCD_NOT_ENABLED));
      enableSCD=true;
    }
    try {
      inheritedSCD=scdResult.createNewTarget(inheritedSCD,bindings,SCD.create(scdPath,new NamespaceContextImpl(bindings)));
    }
 catch (    ParseException e) {
      reportError(bindings,Messages.format(Messages.ERR_SCD_EVAL,e.getMessage()),e);
      return;
    }
  }
  if (inheritedSCD != null)   inheritedSCD.addBinidng(bindings);
 else   result.put(bindings,target);
  Element[] children=DOMUtils.getChildElements(bindings,Const.JAXB_NSURI,"String_Node_Str");
  for (  Element value : children)   buildTargetNodeMap(value,target,inheritedSCD,result,scdResult);
}