Skip to content

Commit

Permalink
Merge branch 'task/minorMM-3720' into dev/task/minorMM-3720
Browse files Browse the repository at this point in the history
  • Loading branch information
aarshi0301 committed Oct 25, 2024
2 parents d606dce + fccce0a commit b4f86d4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ public AtlasType getType(String typeName) throws AtlasBaseException {
AtlasType ret = registryData.allTypes.getTypeByName(typeName);

if (ret == null ) {
if (!StringUtils.isEmpty(typeName) && typeName.startsWith(ATLAS_TYPE_ARRAY_PREFIX) && typeName.endsWith(ATLAS_TYPE_ARRAY_SUFFIX)) {
if (typeName.startsWith(ATLAS_TYPE_ARRAY_PREFIX) && typeName.endsWith(ATLAS_TYPE_ARRAY_SUFFIX)) {
int startIdx = ATLAS_TYPE_ARRAY_PREFIX.length();
int endIdx = typeName.length() - ATLAS_TYPE_ARRAY_SUFFIX.length();
String elementTypeName = typeName.substring(startIdx, endIdx);

ret = new AtlasArrayType(elementTypeName, this);
} else if (!StringUtils.isEmpty(typeName) && typeName.startsWith(ATLAS_TYPE_MAP_PREFIX) && typeName.endsWith(ATLAS_TYPE_MAP_SUFFIX)) {
} else if (typeName.startsWith(ATLAS_TYPE_MAP_PREFIX) && typeName.endsWith(ATLAS_TYPE_MAP_SUFFIX)) {
int startIdx = ATLAS_TYPE_MAP_PREFIX.length();
int endIdx = typeName.length() - ATLAS_TYPE_MAP_SUFFIX.length();
String[] keyValueTypes = typeName.substring(startIdx, endIdx).split(ATLAS_TYPE_MAP_KEY_VAL_SEP, 2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1690,11 +1690,15 @@ private AtlasStruct mapVertexToStruct(AtlasVertex entityVertex, String edgeLabel
if (GraphHelper.elementExists(edge)) {
final AtlasVertex referenceVertex = edge.getInVertex();

if (referenceVertex == null) {
LOG.error("reference vertex not found on edge {} from vertex {} ", edge.getId(), getGuid(entityVertex));
return ret;
}

String typeName = getTypeName(referenceVertex);

if (StringUtils.isEmpty(typeName)) {
LOG.error("typeName not found for in-vertex {} on edge {} from vertex {} ",
getGuid(referenceVertex), edge.getId(), getGuid(entityVertex));
LOG.error("typeName not found on edge {} from vertex {} ", edge.getId(), getGuid(entityVertex));
return ret;
}

Expand Down

0 comments on commit b4f86d4

Please sign in to comment.