private DataTypeComponent doComponentReplacement(
			LinkedList<DataTypeComponentDB> replacedComponents, int offset, DataType dataType,
			int length, String componentName, String comment)
			throws IllegalArgumentException, IOException {

		// Attempt quick update of a single defined component if possible.
		// A quick update requires that component characteristics including length, offset,
		// and alignment (if packed) not change.  All other situations generally require a
		// repack.
		DataTypeComponentDB oldComponent = replacedComponents.get(0);
		DataType oldDt = oldComponent.getDataType();
		if (replacedComponents.size() == 1 && oldDt != DEFAULT && dataType != DEFAULT &&
			length == oldComponent.getLength() && offset == oldComponent.getOffset() &&
			(!isPackingEnabled() || dataType.getAlignment() == oldDt.getAlignment())) {

			oldComponent.update(componentName, dataType, comment);
			oldDt.removeParent(this);
			dataType.addParent(this);

			setLastChangeTime(System.currentTimeMillis());
			dataMgr.dataTypeChanged(this, false);
			return oldComponent;
		}

		DataTypeComponent replaceComponent =
			replaceComponents(replacedComponents, dataType, offset, length, componentName, comment);

		repack(false, false);
		record.setIntValue(CompositeDBAdapter.COMPOSITE_LENGTH_COL, structLength);
		compositeAdapter.updateRecord(record, true);
		notifySizeChanged(false);

		return replaceComponent;
	}
Perform component replacement(s)
@param replacedComponents ordered list of components to be replaced
@param offset offset of component replacement
@param dataType datatype of component replacement
@param length length of component replacement
@param componentName name of component replacement (may be null)
@param comment comment for component replacement (may be null)
@return new/updated component (may be null if replacement is not a defined component)
@throws IllegalArgumentException if unable to identify/make sufficient space
@throws IOException if an IO error occurs
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/data/StructureDB.java