public void setComment(Lifespan lifespan, Address address, CommentType commentType,
			String comment) {
		if (commentType == null) {
			throw new IllegalArgumentException("null commentType");
		}
		String oldValue = null;
		try (LockHold hold = LockHold.lock(lock.writeLock())) {
			for (DBTraceCommentEntry entry : reduce(TraceAddressSnapRangeQuery
					.intersecting(new AddressRangeImpl(address, address), lifespan)).values()) {
				if (entry.type == commentType.ordinal()) {
					if (entry.getLifespan().contains(lifespan.lmin())) {
						oldValue = entry.comment;
					}
					makeWay(entry, lifespan);
				}
			}
			if (comment != null) {
				DBTraceCommentEntry entry = put(address, lifespan, null);
				entry.set((byte) commentType.ordinal(), comment);
			}
		}
		trace.setChanged(new TraceChangeRecord<TraceAddressSnapRange, String>(
			TraceEvents.byCommentType(commentType),
			DBTraceSpaceKey.create(address.getAddressSpace(), null, 0),
			new ImmutableTraceAddressSnapRange(address, lifespan), oldValue, comment));
	}
Set a comment at the given address for the given lifespan

@param lifespan the lifespan
@param address the address
@param commentType the type of comment as in {@link Listing#setComment(Address, int, String)}
@param comment the comment
Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/listing/DBTraceCommentAdapter.java