Program: 100649
Project: 100649
Buggy source:
private String updateHref(final Attributes atts){
  String hrefValue=atts.getValue(ATTRIBUTE_NAME_HREF);
  if (hrefValue == null) {
    return null;
  }
  if (fixpath != null && hrefValue.startsWith(fixpath)) {
    hrefValue=hrefValue.substring(fixpath.length());
  }
  if (changeTable == null || changeTable.isEmpty()) {
    return hrefValue;
  }
  if (isLocalDita(atts)) {
    final URI rootPathName=currentFile;
    String changeTargetkey=resolve(currentFileDir,hrefValue).getPath();
    URI changeTarget=changeTable.get(changeTargetkey);
    final String topicID=getTopicID(toURI(hrefValue));
    if (topicID != null) {
      changeTargetkey=setFragment(changeTargetkey,topicID);
      final URI changeTarget_with_elemt=changeTable.get(changeTargetkey);
      if (changeTarget_with_elemt != null) {
        changeTarget=changeTarget_with_elemt;
      }
    }
    final String elementID=getElementID(hrefValue);
    final String pathtoElem=getFragment(hrefValue,"String_Node_Str");
    if (changeTarget == null || changeTarget.toString().isEmpty()) {
      URI absolutePath=toURI(resolveTopic(currentFileDir,hrefValue));
      absolutePath=setElementID(absolutePath,null);
      changeTarget=changeTable.get(absolutePath);
    }
    if (changeTarget == null) {
      return hrefValue;
    }
 else {
      final URI conTarget=conflictTable.get(stripFragment(changeTarget));
      if (conTarget != null && !conTarget.toString().isEmpty()) {
        final URI p=getRelativePath(rootPathName,conTarget);
        if (elementID == null) {
          return setFragment(p,getElementID(changeTarget.toString())).toString();
        }
 else {
          if (conTarget.getFragment() != null) {
            if (!pathtoElem.contains(SLASH)) {
              return p.toString();
            }
 else {
              return setElementID(p,elementID).toString();
            }
          }
 else {
            return setFragment(p,pathtoElem).toString();
          }
        }
      }
 else {
        final URI p=getRelativePath(rootPathName,changeTarget);
        if (elementID == null) {
          return p.toString();
        }
 else {
          if (changeTarget.getFragment() != null) {
            if (!pathtoElem.contains(SLASH)) {
              return p.toString();
            }
 else {
              return setElementID(p,elementID).toString();
            }
          }
 else {
            return setFragment(p,pathtoElem).toString();
          }
        }
      }
    }
  }
  return hrefValue;
}

Fixed version (ground truth):
private String updateHref(final Attributes atts){
  String hrefValue=atts.getValue(ATTRIBUTE_NAME_HREF);
  if (hrefValue == null) {
    return null;
  }
  if (fixpath != null && hrefValue.startsWith(fixpath)) {
    hrefValue=hrefValue.substring(fixpath.length());
  }
  if (changeTable == null || changeTable.isEmpty()) {
    return hrefValue;
  }
  if (isLocalDita(atts)) {
    final URI rootPathName=currentFile;
    URI changeTargetkey=currentFileDir.toURI().resolve(hrefValue);
    URI changeTarget=changeTable.get(changeTargetkey);
    final String topicID=getTopicID(toURI(hrefValue));
    if (topicID != null) {
      changeTargetkey=setFragment(changeTargetkey,topicID);
      final URI changeTarget_with_elemt=changeTable.get(changeTargetkey);
      if (changeTarget_with_elemt != null) {
        changeTarget=changeTarget_with_elemt;
      }
    }
    final String elementID=getElementID(hrefValue);
    final String pathtoElem=getFragment(hrefValue,"String_Node_Str");
    if (changeTarget == null || changeTarget.toString().isEmpty()) {
      URI absolutePath=toURI(resolveTopic(currentFileDir,hrefValue));
      absolutePath=setElementID(absolutePath,null);
      changeTarget=changeTable.get(absolutePath);
    }
    if (changeTarget == null) {
      return hrefValue;
    }
 else {
      final URI conTarget=conflictTable.get(stripFragment(changeTarget));
      if (conTarget != null && !conTarget.toString().isEmpty()) {
        final URI p=getRelativePath(rootPathName,conTarget);
        if (elementID == null) {
          return setFragment(p,getElementID(changeTarget.toString())).toString();
        }
 else {
          if (conTarget.getFragment() != null) {
            if (!pathtoElem.contains(SLASH)) {
              return p.toString();
            }
 else {
              return setElementID(p,elementID).toString();
            }
          }
 else {
            return setFragment(p,pathtoElem).toString();
          }
        }
      }
 else {
        final URI p=getRelativePath(rootPathName,changeTarget);
        if (elementID == null) {
          return p.toString();
        }
 else {
          if (changeTarget.getFragment() != null) {
            if (!pathtoElem.contains(SLASH)) {
              return p.toString();
            }
 else {
              return setElementID(p,elementID).toString();
            }
          }
 else {
            return setFragment(p,pathtoElem).toString();
          }
        }
      }
    }
  }
  return hrefValue;
}