@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 for packed
				replacementDt = resolve(replacementDt);
				checkAncestry(replacementDt);
			}
			catch (Exception e) {
				// Handle bad replacement with use of undefined component
				replacementDt = isPackingEnabled() ? Undefined1DataType.dataType : DataType.DEFAULT;
			}

			boolean changed = false;
			for (int i = components.size() - 1; i >= 0; i--) {
				DataTypeComponentDB comp = components.get(i);
				if (comp.isBitFieldComponent()) {
					changed |= updateBitFieldDataType(comp, oldDt, replacementDt);
				}
				else if (comp.getDataType() == oldDt) {
					setComponentDataType(comp, replacementDt, i);
					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();
		}
	}
Gets the number of Undefined bytes beginning at the indicated component ordinal. Undefined
bytes that have a field name or comment specified are also included.

@param ordinal the component ordinal to begin checking at.
@return the number of contiguous undefined bytes
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/data/StructureDB.java