Program: 171003
Project: 171003
Buggy source:
@GraphTransaction public AtlasGlossaryTerm createTerm(AtlasGlossaryTerm glossaryTerm) throws AtlasBaseException {
  if (DEBUG_ENABLED) {
    LOG.debug("String_Node_Str",glossaryTerm);
  }
  if (Objects.isNull(glossaryTerm)) {
    throw new AtlasBaseException(AtlasErrorCode.BAD_REQUEST,"String_Node_Str");
  }
  if (Objects.isNull(glossaryTerm.getAnchor())) {
    throw new AtlasBaseException(AtlasErrorCode.MISSING_MANDATORY_ANCHOR);
  }
  if (StringUtils.isEmpty(glossaryTerm.getQualifiedName())) {
    if (StringUtils.isEmpty(glossaryTerm.getDisplayName())) {
      throw new AtlasBaseException(AtlasErrorCode.GLOSSARY_TERM_QUALIFIED_NAME_CANT_BE_DERIVED);
    }
    if (isNameInvalid(glossaryTerm.getDisplayName())) {
      throw new AtlasBaseException(AtlasErrorCode.INVALID_DISPLAY_NAME);
    }
 else {
      glossaryTerm.setQualifiedName(glossaryTerm.getDisplayName());
    }
  }
  if (termExists(glossaryTerm)) {
    throw new AtlasBaseException(AtlasErrorCode.GLOSSARY_TERM_ALREADY_EXISTS,glossaryTerm.getQualifiedName());
  }
  AtlasGlossaryTerm storeObject=dataAccess.save(glossaryTerm);
  glossaryTermUtils.processTermRelations(storeObject,glossaryTerm,GlossaryUtils.RelationshipOperation.CREATE);
  if (StringUtils.equals(storeObject.getQualifiedName(),glossaryTerm.getQualifiedName())) {
    storeObject=dataAccess.load(glossaryTerm);
  }
 else {
    glossaryTerm.setQualifiedName(storeObject.getQualifiedName());
    storeObject=dataAccess.save(glossaryTerm);
  }
  setInfoForRelations(storeObject);
  if (DEBUG_ENABLED) {
    LOG.debug("String_Node_Str",storeObject);
  }
  return storeObject;
}

Fixed version (ground truth):
@GraphTransaction public AtlasGlossaryTerm createTerm(AtlasGlossaryTerm glossaryTerm) throws AtlasBaseException {
  if (DEBUG_ENABLED) {
    LOG.debug("String_Node_Str",glossaryTerm);
  }
  if (Objects.isNull(glossaryTerm)) {
    throw new AtlasBaseException(AtlasErrorCode.BAD_REQUEST,"String_Node_Str");
  }
  if (Objects.isNull(glossaryTerm.getAnchor())) {
    throw new AtlasBaseException(AtlasErrorCode.MISSING_MANDATORY_ANCHOR);
  }
  if (StringUtils.isEmpty(glossaryTerm.getQualifiedName())) {
    if (StringUtils.isEmpty(glossaryTerm.getDisplayName())) {
      throw new AtlasBaseException(AtlasErrorCode.GLOSSARY_TERM_QUALIFIED_NAME_CANT_BE_DERIVED);
    }
    if (isNameInvalid(glossaryTerm.getDisplayName())) {
      throw new AtlasBaseException(AtlasErrorCode.INVALID_DISPLAY_NAME);
    }
 else {
      glossaryTerm.setQualifiedName(glossaryTerm.getDisplayName());
    }
  }
  if (termExists(glossaryTerm)) {
    throw new AtlasBaseException(AtlasErrorCode.GLOSSARY_TERM_ALREADY_EXISTS,glossaryTerm.getQualifiedName());
  }
  AtlasGlossaryTerm storeObject=dataAccess.save(glossaryTerm);
  glossaryTermUtils.processTermRelations(storeObject,glossaryTerm,GlossaryUtils.RelationshipOperation.CREATE);
  if (StringUtils.equals(storeObject.getQualifiedName(),glossaryTerm.getQualifiedName())) {
    storeObject=dataAccess.load(glossaryTerm);
  }
 else {
    glossaryTerm.setQualifiedName(storeObject.getQualifiedName());
    if (termExists(glossaryTerm)) {
      throw new AtlasBaseException(AtlasErrorCode.GLOSSARY_TERM_ALREADY_EXISTS,glossaryTerm.getQualifiedName());
    }
    storeObject=dataAccess.save(glossaryTerm);
  }
  setInfoForRelations(storeObject);
  if (DEBUG_ENABLED) {
    LOG.debug("String_Node_Str",storeObject);
  }
  return storeObject;
}