private void adjustIDMapsForReplace(ExternalLocation[] externalLocations, int chosenExternal) {

		long resultID =
			(externalLocations[RESULT] != null) ? externalLocations[RESULT].getSymbol().getID()
					: -1;
		long latestID =
			(externalLocations[LATEST] != null) ? externalLocations[LATEST].getSymbol().getID()
					: -1;
		long myID =
			(externalLocations[MY] != null) ? externalLocations[MY].getSymbol().getID() : -1;
		long originalID =
			(externalLocations[ORIGINAL] != null) ? externalLocations[ORIGINAL].getSymbol().getID()
					: -1;
		if (originalID != -1) {
//			if (originalID != resultID) {
			originalResolvedSymbols.put(originalID, resultID);
//			}
//			else if (originalResolvedSymbols.contains(originalID)) {
//				originalResolvedSymbols.remove(originalID);
//			}
		}
		if (latestID != -1) {
//			if (latestID != resultID) {
			latestResolvedSymbols.put(latestID, resultID);
//			}
//			else if (latestResolvedSymbols.contains(latestID)) {
//				latestResolvedSymbols.remove(latestID);
//			}
		}
		if (myID != -1) {
//			if (myID != resultID) {
			myResolvedSymbols.put(myID, resultID);
//			}
//			else if (myResolvedSymbols.contains(myID)) {
//				myResolvedSymbols.remove(myID);
//			}
		}
	}
Merges the entire external so that it will match the external as it is in the program
indicated by the chosen option.
@param externalLocations the external locations for the external in Latest, My, and Original.
(Any of these locations can be null if the external is not in that program.)
@param chosenConflictOption ListingMergeConstant (KEEP_LATEST, KEEP_MY, KEEP_ORIGINAL)
indicating which program the resulting external should become.
@param monitor the task monitor for feedback and cancelling the merge.
@throws CancelledException if the user cancels the merge.
@throws InvalidInputException
@throws DuplicateNameException
Ghidra/Features/Base/src/main/java/ghidra/app/merge/listing/ExternalFunctionMerger.java