code: private void collectTypeHierarchyInfo(AtlasTypeRegistry              typeRegistry,
                                            Set<String>                    allSuperTypeNames,
                                            Map<String, AtlasAttribute>    allAttributes,
                                            List<String>                   visitedTypes) throws AtlasBaseException {
          if (visitedTypes.contains(entityDef.getName())) {
              throw new AtlasBaseException(AtlasErrorCode.CIRCULAR_REFERENCE, entityDef.getName(),
                                           visitedTypes.toString());
          }
  
          if (CollectionUtils.isNotEmpty(entityDef.getSuperTypes())) {
              visitedTypes.add(entityDef.getName());
              for (String superTypeName : entityDef.getSuperTypes()) {
                  AtlasEntityType superType = typeRegistry.getEntityTypeByName(superTypeName);
  
                  if (superType != null) {
                      superType.collectTypeHierarchyInfo(typeRegistry, allSuperTypeNames, allAttributes, visitedTypes);
                  }
              }
              visitedTypes.remove(entityDef.getName());
              allSuperTypeNames.addAll(entityDef.getSuperTypes());
          }
  
          if (CollectionUtils.isNotEmpty(entityDef.getAttributeDefs())) {
              for (AtlasAttributeDef attributeDef : entityDef.getAttributeDefs()) {
  
                  AtlasType type = typeRegistry.getType(attributeDef.getTypeName());
                  allAttributes.put(attributeDef.getName(), new AtlasAttribute(this, attributeDef, type));
              }
          }
      }
docs: /*
  This method should not assume that resolveReferences() has been called on all superTypes.
  this.entityDef is the only safe member to reference here