Program: 154142
Project: 154142
Buggy source:
/** 
 * @param targetParentName name of parent node for attached clade
 * @param sourceRootName name of root node (child of parent) for attached clade
 * @param prefix default prefix for target ontology
 */
@Override public void attach(String targetParentName,String sourceRootName,String prefix){
  logger.info("String_Node_Str" + sourceFile);
  sourceUtils=new OBOUtils(sourceFile.getAbsolutePath());
  logger.info("String_Node_Str");
  logger.info("String_Node_Str" + target.getTerms().size());
  logger.info("String_Node_Str" + sourceUtils.getTerms().size());
  if (targetParentName == null)   copyRootToTarget(sourceRootName,prefix);
 else   if (targetParentName.equalsIgnoreCase(sourceRootName)) {
    OBOClass sourceRoot=sourceUtils.lookupTermByName(sourceRootName);
    Term targetParent=target.getTermbyName(targetParentName);
    Term targetRoot=copyTerm(sourceRoot,prefix);
    logger.info("String_Node_Str" + targetParent);
    logger.info("String_Node_Str" + targetParentName + "String_Node_Str"+ target.getTermbyName(targetParentName));
    logger.info("String_Node_Str" + target.getTerms().size());
    checkTarget("String_Node_Str");
    logger.info("String_Node_Str" + targetParent);
    logger.info("String_Node_Str" + targetParentName + "String_Node_Str"+ target.getTermbyName(targetParentName));
    logger.info("String_Node_Str" + targetRoot + "String_Node_Str"+ targetRoot.getLabel());
    target.attachParent(targetRoot,targetParent);
    addChildren(sourceRoot,targetRoot,target,prefix);
    logger.info("String_Node_Str" + targetParentName + "String_Node_Str"+ target.getTermbyName("String_Node_Str"));
    logger.info("String_Node_Str" + target.getTermbyName("String_Node_Str"));
    logger.info("String_Node_Str" + target.getTerms().size());
    checkTarget("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * @param targetParentName name of parent node for attached clade
 * @param sourceRootName name of root node (child of parent) for attached clade
 * @param prefix default prefix for target ontology
 */
@Override public void attach(String targetParentName,String sourceRootName,String prefix){
  logger.info("String_Node_Str" + sourceFile);
  sourceUtils=new OBOUtils(sourceFile.getAbsolutePath());
  logger.info("String_Node_Str");
  logger.info("String_Node_Str" + target.getTerms().size());
  logger.info("String_Node_Str" + sourceUtils.getTerms().size());
  if (targetParentName == null)   copyRootToTarget(sourceRootName,prefix);
 else   if (!targetParentName.equalsIgnoreCase(sourceRootName)) {
    OBOClass sourceRoot=sourceUtils.lookupTermByName(sourceRootName);
    Term targetParent=target.getTermbyName(targetParentName);
    Term targetRoot=copyTerm(sourceRoot,prefix);
    logger.info("String_Node_Str" + targetParent);
    logger.info("String_Node_Str" + targetParentName + "String_Node_Str"+ target.getTermbyName(targetParentName));
    logger.info("String_Node_Str" + target.getTerms().size());
    logger.info("String_Node_Str" + targetParent);
    logger.info("String_Node_Str" + targetParentName + "String_Node_Str"+ target.getTermbyName(targetParentName));
    logger.info("String_Node_Str" + targetRoot + "String_Node_Str"+ targetRoot.getLabel());
    target.attachParent(targetRoot,targetParent);
    addChildren(sourceRoot,targetRoot,target,prefix);
    logger.info("String_Node_Str" + targetParentName + "String_Node_Str"+ target.getTermbyName(targetParentName));
    logger.info("String_Node_Str" + target.getTerms().size());
  }
}