@Override
	public boolean applyTo(Program program, TaskMonitor monitor) {
		Listing listing = program.getListing();
		InstructionIterator iter = listing.getInstructions(addrSet, true);
		if (iter.hasNext()) {
			setStatusMsg("Can't create data because the current selection contains instructions");
			return false;
		}

		Address addr = addrSet.getMinAddress();
		Data data = listing.getDataAt(addr);
		if (data == null) {
			setStatusMsg("Can not create Data at address " + addr);
			return false;
		}

		DataType existingDT = data.getDataType();

		newDataType = newDataType.clone(program.getDataTypeManager());
		newDataType =
			DataUtilities.reconcileAppliedDataType(existingDT, newDataType, stackPointers);

		monitor.initialize(addrSet.getNumAddresses());
		AddressRangeIterator it = addrSet.getAddressRanges();
		while (it.hasNext() && !monitor.isCancelled()) {
			AddressRange range = it.next();
			try {
				createData(range.getMinAddress(), range.getMaxAddress(), newDataType, program,
					monitor);
			}
			catch (Exception e) {
				setStatusMsg(e.getMessage());
				if (numDataCreated == 0) {
					return false;
				}
			}

		}
		if (numDataCreated == 0) {
			setStatusMsg("Not Enough space to create Data");
			return false;
		}

		return true;
	}
This is the same as {@link #CreateDataBackgroundCmd(AddressSetView, DataType)} except that
it allows the caller to control whether or not a pointer data type is created when a 
non-pointer data type is applied at a location that previously contained a pointer data
type.
 
@param addrSet The address set to fill with the given dataType.
@param dataType the dataType to be applied to the address set.
@param stackPointers if true simple pointer conversion is enabled 
(see {@link DataUtilities#reconcileAppliedDataType(DataType, DataType, boolean)}).
Ghidra/Features/Base/src/main/java/ghidra/app/cmd/data/CreateDataBackgroundCmd.java