Program: 100647
Project: 100647
Buggy source:
private void processTopicref(final Element topicref){
  final String xtrfValue=getValue(topicref,ATTRIBUTE_NAME_XTRF);
  if (xtrfValue != null && xtrfValue.contains(ATTR_XTRF_VALUE_GENERATED)) {
    return;
  }
  final Collection<String> chunkValue=split(getValue(topicref,ATTRIBUTE_NAME_CHUNK));
  if (topicref.getAttributeNode(ATTRIBUTE_NAME_HREF) == null && chunkValue.contains(CHUNK_TO_CONTENT)) {
    generateStumpTopic(topicref);
  }
  final URI hrefValue=toURI(getValue(topicref,ATTRIBUTE_NAME_HREF));
  final URI copytoValue=toURI(getValue(topicref,ATTRIBUTE_NAME_COPY_TO));
  final String scopeValue=getCascadeValue(topicref,ATTRIBUTE_NAME_SCOPE);
  final String chunkByToken=getChunkByToken(chunkValue,"String_Node_Str",defaultChunkByToken);
  if (ATTR_SCOPE_VALUE_EXTERNAL.equals(scopeValue) || (hrefValue != null && !new File(inputFile.resolve(hrefValue.toString())).exists()) || (chunkValue.isEmpty() && hrefValue == null)) {
    processChildTopicref(topicref);
  }
 else   if (chunkValue.contains(CHUNK_TO_CONTENT) && (hrefValue != null || copytoValue != null || topicref.hasChildNodes())) {
    if (chunkValue.contains(CHUNK_BY_TOPIC)) {
      logger.warn(MessageUtils.getInstance().getMessage("String_Node_Str").setLocation(topicref).toString());
    }
    processChunk(topicref,false);
  }
 else   if (chunkValue.contains(CHUNK_TO_NAVIGATION) && supportToNavigation) {
    processChildTopicref(topicref);
    processNavitation(topicref);
  }
 else   if (chunkByToken.equals(CHUNK_BY_TOPIC)) {
    processChunk(topicref,true);
    processChildTopicref(topicref);
  }
 else {
    String currentPath=null;
    if (copytoValue != null) {
      currentPath=inputFile.resolve(copytoValue).getPath();
    }
 else     if (hrefValue != null) {
      currentPath=inputFile.resolve(hrefValue).getPath();
    }
    if (currentPath != null) {
      if (changeTable.containsKey(currentPath)) {
        changeTable.remove(currentPath);
      }
      final String processingRole=getCascadeValue(topicref,ATTRIBUTE_NAME_PROCESSING_ROLE);
      if (!ATTR_PROCESSING_ROLE_VALUE_RESOURCE_ONLY.equals(processingRole)) {
        changeTable.put(toURI(currentPath),toURI(currentPath));
      }
    }
    processChildTopicref(topicref);
  }
}

Fixed version (ground truth):
private void processTopicref(final Element topicref){
  final String xtrfValue=getValue(topicref,ATTRIBUTE_NAME_XTRF);
  if (xtrfValue != null && xtrfValue.contains(ATTR_XTRF_VALUE_GENERATED)) {
    return;
  }
  final Collection<String> chunkValue=split(getValue(topicref,ATTRIBUTE_NAME_CHUNK));
  if (topicref.getAttributeNode(ATTRIBUTE_NAME_HREF) == null && chunkValue.contains(CHUNK_TO_CONTENT)) {
    generateStumpTopic(topicref);
  }
  final URI hrefValue=toURI(getValue(topicref,ATTRIBUTE_NAME_HREF));
  final URI copytoValue=toURI(getValue(topicref,ATTRIBUTE_NAME_COPY_TO));
  final String scopeValue=getCascadeValue(topicref,ATTRIBUTE_NAME_SCOPE);
  final String chunkByToken=getChunkByToken(chunkValue,"String_Node_Str",defaultChunkByToken);
  if (ATTR_SCOPE_VALUE_EXTERNAL.equals(scopeValue) || (hrefValue != null && !new File(inputFile.resolve(hrefValue.toString())).exists()) || (chunkValue.isEmpty() && hrefValue == null)) {
    processChildTopicref(topicref);
  }
 else   if (chunkValue.contains(CHUNK_TO_CONTENT) && (hrefValue != null || copytoValue != null || topicref.hasChildNodes())) {
    if (chunkValue.contains(CHUNK_BY_TOPIC)) {
      logger.warn(MessageUtils.getInstance().getMessage("String_Node_Str").setLocation(topicref).toString());
    }
    processChunk(topicref,false);
  }
 else   if (chunkValue.contains(CHUNK_TO_NAVIGATION) && supportToNavigation) {
    processChildTopicref(topicref);
    processNavitation(topicref);
  }
 else   if (chunkByToken.equals(CHUNK_BY_TOPIC)) {
    processChunk(topicref,true);
    processChildTopicref(topicref);
  }
 else {
    URI currentPath=null;
    if (copytoValue != null) {
      currentPath=inputFile.resolve(copytoValue);
    }
 else     if (hrefValue != null) {
      currentPath=inputFile.resolve(hrefValue);
    }
    if (currentPath != null) {
      if (changeTable.containsKey(currentPath)) {
        changeTable.remove(currentPath);
      }
      final String processingRole=getCascadeValue(topicref,ATTRIBUTE_NAME_PROCESSING_ROLE);
      if (!ATTR_PROCESSING_ROLE_VALUE_RESOURCE_ONLY.equals(processingRole)) {
        changeTable.put(currentPath,currentPath);
      }
    }
    processChildTopicref(topicref);
  }
}