public Namespace getNamespace(Program program) {
		if (isRoot()) {
			return program.getGlobalNamespace();
		}
		try {
			Namespace result = parent.getNamespace(program);
			Namespace existingNamespace =
				NamespaceUtils.getFirstNonFunctionNamespace(result, name, program);
			SymbolType targetSymbolType = flattenSymbolTypeForDNI(type);
			SymbolType existingSymbolType =
				(existingNamespace != null) ? existingNamespace.getSymbol().getSymbolType() : null;

			if (existingNamespace == null) {
				result = (targetSymbolType == SymbolType.NAMESPACE)
						? program.getSymbolTable().createNameSpace(result, name,
							SourceType.IMPORTED)
						: program.getSymbolTable().createClass(result, name, SourceType.IMPORTED);

			}
			else if (existingSymbolType == targetSymbolType) {
				result = existingNamespace;
			}
			else {
				// conflict type
				if (existingSymbolType == SymbolType.NAMESPACE &&
					targetSymbolType == SymbolType.CLASS) {
					result = NamespaceUtils.convertNamespaceToClass(existingNamespace);
				}
				else if (existingSymbolType == SymbolType.CLASS &&
					targetSymbolType == SymbolType.NAMESPACE) {
					// silently allow this
					result = existingNamespace;
				}
				else {
					Msg.error(this, "Error getting Ghidra namespace for " + asNamespaceString());
					result = program.getGlobalNamespace();
				}
			}
			return result;
		}
		catch (DuplicateNameException | InvalidInputException e) {
			Msg.error(this, "Failed to create Ghidra namespace for " + asNamespaceString());
			return program.getGlobalNamespace();
		}
	}
Converts this NamespacePath into a Ghidra {@link Namespace} in the specified {@link Program},
creating missing elements on the path as necessary.

@param program Ghidra {@link Program} where the namespace should be retrieved from or created in.
@return {@link Namespace} or fallback to the progam's Global root namespace if problem.
Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/dwarf/NamespacePath.java