Program: 13494
Project: 13494
Buggy source:
/** 
 * @param bos
 * @param member
 * @throws BosException 
 * @throws DitaApiException 
 */
protected void walkMapGetDependencies(BoundedObjectSet bos,DitaMapBosMemberImpl member) throws BosException, DitaApiException {
  NodeList topicrefs;
  try {
    topicrefs=(NodeList)DitaUtil.allTopicrefs.evaluate(member.getElement(),XPathConstants.NODESET);
  }
 catch (  XPathExpressionException e) {
    throw new BosException("String_Node_Str" + DitaUtil.allTopicrefs);
  }
  Set<BosMember> newMembers=new HashSet<BosMember>();
  for (int i=0; i < topicrefs.getLength(); i++) {
    Element topicref=(Element)topicrefs.item(i);
    Document targetDoc=null;
    URI targetUri=null;
    if (!DitaUtil.isLocalScope(topicref))     continue;
    String href=null;
    try {
      if (bosConstructionOptions.isMapTreeOnly()) {
        if (DitaUtil.targetIsADitaMap(topicref) && topicref.hasAttribute("String_Node_Str")) {
          href=topicref.getAttribute("String_Node_Str");
          if (!href.startsWith("String_Node_Str"))           targetDoc=AddressingUtil.resolveHrefToDoc(topicref,href,bosConstructionOptions,this.failOnAddressResolutionFailure);
        }
      }
 else       if (DitaUtil.targetIsADitaFormat(topicref)) {
        if (topicref.hasAttribute("String_Node_Str")) {
          targetDoc=resolveKeyrefToDoc(topicref.getAttribute("String_Node_Str"));
        }
        if (targetDoc == null && topicref.hasAttribute("String_Node_Str")) {
          href=topicref.getAttribute("String_Node_Str");
          if (!href.startsWith("String_Node_Str"))           targetDoc=AddressingUtil.resolveHrefToDoc(topicref,href,bosConstructionOptions,this.failOnAddressResolutionFailure);
        }
      }
 else {
        if (topicref.hasAttribute("String_Node_Str")) {
          targetUri=resolveKeyrefToUri(topicref.getAttribute("String_Node_Str"));
        }
        if (targetUri == null && topicref.hasAttribute("String_Node_Str")) {
          href=topicref.getAttribute("String_Node_Str");
          if (!href.startsWith("String_Node_Str"))           targetUri=AddressingUtil.resolveHrefToUri(topicref,href,this.failOnAddressResolutionFailure);
        }
      }
    }
 catch (    AddressingException e) {
      if (this.failOnAddressResolutionFailure) {
        throw new BosException("String_Node_Str" + topicref.getAttribute("String_Node_Str") + "String_Node_Str",e);
      }
    }
    BosMember childMember=null;
    if (targetDoc != null) {
      childMember=bos.constructBosMember(member,targetDoc);
    }
    if (targetUri != null) {
      childMember=bos.constructBosMember(member,targetUri);
    }
    if (childMember != null) {
      bos.addMember(member,childMember);
      newMembers.add((BosMember)childMember);
      if (href != null)       member.registerDependency(href,childMember,Constants.TOPTCREF_DEPENDENCY);
    }
  }
  for (  BosMember newMember : newMembers) {
    if (!walkedMembers.contains(newMember))     walkMemberGetDependencies(bos,newMember);
  }
}

Fixed version (ground truth):
/** 
 * @param bos
 * @param member
 * @throws BosException 
 * @throws DitaApiException 
 */
protected void walkMapGetDependencies(BoundedObjectSet bos,DitaMapBosMemberImpl member) throws BosException, DitaApiException {
  NodeList topicrefs;
  try {
    topicrefs=(NodeList)DitaUtil.allTopicrefs.evaluate(member.getElement(),XPathConstants.NODESET);
  }
 catch (  XPathExpressionException e) {
    throw new BosException("String_Node_Str" + DitaUtil.allTopicrefs);
  }
  Set<BosMember> newMembers=new HashSet<BosMember>();
  for (int i=0; i < topicrefs.getLength(); i++) {
    Element topicref=(Element)topicrefs.item(i);
    Document targetDoc=null;
    URI targetUri=null;
    if (!DitaUtil.isLocalScope(topicref))     continue;
    String href=null;
    try {
      if (bosConstructionOptions.isMapTreeOnly()) {
        if (DitaUtil.targetIsADitaMap(topicref) && topicref.hasAttribute("String_Node_Str")) {
          href=topicref.getAttribute("String_Node_Str");
          if (!href.startsWith("String_Node_Str"))           targetDoc=AddressingUtil.resolveHrefToDoc(topicref,href,bosConstructionOptions,this.failOnAddressResolutionFailure);
        }
      }
 else       if (DitaUtil.targetIsADitaFormat(topicref)) {
        if (topicref.hasAttribute("String_Node_Str")) {
          targetDoc=resolveKeyrefToDoc(topicref.getAttribute("String_Node_Str"));
        }
        if (targetDoc == null && topicref.hasAttribute("String_Node_Str")) {
          href=topicref.getAttribute("String_Node_Str");
          if (!href.startsWith("String_Node_Str"))           targetDoc=AddressingUtil.resolveHrefToDoc(topicref,href,bosConstructionOptions,this.failOnAddressResolutionFailure);
        }
      }
 else {
        if (topicref.hasAttribute("String_Node_Str")) {
          targetUri=resolveKeyrefToUri(topicref.getAttribute("String_Node_Str"));
        }
        if (targetUri == null && topicref.hasAttribute("String_Node_Str")) {
          href=topicref.getAttribute("String_Node_Str");
          if (!href.startsWith("String_Node_Str"))           targetUri=AddressingUtil.resolveHrefToUri(topicref,href,this.failOnAddressResolutionFailure);
        }
      }
    }
 catch (    AddressingException e) {
      if (this.failOnAddressResolutionFailure) {
        throw new BosException("String_Node_Str" + topicref.getAttribute("String_Node_Str") + "String_Node_Str",e);
      }
    }
    BosMember childMember=null;
    if (targetDoc != null) {
      childMember=bos.constructBosMember(member,targetDoc);
    }
    if (targetUri != null) {
      childMember=bos.constructBosMember(member,targetUri);
    }
    if (childMember != null) {
      bos.addMember(member,childMember);
      newMembers.add((BosMember)childMember);
      if (href != null)       member.registerDependency(href,childMember,Constants.TOPICREF_DEPENDENCY);
    }
  }
  for (  BosMember newMember : newMembers) {
    if (!walkedMembers.contains(newMember))     walkMemberGetDependencies(bos,newMember);
  }
}