Program: 154161
Project: 154161
Buggy source:
/** 
 * @param attachment name of parent node for attached clade
 * @param cladeRoot name of root node (child of parent) for attached clade
 * @param prefix default prefix for target ontology
 */
@Override public void attach(String attachment,String cladeRoot,String prefix){
  logger.info("String_Node_Str" + source);
  u=new OBOUtils(source.getAbsolutePath());
  logger.info("String_Node_Str");
  Term parentTerm=null;
  OBOClass cladeClass=u.lookupTermByName(cladeRoot);
  parentTerm=target.getTermbyName(attachment);
  if (parentTerm == null) {
    if (!target.isEmpty()) {
      logger.error("String_Node_Str" + source.getAbsolutePath() + "String_Node_Str"+ attachment+ "String_Node_Str"+ target);
      return;
    }
 else {
      OBOClass attachmentClass=u.lookupTermByName(attachment);
      if (attachmentClass != null) {
        parentTerm=target.addTermbyID(attachmentClass.getID(),attachment);
      }
 else {
        parentTerm=target.addTerm(attachment);
      }
      logger.info("String_Node_Str" + attachment + "String_Node_Str");
    }
  }
  if (cladeClass == null) {
    logger.error("String_Node_Str" + cladeRoot + "String_Node_Str");
    return;
  }
  Term cladeTerm=null;
  String[] idFields=cladeClass.getID().split("String_Node_Str");
  if (idFields.length == 2) {
    if (idFields[0].equals(prefix)) {
      cladeTerm=target.addTermbyID(cladeClass.getID(),cladeClass.getName());
      if (cladeClass.getDbxrefs() != null) {
        for (        Dbxref d : cladeClass.getDbxrefs()) {
          target.addXRefToTerm(cladeTerm,d.getDatabase(),d.getDatabaseID());
        }
      }
      if (cladeClass.getSynonyms() != null) {
        for (        Synonym s : cladeClass.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)           cladeTerm.addSynonym(newSyn);
        }
      }
    }
 else {
      cladeTerm=target.addTerm(cladeClass.getName());
      target.addXRefToTerm(cladeTerm,idFields[0],idFields[1]);
    }
  }
 else {
    logger.warn("String_Node_Str" + cladeClass.getID() + "String_Node_Str");
  }
  if (cladeTerm != null) {
    if (u.getRankString(cladeClass) != null)     target.setRankFromName(cladeTerm,u.getRankString(cladeClass));
    target.attachParent(cladeTerm,parentTerm);
    addChildren(cladeClass,cladeTerm,target,prefix);
  }
}

Fixed version (ground truth):
/** 
 * @param attachment name of parent node for attached clade
 * @param cladeRoot name of root node (child of parent) for attached clade
 * @param prefix default prefix for target ontology
 */
@Override public void attach(String attachment,String cladeRoot,String prefix){
  logger.info("String_Node_Str" + source);
  u=new OBOUtils(source.getAbsolutePath());
  logger.info("String_Node_Str");
  logger.info("String_Node_Str" + target.getTerms().size());
  Term parentTerm=null;
  OBOClass cladeClass=u.lookupTermByName(cladeRoot);
  parentTerm=target.getTermbyName(attachment);
  if (parentTerm == null) {
    if (!target.isEmpty()) {
      logger.error("String_Node_Str" + source.getAbsolutePath() + "String_Node_Str"+ attachment+ "String_Node_Str"+ target);
      return;
    }
 else {
      OBOClass attachmentClass=u.lookupTermByName(attachment);
      if (attachmentClass != null) {
        parentTerm=target.addTermbyID(attachmentClass.getID(),attachment);
      }
 else {
        parentTerm=target.addTerm(attachment);
      }
      logger.info("String_Node_Str" + attachment + "String_Node_Str");
    }
  }
  if (cladeClass == null) {
    logger.warn("String_Node_Str" + cladeRoot + "String_Node_Str");
    cladeClass=parentTerm.asOBOClass();
  }
  logger.info("String_Node_Str" + target.getTermbyName("String_Node_Str"));
  for (  Term t : target.getTerms()) {
    if ("String_Node_Str".equals(t.getLabel())) {
      logger.info("String_Node_Str");
    }
  }
  Term cladeTerm=copyTerm(cladeClass,prefix);
  if (cladeTerm != null) {
    if (u.getRankString(cladeClass) != null)     target.setRankFromName(cladeTerm,u.getRankString(cladeClass));
    if (!cladeTerm.getID().equals(parentTerm.getID()))     target.attachParent(cladeTerm,parentTerm);
    addChildren(cladeClass,cladeTerm,target,prefix);
  }
}