private static void processUnmatchedEnums(FileDataTypeManager oldFileArchive,
			FileDataTypeManager newFileArchive, TaskMonitor monitor) throws CancelledException {

		// Find all anonymous enums and if not already matched to a data type in the old
		// archive, then try to match with an anonymous enum in the same category of the
		// old archive.
		Iterator<DataType> allDataTypes = newFileArchive.getAllDataTypes();
		while (allDataTypes.hasNext()) {
			monitor.checkCancelled();
			DataType newDataType = allDataTypes.next();
			if (newDataType instanceof Enum && isAnonymousType(newDataType)) {

				// Does this new data type already match one in the old archive?
				UniversalID newDtUniversalID = newDataType.getUniversalID();
				DataType matchingDt = oldFileArchive.findDataTypeForID(newDtUniversalID);
				if (matchingDt != null) {
					continue; // Already matched.
				}

				// Find the matching anonymous in the old archive under the same category.
				Enum oldEnum = findMatchingAnonEnum((Enum) newDataType, oldFileArchive);
				if (oldEnum != null && areSameClassType(newDataType, oldEnum)) {
					// Found a match so set the ID.
					transformDataType(newDataType, newFileArchive, oldEnum);
				}
			}
		}
	}
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