@Override
	public void replaceWith(DataType dataType) {
		if (!(dataType instanceof StructureInternal)) {
			throw new IllegalArgumentException();
		}
		lock.acquire();
		boolean isResolveCacheOwner = dataMgr.activateResolveCache();
		try {
			checkDeleted();
			doReplaceWith((StructureInternal) dataType, true);
		}
		catch (DataTypeDependencyException e) {
			throw new IllegalArgumentException(e.getMessage(), e);
		}
		catch (IOException e) {
			dataMgr.dbError(e);
		}
		finally {
			if (isResolveCacheOwner) {
				dataMgr.processResolveQueue(true);
			}
			lock.release();
		}
	}
Replaces the internal components of this structure with components of the given structure.

@param dataType the structure to get the component information from.
@throws IllegalArgumentException if any of the component data types are not allowed to
replace a component in this composite data type. For example, suppose dt1 contains dt2.
Therefore it is not valid to replace a dt2 component with dt1 since this would cause a
cyclic dependency.
@see DataTypeDB#replaceWith(DataType)
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/data/StructureDB.java