void doReplaceWith(UnionInternal union, boolean notify)
			throws DataTypeDependencyException, IOException {

		// pre-resolved component types to catch dependency issues early
		DataTypeComponent[] otherComponents = union.getComponents();
		DataType[] resolvedDts = new DataType[otherComponents.length];
		for (int i = 0; i < otherComponents.length; i++) {
			resolvedDts[i] = doCheckedResolve(otherComponents[i].getDataType());
			checkAncestry(resolvedDts[i]);
		}

		for (DataTypeComponentDB dtc : components) {
			dtc.getDataType().removeParent(this);
			removeComponentRecord(dtc.getKey());
		}
		components.clear();
		unionAlignment = -1;
		computedAlignment = -1;

		doSetPackingAndAlignment(union);

		for (int i = 0; i < otherComponents.length; i++) {
			DataTypeComponent dtc = otherComponents[i];
			doAdd(resolvedDts[i], dtc.getLength(), dtc.getFieldName(), dtc.getComment(), false);
		}

		record.setString(CompositeDBAdapter.COMPOSITE_COMMENT_COL, union.getDescription());
		compositeAdapter.updateRecord(record, false);

		repack(false, false); // updates timestamp

		if (notify) {
			notifySizeChanged(false); // assume size and/or alignment changed
		}

		if (pointerPostResolveRequired) {
			dataMgr.queuePostResolve(this, union);
		}
	}
Constructor

@param dataMgr
@param cache
@param compositeAdapter
@param componentAdapter
@param record
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/data/UnionDB.java