private static void transformDataType(DataType newDataType, FileDataTypeManager newFileArchive,
			DataType matchingDataType) {

		// If we got a data type with the same name that is the same kind of data type then transform it.
		// Give the newDataType the same ID as the matchingDataType.
		if (matchingDataType != null && (newDataType.getClass() == matchingDataType.getClass())) {
			SourceArchive oldSourceArchive = matchingDataType.getSourceArchive();
			UniversalID oldUniversalID = matchingDataType.getUniversalID();
			SourceArchive newSourceArchive = newDataType.getSourceArchive();
			UniversalID newUniversalID = newDataType.getUniversalID();
			boolean isNewSourceArchiveLocal = isLocalSourceArchive(newDataType);
			if (oldSourceArchive != null) {
				boolean isOldSourceArchiveLocal = isLocalSourceArchive(matchingDataType);
				UniversalID oldSourceArchiveID = oldSourceArchive.getSourceArchiveID();
				UniversalID newSourceArchiveID = newSourceArchive.getSourceArchiveID();
				// Is this a local data type?
				if (isOldSourceArchiveLocal) {
					if (!isNewSourceArchiveLocal) {
						SourceArchive localSourceArchive = getLocalSourceArchive(newDataType);
						if (dataTypeIDExists(newFileArchive, newDataType, localSourceArchive,
							oldUniversalID)) {
							return; // Already have data type with this ID.
						}
						newDataType.setSourceArchive(localSourceArchive);
					}
				}
				// Is this a built-in data type?
				else if (DataTypeManager.BUILT_IN_ARCHIVE_UNIVERSAL_ID.equals(oldSourceArchiveID)) {
					if (!DataTypeManager.BUILT_IN_ARCHIVE_UNIVERSAL_ID.equals(newSourceArchiveID)) {
						Msg.warn(DataTypeArchiveTransformer.class,
							"DataType " + newDataType.getName() + " has source of " +
								newSourceArchive.getName() + " when old data type was BUILT-IN.");
					}
				}
				else if (DataTypeManager.BUILT_IN_ARCHIVE_UNIVERSAL_ID.equals(newSourceArchiveID)) {
					// don't set source on built-ins
				}
				else if (newUniversalID == null) {
					Msg.error(DataTypeArchiveTransformer.class,
						"Error: " + newDataType.getPathName() + " doesn't have a Universal ID.");
				}
				else if (!newUniversalID.equals(oldUniversalID) || !isNewSourceArchiveLocal) {
					SourceArchive resolvedSourceArchive =
						newFileArchive.resolveSourceArchive(oldSourceArchive);
					if (dataTypeIDExists(newFileArchive, newDataType, resolvedSourceArchive,
						oldUniversalID)) {
						return; // Already have data type with this ID.
					}
					newDataType.setSourceArchive(oldSourceArchive);
				}
			}
			else {
				// Doesn't have source archive, so let it be whatever it is.
			}
			if (!(newDataType instanceof BuiltIn) && oldUniversalID != null) {
				if (!oldUniversalID.equals(newUniversalID)) {
					((DataTypeDB) newDataType).setUniversalID(oldUniversalID);
				}
			}
		}
	}
DataTypeArchiveTransformer changes (transforms) a new archive file so that it appears to be
an updated copy of a previously existing data type archive. This allows us to parse a new
version of each standard GDT file we supply. This class changes the IDs on the data types
so they will match the previous version's IDs. This allows the new data type archive and
its data types to become the associated data types where the previous version data types
were applied.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/data/DataTypeArchiveTransformer.java