private static DataType getMatchingDataType(DataType newDataType,
			FileDataTypeManager oldFileArchive, FileDataTypeManager newFileArchive) {

		// Try to get data type with same full path name.
		DataType oldDataType =
			oldFileArchive.getDataType(newDataType.getCategoryPath(), newDataType.getName());
		if (oldDataType != null) {
			return oldDataType;
		}
		// Get all the old data types with the same name.
		ArrayList<DataType> oldDataTypeList = new ArrayList<>();
		oldFileArchive.findDataTypes(newDataType.getName(), oldDataTypeList);
		if (oldDataTypeList.isEmpty()) {
			return null;
		}
		// Get all new data types with the same name.
		ArrayList<DataType> newDataTypeList = new ArrayList<>();
		newFileArchive.findDataTypes(newDataType.getName(), newDataTypeList);
		// If there is a one to one match then assume a match.
		if (oldDataTypeList.size() == 1 && newDataTypeList.size() == 1) {
			DataType oldArchiveDataType = oldDataTypeList.get(0);
			if (areSameClassType(newDataType, oldArchiveDataType)) {
				return oldArchiveDataType;
			}
		}
		// Otherwise see if there is a single match based on full path name ignoring case.
		String newPath = newDataType.getCategoryPath().getPath().toLowerCase();
		DataType ignoreCaseDataType = null;
		for (DataType oldArchiveDataType : oldDataTypeList) {
			String oldPath = oldArchiveDataType.getCategoryPath().getPath().toLowerCase();
			if (oldPath.equals(newPath)) {
				if (ignoreCaseDataType == null) {
					ignoreCaseDataType = oldArchiveDataType;
				}
				else {
					// Found more than one that matches so give up.
					return null;
				}
			}
		}
		// If we got only one old then see if 1 to 1 match with only one new.
		if (ignoreCaseDataType != null) {
			int countNewWithoutCase = 0;
			for (DataType newArchiveDataType : newDataTypeList) {
				String otherNewPath = newArchiveDataType.getCategoryPath().getPath().toLowerCase();
				if (otherNewPath.equals(newPath)) {
					countNewWithoutCase++;
				}
			}
			if (countNewWithoutCase == 1 && areSameClassType(newDataType, ignoreCaseDataType)) {
				return ignoreCaseDataType; // 1 to 1 match when case insensitive.
			}
		}
		return null;
	}
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