@Override
	public void dataTypeReplaced(DataType oldDt, DataType newDt) throws IllegalArgumentException {
		DataType replacementDt = newDt;
		try {
			replacementDt = validateDataType(replacementDt); // blocks DEFAULT use
			replacementDt = replacementDt.clone(dataMgr);
			checkAncestry(replacementDt);
		}
		catch (Exception e) {
			replacementDt = Undefined1DataType.dataType;
		}
		boolean changed = false;
		for (int i = components.size() - 1; i >= 0; i--) {
			DataTypeComponentImpl dtc = components.get(i);
			if (dtc.isBitFieldComponent()) {
				changed |= updateBitFieldDataType(dtc, oldDt, replacementDt);
			}
			else if (dtc.getDataType() == oldDt) {
				int len = getPreferredComponentLength(newDt, dtc.getLength());
				oldDt.removeParent(this);
				dtc.setLength(len);
				dtc.setDataType(replacementDt);
				dtc.invalidateSettings();
				replacementDt.addParent(this);
				changed = true;
			}
		}
		if (changed) {
			repack(false);
			notifySizeChanged(); // also handles alignment change
		}
	}
Construct a new UnionDataType.
NOTE: A constructor form which accepts a {@link DataTypeManager} should be used when possible
since there may be performance benefits during datatype resolution.
@param name the name of this dataType
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/UnionDataType.java