Program: 100759
Project: 100759
Buggy source:
private void outputIndexEntry(final IndexTerm term,final XMLStreamWriter serializer) throws XMLStreamException {
  final List<IndexTermTarget> targets=term.getTargetList();
  final int targetNum=targets.size();
  boolean foundIndexTerm=false;
  boolean foundIndexsee=false;
  String indexSeeRefTerm=null;
  final int termCloneNum=termCloneList.size();
  if (targets != null && !targets.isEmpty()) {
    for (int i=0; i < targetNum; i++) {
      final IndexTermTarget target=targets.get(i);
      final String targetUri=target.getTargetURI();
      final String targetName=target.getTargetName();
      if (targetUri == null) {
        serializer.writeStartElement("String_Node_Str");
        serializer.writeAttribute("String_Node_Str",target.getTargetName());
        serializer.writeEndElement();
      }
 else       if (targetName != null && targetName.trim().length() > 0) {
        if (term.getTermPrefix() != null || inIndexsee) {
          indexSeeRefTerm=term.getTermName();
          inIndexsee=true;
          foundIndexsee=true;
          for (int j=0; j < termCloneNum; j++) {
            final IndexTerm termClone=termCloneList.get(j);
            if (term.getTermName().equals(termClone.getTermName())) {
              foundIndexTerm=true;
              if (termClone.getTargetList().size() > 0) {
                serializer.writeStartElement("String_Node_Str");
                serializer.writeAttribute("String_Node_Str",replaceExtName(termClone.getTargetList().get(0).getTargetURI()));
                if (targetName.trim().length() > 0) {
                  serializer.writeAttribute("String_Node_Str",termClone.getTargetList().get(0).getTargetName());
                }
                serializer.writeEndElement();
              }
              termCloneList=termClone.getSubTerms();
              break;
            }
          }
          if (term.getSubTerms().size() == 0) {
            inIndexsee=false;
          }
        }
 else {
          serializer.writeStartElement("String_Node_Str");
          serializer.writeAttribute("String_Node_Str",replaceExtName(targetUri));
          if (targetName.trim().length() > 0) {
            serializer.writeAttribute("String_Node_Str",target.getTargetName());
          }
          serializer.writeEndElement();
        }
      }
    }
    if (!foundIndexTerm && foundIndexsee && indexSeeRefTerm != null && !indexSeeRefTerm.equals("String_Node_Str")) {
      logger.warn(MessageUtils.getInstance().getMessage("String_Node_Str",indexSeeRefTerm.trim()).toString());
    }
  }
}

Fixed version (ground truth):
private void outputIndexEntry(final IndexTerm term,final XMLStreamWriter serializer) throws XMLStreamException {
  final List<IndexTermTarget> targets=term.getTargetList();
  final int targetNum=targets.size();
  boolean foundIndexTerm=false;
  boolean foundIndexsee=false;
  String indexSeeRefTerm=null;
  final int termCloneNum=termCloneList.size();
  if (targets != null && !targets.isEmpty()) {
    for (    final IndexTermTarget target : targets) {
      final String targetUri=target.getTargetURI();
      final String targetName=target.getTargetName();
      if (targetUri == null) {
        serializer.writeStartElement("String_Node_Str");
        serializer.writeAttribute("String_Node_Str",target.getTargetName());
        serializer.writeEndElement();
      }
 else       if (targetName != null && targetName.trim().length() > 0) {
        if (term.getTermPrefix() != null || inIndexsee) {
          indexSeeRefTerm=term.getTermName();
          inIndexsee=true;
          foundIndexsee=true;
          for (int j=0; j < termCloneNum; j++) {
            final IndexTerm termClone=termCloneList.get(j);
            if (term.getTermName().equals(termClone.getTermName())) {
              foundIndexTerm=true;
              if (termClone.getTargetList().size() > 0) {
                serializer.writeStartElement("String_Node_Str");
                serializer.writeAttribute("String_Node_Str",replaceExtName(termClone.getTargetList().get(0).getTargetURI()));
                if (targetName.trim().length() > 0) {
                  serializer.writeAttribute("String_Node_Str",termClone.getTargetList().get(0).getTargetName());
                }
                serializer.writeEndElement();
              }
              termCloneList=termClone.getSubTerms();
              break;
            }
          }
          if (term.getSubTerms().size() == 0) {
            inIndexsee=false;
          }
        }
 else {
          serializer.writeStartElement("String_Node_Str");
          serializer.writeAttribute("String_Node_Str",replaceExtName(targetUri));
          if (targetName.trim().length() > 0) {
            serializer.writeAttribute("String_Node_Str",target.getTargetName());
          }
          serializer.writeEndElement();
        }
      }
    }
    if (!foundIndexTerm && foundIndexsee && indexSeeRefTerm != null && !indexSeeRefTerm.equals("String_Node_Str")) {
      logger.warn(MessageUtils.getInstance().getMessage("String_Node_Str",indexSeeRefTerm.trim()).toString());
    }
  }
}