private static Data getData(Address addr, ClearDataMode clearMode, Listing listing)
			throws CodeUnitInsertionException {

		Data data = listing.getDataAt(addr);
		if (data != null) {
			return data; // existing data; it us possible to create data
		}

		// null data; see if we are in a composite
		if (clearMode == ClearDataMode.CLEAR_ALL_CONFLICT_DATA ||
			clearMode == ClearDataMode.CLEAR_ALL_UNDEFINED_CONFLICT_DATA ||
			clearMode == ClearDataMode.CLEAR_ALL_DEFAULT_CONFLICT_DATA) {

			// allow offcut addr if CLEAR_ALL_CONFLICT_DATA
			data = listing.getDataContaining(addr);
			if (data != null && isDataClearingDenied(data.getDataType(), clearMode)) {
				data = null; // force error
			}
		}

		// null data implies that we cannot create data at this address
		if (data == null) {
			throw new CodeUnitInsertionException("Could not create Data at address " + addr);
		}

		return data;
	}
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