private boolean replaceFunctionName(Function function, String name, SourceType source) {
		if (function != null) {
			Address entry = function.getEntryPoint();
			String origName = function.getName();
			if (!Objects.equals(origName, name)) {
				for (int i = 0; i < Integer.MAX_VALUE; i++) {
					String newName =
						(i == 0) ? name : name + ProgramMerge.SYMBOL_CONFLICT_SUFFIX + i;
					try {
						function.setName(newName, source);
						if (i > 0) {
							infoMsg.append("Function '" + name + "' was merged as '" + newName +
								"' @ address " + entry.toString() + ".\n");
						}
						return true;
					}
					catch (DuplicateNameException e) {
						continue;
					}
					catch (InvalidInputException e) {
						errorMsg.append(
							"Address = " + entry.toString() + ": " + e.getMessage() + "\n");
						return false;
					}
				}
				errorMsg.append("Function '" + origName + "' couldn't be renamed to '" + name +
					"' @ address " + entry.toString() + ".\n");
				return false;
			}
		}
		return false;
	}
<CODE>mergeFunctionName</CODE> replaces the name of the
function in program1 with the name of the function in program2
at the specified entry point address.
@param entry2 the entry point address of the function.
This address should be derived from the origin program.
@param monitor the task monitor for notifying the user of this merge's progress.
Ghidra/Features/Base/src/main/java/ghidra/program/util/ProgramMerge.java