private void doReplaceWithNonPacked(Structure struct) throws IllegalArgumentException {
		// assumes components is clear and that alignment characteristics have been set.
		if (struct.isNotYetDefined()) {
			return;
		}

		structLength = struct.isZeroLength() ? 0 : struct.getLength();
		numComponents = structLength;

		DataTypeComponent[] otherComponents = struct.getDefinedComponents();
		for (int i = 0; i < otherComponents.length; i++) {
			DataTypeComponent dtc = otherComponents[i];
			DataType dt = dtc.getDataType().clone(dataMgr);
			checkAncestry(dt);

			int length;
			if (dtc.isBitFieldComponent() || (dt instanceof Dynamic)) {
				// TODO: bitfield truncation/expansion may be an issue if data organization changes
				length = dtc.getLength();
			}
			else {
				// determine maxLength for fixed-length types
				int maxOffset;
				int nextIndex = i + 1;
				if (nextIndex < otherComponents.length) {
					maxOffset = otherComponents[nextIndex].getOffset();
				}
				else {
					maxOffset = structLength;
				}
				int maxLength = maxOffset - dtc.getOffset();
				length = getPreferredComponentLength(dt, -1, maxLength);
			}

			components.add(new DataTypeComponentImpl(dt, this, length, dtc.getOrdinal(),
				dtc.getOffset(), dtc.getFieldName(), dtc.getComment()));
		}
	}
Replaces the internal components of this structure with components of the given structure
including packing and alignment settings.

@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.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/StructureDataType.java