private void processComment(Map<String, Object> result) throws AddressFormatException {
		try {
			Address addr = getLocation(result);
			String typeStr = (String) result.get("kind");
			String comment = (String) result.get("value");
			boolean standard = (boolean) result.get("standard");
			CommentType commentType = getCommentType(typeStr);
			if (commentType == null) {
				log.appendMsg("Unknown comment type: " + typeStr);
				return;
			}
			if (standard) {
				CodeUnit cu = listing.getCodeUnitContaining(addr);
				if (cu != null) {
					// if a comment already exists, then merge...
					//
					String currCmt = cu.getComment(commentType);
					if (currCmt == null || currCmt.length() == 0) {
						cu.setComment(commentType, comment);
					}
					else if (currCmt.indexOf(comment) < 0) {
						log.appendMsg("Merged " + typeStr + " comment at " + addr);
						cu.setComment(commentType, currCmt + "\n" + comment);
					}
				}
			}
			else {
				String currCmt = listing.getComment(commentType, addr);
				if (currCmt == null || currCmt.length() == 0) {
					listing.setComment(addr, commentType, comment);
				}
				else if (currCmt.indexOf(comment) < 0) {
					log.appendMsg("Merged " + typeStr + " comment at " + addr);
					listing.setComment(addr, commentType, currCmt + "\n" + comment);
				}
			}
		}
		catch (Exception e) {
			log.appendException(e);
		}
	}
SARIF manager for all types of comments.
Ghidra/Features/Sarif/src/main/java/sarif/managers/CommentsSarifMgr.java