private static <T extends DataType> T findPreferredDataType(DataTypeManager dataTypeManager,
			Namespace namespace, String dtName, Class<T> classConstraint,
			boolean parentNamespacePreferred) {
		CategoryPath rootPath = getPreferredRootNamespaceCategoryPath(dataTypeManager);
		if (rootPath == null) {
			return null;
		}

		if (namespace == null || namespace.isGlobal() || namespace.isLibrary()) {
			return getAssignableDataType(dataTypeManager, rootPath, null, dtName, classConstraint);
		}

		if (parentNamespacePreferred) {
			T dt = getAssignableDataType(dataTypeManager, rootPath,
				namespace.getParentNamespace().getPathList(true), dtName, classConstraint);
			if (dt != null) {
				return dt;
			}
		}

		return getAssignableDataType(dataTypeManager, rootPath, namespace.getPathList(true), dtName,
			classConstraint);
	}
Perform a preferred category namespace qualified datatype search using
category path supplied by {@link Program#getPreferredRootNamespaceCategoryPath()}.
Any {@link Library} namespace will be ignored and treated like the global namespace 
when generating a related category path.  This method only applies to 
{@link ProgramBasedDataTypeManager} and will always return null for other 
datatype managers.
@param dataTypeManager datatype manager
@param namespace namespace constraint or null for no namespace.
@param dtName datatype name
@param classConstraint type of datatype by its interface class (e.g., {@link Structure}).
@param parentNamespacePreferred if true matching on parent namespace is 
enabled and preferred over match on actual namespace.  This is relevant for
class structure searching.
@return preferred datatype match if found
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/data/DataTypeUtilities.java