Program: 154160
Project: 154160
Buggy source:
private void addChildren(OBOClass parentClass,Term parentTerm,TaxonStore target,String prefix){
  final Collection<Link> childLinks=parentClass.getChildren();
  for (  Link l : childLinks) {
    OBOProperty lType=l.getType();
    if (OBOUtils.ISA_PROPERTY.equals(lType.getID())) {
      OBOClass childClass=(OBOClass)l.getChild();
      Term childTerm=null;
      String[] idFields=childClass.getID().split("String_Node_Str");
      if (idFields.length == 2) {
        if (idFields[0].equals(prefix)) {
          childTerm=target.addTermbyID(childClass.getID(),childClass.getName());
          if (childClass.getDbxrefs() != null) {
            for (            Dbxref d : childClass.getDbxrefs()) {
              target.addXRefToTerm(childTerm,d.getDatabase(),d.getDatabaseID());
            }
          }
          if (childClass.getSynonyms() != null) {
            for (            Synonym s : childClass.getSynonyms()) {
              SynonymI newSyn=null;
              if (s.getXrefs() != null && !s.getXrefs().isEmpty()) {
                Iterator<Dbxref> xIter=s.getXrefs().iterator();
                if (xIter.hasNext()) {
                  Dbxref d=xIter.next();
                  newSyn=target.makeSynonymWithXref(s.getText(),d.getDatabase(),d.getDatabaseID());
                }
              }
 else {
                newSyn=target.makeSynonym(s.getText());
              }
              if (newSyn != null)               childTerm.addSynonym(newSyn);
            }
          }
        }
 else {
          childTerm=target.addTerm(childClass.getName());
          target.addXRefToTerm(childTerm,idFields[0],idFields[1]);
        }
      }
 else {
        logger.warn("String_Node_Str" + childClass.getID() + "String_Node_Str");
      }
      if (u.getRankString(childClass) != null)       target.setRankFromName(childTerm,u.getRankString(childClass));
      for (      Synonym syn : childClass.getSynonyms()) {
        String synText=syn.getText();
        Collection<Dbxref> xrefs=syn.getXrefs();
        if (xrefs != null && !xrefs.isEmpty()) {
          for (          Dbxref xref : xrefs) {
            SynonymI newSyn=target.makeSynonymWithXref(synText,xref.getDatabase(),xref.getDatabaseID());
            childTerm.addSynonym(newSyn);
          }
        }
 else {
          SynonymI newSyn=target.makeSynonym(synText);
          childTerm.addSynonym(newSyn);
        }
      }
      target.attachParent(childTerm,parentTerm);
      addChildren(childClass,childTerm,target,prefix);
    }
  }
}

Fixed version (ground truth):
private void addChildren(OBOClass parentClass,Term parentTerm,TaxonStore target,String prefix){
  final Collection<Link> childLinks=parentClass.getChildren();
  for (  Link l : childLinks) {
    OBOProperty lType=l.getType();
    if (OBOUtils.ISA_PROPERTY.equals(lType.getID())) {
      OBOClass childClass=(OBOClass)l.getChild();
      Term childTerm=copyTerm(childClass,prefix);
      if (u.getRankString(childClass) != null)       target.setRankFromName(childTerm,u.getRankString(childClass));
      for (      Synonym syn : childClass.getSynonyms()) {
        String synText=syn.getText();
        Collection<Dbxref> xrefs=syn.getXrefs();
        if (xrefs != null && !xrefs.isEmpty()) {
          for (          Dbxref xref : xrefs) {
            SynonymI newSyn=target.makeSynonymWithXref(synText,xref.getDatabase(),xref.getDatabaseID());
            childTerm.addSynonym(newSyn);
          }
        }
 else {
          SynonymI newSyn=target.makeSynonym(synText);
          childTerm.addSynonym(newSyn);
        }
      }
      target.attachParent(childTerm,parentTerm);
      addChildren(childClass,childTerm,target,prefix);
    }
  }
}