public void mergeCommentType(AddressSetView originAddressSet, int type, int setting,
			TaskMonitor monitor) throws CancelledException {
		if ((setting != ProgramMergeFilter.REPLACE) && (setting != ProgramMergeFilter.MERGE)) {
			return;
		}

		String typeStr = "Unknown";
		CommentType cuCommentType;
		switch (type) {
			case ProgramMergeFilter.PLATE_COMMENTS:
				typeStr = "Plate";
				cuCommentType = CommentType.PLATE;
				break;
			case ProgramMergeFilter.PRE_COMMENTS:
				typeStr = "Pre";
				cuCommentType = CommentType.PRE;
				break;
			case ProgramMergeFilter.EOL_COMMENTS:
				typeStr = "EOL";
				cuCommentType = CommentType.EOL;
				break;
			case ProgramMergeFilter.REPEATABLE_COMMENTS:
				typeStr = "Repeatable";
				cuCommentType = CommentType.REPEATABLE;
				break;
			case ProgramMergeFilter.POST_COMMENTS:
				typeStr = "Post";
				cuCommentType = CommentType.POST;
				break;
			default:
				throw new AssertException("Unsupported comment type: " + type);
		}

		monitor.setMessage("Applying " + typeStr + " comments...");
		if (originAddressSet.isEmpty()) {
			return;
		}

		monitor.checkCancelled();

		boolean both = (setting == ProgramMergeFilter.MERGE) ? true : false;
		String prefix = both ? "Merging" : "Replacing";
		AddressIterator addrIter = originAddressSet.getAddresses(true);
		for (long count = 0; addrIter.hasNext(); count++) {
			monitor.checkCancelled();
			Address originAddress = addrIter.next();
			if (count == PROGRESS_COUNTER_GRANULARITY) {
				monitor.setMessage(
					prefix + " " + typeStr + " comments...   " + originAddress.toString(true));
				count = 0;
			}
			// Determine where to get the Comments from.
			if (both) {
				mergeComments(cuCommentType, originAddress);
			}
			else {
				replaceComment(cuCommentType, originAddress);
			}
		}
	}
<CODE>mergeCommentType</CODE> merges/replaces comments of the indicated
type wherever they occur in the specified address set.
It merges them from program2 into program1.
This merges eol, pre, post, repeatable, and plate comments.

@param originAddressSet the addresses to be merged.
The addresses in this set should be derived from the origin program.
@param type the comment type. PLATE, PRE, EOL, REPEATABLE, POST
@param setting how to merge. IGNORE, REPLACE, MERGE
@param monitor the task monitor for notifying the user of this merge's progress.
@throws CancelledException if user cancels via the monitor.
Ghidra/Features/Base/src/main/java/ghidra/program/util/ProgramMerge.java