@Override
	public void dataTypeReplaced(DataType oldDt, DataType newDt) {
		if (oldDt == this) {
			return;
		}
		lock.acquire();
		try {
			checkDeleted();
			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--) {
				DataTypeComponentDB dtc = components.get(i);
				if (dtc.isBitFieldComponent()) {
					changed |= updateBitFieldDataType(dtc, oldDt, replacementDt);
				}
				else if (dtc.getDataType() == oldDt) {
					int len = getPreferredComponentLength(newDt, dtc.getLength());
					dtc.setLength(len, false);
					oldDt.removeParent(this);
					dtc.setDataType(replacementDt); // updates record
					dataMgr.getSettingsAdapter().removeAllSettingsRecords(dtc.getKey());
					replacementDt.addParent(this);
					changed = true;
				}
			}
			if (changed) {
				repack(false, false);
				compositeAdapter.updateRecord(record, true); // update timestamp
				notifySizeChanged(false); // also handles alignment change
			}
		}
		catch (IOException e) {
			dataMgr.dbError(e);
		}
		finally {
			lock.release();
		}
	}
Perform union member repack.
Perform lazy update of stored alignment introduced with v5 adapter.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/data/UnionDB.java