@Override
	public void autoMerge(int progressMin, int progressMax, TaskMonitor monitor)
			throws ProgramConflictException, MemoryAccessException, CancelledException {

		initializeAutoMerge("Auto-merging References and determining conflicts.", progressMin,
			progressMax, monitor);
		totalChanges = 7;

		if (mergeManager != null) {
			latestResolvedSymbols = (LongLongHashtable) mergeManager
					.getResolveInformation(MergeConstants.RESOLVED_LATEST_SYMBOLS);
			myResolvedSymbols = (LongLongHashtable) mergeManager
					.getResolveInformation(MergeConstants.RESOLVED_MY_SYMBOLS);
			origResolvedSymbols = (LongLongHashtable) mergeManager
					.getResolveInformation(MergeConstants.RESOLVED_ORIGINAL_SYMBOLS);

			pickedLatestCodeUnits = (AddressSetView) mergeManager
					.getResolveInformation(MergeConstants.PICKED_LATEST_CODE_UNITS);
			pickedMyCodeUnits = (AddressSetView) mergeManager
					.getResolveInformation(MergeConstants.PICKED_MY_CODE_UNITS);
			pickedOriginalCodeUnits = (AddressSetView) mergeManager
					.getResolveInformation(MergeConstants.PICKED_ORIGINAL_CODE_UNITS);
		}
		updateProgressMessage("Setting references where code units were merged...");
		autoMergeWhereCodeUnitsMerged(monitor);
		incrementProgress(1);

		ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.REFERENCE_DIFFS);
		latestDetailSet = listingMergeMgr.diffOriginalLatest.getDifferences(filter, monitor);
		myDetailSet = listingMergeMgr.diffOriginalMy.getDifferences(filter, monitor);
		AddressSet tmpAutoSet = new AddressSet();
		AddressSet possibleConflicts = new AddressSet();
		MergeUtilities.adjustSets(latestDetailSet, myDetailSet, tmpAutoSet, possibleConflicts);

		// Ignore the code units that were automatically and manually merged
		// by CodeUnitMerger. References are already merged there.
		AddressSet mergedCodeUnits = listingMergeMgr.getMergedCodeUnits();
		tmpAutoSet.delete(mergedCodeUnits);
		possibleConflicts.delete(mergedCodeUnits);

		updateProgressMessage("Auto-merging references...");
		replaceReferences(tmpAutoSet, KEEP_MY, monitor);
		incrementProgress(1);

		updateProgressMessage("Finding reference conflicts...");
		determineChanges(possibleConflicts, monitor);
		incrementProgress(1);
	}
Constructs a reference merger.
@param listingMergeMgr the listing merge manager that owns this merger.
Ghidra/Features/Base/src/main/java/ghidra/app/merge/listing/ReferenceMerger.java