private FunctionDefinition updateFunctionDefinition(FunctionDefinition functionDefinition,
			FunctionDefinition newFunctionDefinition) {

		boolean changed = false;

		if (!functionDefinition.getName().equals(newFunctionDefinition.getName())) {
			try {
				functionDefinition.setName(newFunctionDefinition.getName());
				changed = true;
			}
			catch (InvalidNameException | DuplicateNameException e) {
				// don't update if an exception
			}

		}

		ParameterDefinition[] currentArgs = functionDefinition.getArguments();
		ParameterDefinition[] changedArgs = newFunctionDefinition.getArguments();

		// only update if same number of params and there are differences
		// if different number then user must decide whether to update the definition 
		if (currentArgs.length > 0 && currentArgs.length == changedArgs.length) {

			// keep the original function definition's this param if there is one hard coded
			// if only the this is different then don't update changed flag
			if (currentArgs[0].getName().equals("this")) {
				changedArgs[0] = currentArgs[0];
			}
			// if other than hard-coded this is different then change 
			// to use to changedArgs
			if (!areEqualFunctionArgs(currentArgs, changedArgs)) {
				functionDefinition.setArguments(changedArgs);
				changed = true;
			}
		}

		if (!functionDefinition.getReturnType().equals(newFunctionDefinition.getReturnType())) {
			functionDefinition.setReturnType(newFunctionDefinition.getReturnType());
			changed = true;
		}
		if (changed) {
			return functionDefinition;
		}
		return null;

	}
Method to update the given function definition with the new function definition
@param functionDefinition the given function definition
@param newFunctionDefinition the new function definition
@return the new function definition or null if not changed
Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RecoveredClassHelper.java