public List<Object> applyNewFunctionDefinition(FunctionDefinition functionDefinition)
			throws CancelledException, DuplicateNameException, DataTypeDependencyException,
			InvalidInputException {

		List<Object> changedItems = new ArrayList<Object>();

		// get the corresponding existing pointer for this function definition from the dtManager
		Pointer pointer = getPointerDataType(functionDefinition);
		if (pointer == null) {
			throw new IllegalArgumentException(
				"Cannot find existing pointer data type for " + functionDefinition.getName());
		}

		// get the vftable structures that contain the pointer to the function definition
		Collection<DataType> dataTypesContaining = pointer.getParents();

		for (DataType dataTypeContaining : dataTypesContaining) {
			monitor.checkCancelled();

			if (!(dataTypeContaining instanceof Structure)) {
				continue;
			}

			Structure vftableStructure = (Structure) dataTypeContaining;

			if (!vftableStructure.getName().contains("_vftable")) {
				continue;
			}

			// get class namespace using the vftable structure
			Namespace vfunctionStructureNamespace = getClassNamespace(vftableStructure);

			//skip if not in the class data type folder so cannot get corresponding namespace
			if (vfunctionStructureNamespace == null) {
				continue;
			}

			Data vftableData =
				getVftableStructureFromListing(vfunctionStructureNamespace, vftableStructure);

			if (vftableData == null) {
				throw new IllegalArgumentException(
					"Cannot retrieve the associated vftable data from the listing for the given function definition " +
						functionDefinition.getName());
			}

			DataTypeComponent[] vftableComponents = vftableStructure.getComponents();

			int functionDefIndex = getVfunctionIndex(vftableStructure, pointer);

			if (functionDefIndex == -1) {
				throw new IllegalArgumentException(
					"Vftable structure does not contain pointer to the given function definition " +
						vftableStructure.getName());
			}

			DataTypeComponent vfunctionComponent = vftableComponents[functionDefIndex];

			// update container structure field names if the name of the function
			// definition has changed
			List<Object> changedStructs =
				updateComponentFieldName(vfunctionComponent, functionDefinition);

			// updateListingVfunctionSignature for indiv component and vftable addr
			if (changedStructs != null && !changedStructs.isEmpty()) {
				changedItems = updateList(changedItems, changedStructs);
			}

			int functionIndex = vfunctionComponent.getOrdinal();
			Object changedItem = updateListingVfunctionSignature(vftableData,
				vftableComponents[functionIndex], vftableData.getAddress());
			if (changedItem != null && !changedItems.contains(changedItem)) {
				changedItems.add(changedItem);
			}

		}

		return changedItems;

	}
Method to apply the given function definition to the corresponding function signatures that
do not match and also update the vftable structure fields to have the correct name if
different from the changed one.
@param functionDefinition the new function definition to apply
@return a list of items changed
@throws CancelledException if cancelled
@throws DuplicateNameException if any changes cause duplicate name exceptions
@throws DataTypeDependencyException if any changes cause data type dependency issues
@throws InvalidInputException if there are invalid inputs when performing changes
Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RecoveredClassHelper.java