private void replaceQueuedDataTypes() {

		// Collect all datatypes to be replaced and notify children which may also get queued
		// for removal.
		Map<Long, Long> dataTypeReplacementMap = new HashMap<>();
		List<Pair<DataType, DataType>> dataTypeReplacements = new LinkedList<>();
		while (!typesToReplace.isEmpty()) {
			Pair<DataType, DataType> dataTypeReplacement = typesToReplace.removeFirst();
			DataType replacedDt = dataTypeReplacement.first;
			DataType replacementDt = dataTypeReplacement.second;

			long replacedId = getID(replacedDt);
			if (replacedId <= 0) {
				Msg.error(this, "Unexpected ID for replaced datatype (" + replacedId + "): " +
					replacedDt.getPathName());
				continue; // ignore attempt to replace special type
			}
			long replacementId = getID(dataTypeReplacement.second);
			if (replacementId < 0) {
				Msg.error(this, "Unexpected ID for replacement datatype (" + replacementId + "): " +
					replacementDt.getPathName());
			}

			replaceUsesInOtherDataTypes(replacedDt, replacementDt);

			dataTypeReplacements.add(dataTypeReplacement);
			dataTypeReplacementMap.put(replacedId, replacementId);
		}

		// perform any neccessary external use replacements
		replaceDataTypesUsed(dataTypeReplacementMap);

		// perform actual database updates (e.g., record updates, change notifications, etc.)
		for (Pair<DataType, DataType> dataTypeReplacement : dataTypeReplacements) {
			replaceDataType(dataTypeReplacement.first, dataTypeReplacement.second);
		}
	}
Complete datatype resolution after having attempted to find an existing equivalent type. 
An attempt is made to identify a conflicting datatype and determine a conflict resolution
using the specified conflict handler.
@param dataType datatype being resolved
@param sourceArchive source archive associated with new type (may be null)
@return resolved datatype (may be existing or newly added datatype)
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/data/DataTypeManagerDB.java