Program: 171004
Project: 171004
Buggy source:
@GraphTransaction public AtlasGlossaryCategory createCategory(AtlasGlossaryCategory glossaryCategory) throws AtlasBaseException {
  if (DEBUG_ENABLED) {
    LOG.debug("String_Node_Str",glossaryCategory);
  }
  if (Objects.isNull(glossaryCategory)) {
    throw new AtlasBaseException(AtlasErrorCode.BAD_REQUEST,"String_Node_Str");
  }
  if (Objects.isNull(glossaryCategory.getAnchor())) {
    throw new AtlasBaseException(AtlasErrorCode.MISSING_MANDATORY_ANCHOR);
  }
  if (StringUtils.isEmpty(glossaryCategory.getQualifiedName())) {
    if (StringUtils.isEmpty(glossaryCategory.getDisplayName())) {
      throw new AtlasBaseException(AtlasErrorCode.GLOSSARY_CATEGORY_QUALIFIED_NAME_CANT_BE_DERIVED);
    }
    if (isNameInvalid(glossaryCategory.getDisplayName())) {
      throw new AtlasBaseException(AtlasErrorCode.INVALID_DISPLAY_NAME);
    }
 else {
      glossaryCategory.setQualifiedName(glossaryCategory.getDisplayName());
    }
  }
  if (categoryExists(glossaryCategory)) {
    throw new AtlasBaseException(AtlasErrorCode.GLOSSARY_CATEGORY_ALREADY_EXISTS,glossaryCategory.getQualifiedName());
  }
  AtlasGlossaryCategory storeObject=dataAccess.save(glossaryCategory);
  Map<String,AtlasGlossaryCategory> impactedCategories=glossaryCategoryUtils.processCategoryRelations(storeObject,glossaryCategory,GlossaryUtils.RelationshipOperation.CREATE);
  dataAccess.save(impactedCategories.values());
  if (StringUtils.equals(glossaryCategory.getQualifiedName(),storeObject.getQualifiedName())) {
    storeObject=dataAccess.load(glossaryCategory);
  }
 else {
    glossaryCategory.setQualifiedName(storeObject.getQualifiedName());
    storeObject=dataAccess.save(glossaryCategory);
  }
  setInfoForRelations(storeObject);
  if (DEBUG_ENABLED) {
    LOG.debug("String_Node_Str",storeObject);
  }
  return storeObject;
}

Fixed version (ground truth):
@GraphTransaction public AtlasGlossaryCategory createCategory(AtlasGlossaryCategory glossaryCategory) throws AtlasBaseException {
  if (DEBUG_ENABLED) {
    LOG.debug("String_Node_Str",glossaryCategory);
  }
  if (Objects.isNull(glossaryCategory)) {
    throw new AtlasBaseException(AtlasErrorCode.BAD_REQUEST,"String_Node_Str");
  }
  if (Objects.isNull(glossaryCategory.getAnchor())) {
    throw new AtlasBaseException(AtlasErrorCode.MISSING_MANDATORY_ANCHOR);
  }
  if (StringUtils.isEmpty(glossaryCategory.getQualifiedName())) {
    if (StringUtils.isEmpty(glossaryCategory.getDisplayName())) {
      throw new AtlasBaseException(AtlasErrorCode.GLOSSARY_CATEGORY_QUALIFIED_NAME_CANT_BE_DERIVED);
    }
    if (isNameInvalid(glossaryCategory.getDisplayName())) {
      throw new AtlasBaseException(AtlasErrorCode.INVALID_DISPLAY_NAME);
    }
 else {
      glossaryCategory.setQualifiedName(glossaryCategory.getDisplayName());
    }
  }
  if (categoryExists(glossaryCategory)) {
    throw new AtlasBaseException(AtlasErrorCode.GLOSSARY_CATEGORY_ALREADY_EXISTS,glossaryCategory.getQualifiedName());
  }
  AtlasGlossaryCategory storeObject=dataAccess.save(glossaryCategory);
  Map<String,AtlasGlossaryCategory> impactedCategories=glossaryCategoryUtils.processCategoryRelations(storeObject,glossaryCategory,GlossaryUtils.RelationshipOperation.CREATE);
  if (StringUtils.equals(glossaryCategory.getQualifiedName(),storeObject.getQualifiedName())) {
    storeObject=dataAccess.load(glossaryCategory);
  }
 else {
    glossaryCategory.setQualifiedName(storeObject.getQualifiedName());
    if (categoryExists(glossaryCategory)) {
      throw new AtlasBaseException(AtlasErrorCode.GLOSSARY_CATEGORY_ALREADY_EXISTS,glossaryCategory.getQualifiedName());
    }
    storeObject=dataAccess.save(glossaryCategory);
  }
  dataAccess.save(impactedCategories.values());
  setInfoForRelations(storeObject);
  if (DEBUG_ENABLED) {
    LOG.debug("String_Node_Str",storeObject);
  }
  return storeObject;
}