private ExternalLocation replaceFunction(ExternalLocation toExternalLocation,
			ExternalLocation fromExternalLocation, ProgramMerge programMerge, TaskMonitor monitor)
			throws CancelledException, UnsupportedOperationException {

		Function fromFunction = fromExternalLocation.getFunction();
		Function toFunction = toExternalLocation.getFunction();
		if (fromFunction == null) {
			if (toFunction == null) {
				return toExternalLocation;
			}
			DataType dataType = getResultDataType(toExternalLocation);
			Namespace namespace = toExternalLocation.getParentNameSpace();
			String label = toExternalLocation.getLabel();
			// Need to remove the function.
			Symbol toSymbol = toExternalLocation.getSymbol();
			Address addr = toSymbol.getAddress();
			// The location is no longer valid so get the location and restore the data type.
			ExternalManager externalManager = programMerge.getResultProgram().getExternalManager();
			toSymbol.delete(); // This should remove the function and it becomes a label.
			SymbolTable symbolTable = programMerge.getResultProgram().getSymbolTable();
			Symbol symbol = symbolTable.getSymbol(label, addr, namespace);
			ExternalLocation newLocation = externalManager.getExternalLocation(symbol);
			if (newLocation != null && dataType != null && dataType != DataType.DEFAULT) {
				newLocation.setDataType(dataType); // Restore the datatype
			}
			return newLocation;
		}
		if (toFunction == null) {
			toFunction = toExternalLocation.createFunction();
		}
		if (ProgramDiff.equivalentFunctions(fromFunction, toFunction)) {
			return toExternalLocation;
		}
		programMerge.replaceExternalFunction(toFunction, fromFunction, monitor);
		return toFunction.getExternalLocation();
	}
Gets the external locations (result, latest, my, original) for the specified MY program
external space address.<br>
NOTE: Be careful where you call this method from. It is intended to be used for external
location changes only (not for Adds). It gets the ORIGINAL based on MY and then LATEST and
RESULT based on the ORIGINAL.
@param myAddress the MY program external space address for MY external location
@return all four program's external locations.
Ghidra/Features/Base/src/main/java/ghidra/app/merge/listing/ExternalFunctionMerger.java