From 7cb2997786c447793a128bf435f5223896069348 Mon Sep 17 00:00:00 2001 From: hr2904 Date: Fri, 21 Jun 2024 18:44:43 +0530 Subject: [PATCH] resolved PR comment --- .../preprocessor/datamesh/StakeholderTitlePreProcessor.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/preprocessor/datamesh/StakeholderTitlePreProcessor.java b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/preprocessor/datamesh/StakeholderTitlePreProcessor.java index 589636c2d07..7e1c36f12df 100644 --- a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/preprocessor/datamesh/StakeholderTitlePreProcessor.java +++ b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/preprocessor/datamesh/StakeholderTitlePreProcessor.java @@ -115,13 +115,14 @@ private void processCreateStakeholderTitle(AtlasEntity entity) throws AtlasBaseE if (CollectionUtils.isEmpty(domainQualifiedNames)) { throw new AtlasBaseException(BAD_REQUEST, "Please provide attribute " + ATTR_DOMAIN_QUALIFIED_NAMES); } - domainQualifiedNames.replaceAll(s -> s.equals(STAR) ? NEW_STAR : s); - if (domainQualifiedNames.contains(NEW_STAR)) { + if (domainQualifiedNames.contains(NEW_STAR) || domainQualifiedNames.contains(STAR)) { if (domainQualifiedNames.size() > 1) { domainQualifiedNames.clear(); domainQualifiedNames.add(NEW_STAR); entity.setAttribute(ATTR_DOMAIN_QUALIFIED_NAMES, domainQualifiedNames); + } else { + domainQualifiedNames.replaceAll(s -> s.equals(STAR) ? NEW_STAR : s); } String qualifiedName = format(PATTERN_QUALIFIED_NAME_ALL_DOMAINS, getUUID());