private static void checkForDefinedData(DataTypeInstance dti, Listing listing, Address address,
			Address end, ClearDataMode clearMode) throws CodeUnitInsertionException {

		// ignore all defined data which may be cleared
		while (end.compareTo(address) <= 0) {
			Data definedData = listing.getDefinedDataAfter(end);
			if (definedData == null || definedData.getMinAddress().compareTo(address) > 0) {
				return;
			}

			if (isDataClearingDenied(definedData.getDataType(), clearMode)) {
				throw new CodeUnitInsertionException(
					"Not enough space to create DataType " + dti.getDataType().getDisplayName());
			}
			end = definedData.getMaxAddress();
		}
	}
Create data where existing data may already exist.
@param program the program
@param addr data address (offcut data address only allowed if clearMode == ClearDataMode.CLEAR_ALL_CONFLICT_DATA)
@param newType new data-type being applied
@param length data length (used only for Dynamic newDataType which has canSpecifyLength()==true)
@param stackPointers see {@link #reconcileAppliedDataType(DataType, DataType, boolean)}
@param clearMode see CreateDataMode
@return new data created
@throws CodeUnitInsertionException if data creation failed
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/DataUtilities.java