private BookmarkTypeDB getBookmarkType(String type, boolean create) throws IOException {
		BookmarkTypeDB bmt = (BookmarkTypeDB) typesByName.get(type);
		if (bmt == null) {
			int typeId = findNextTypeId();
			bmt = new BookmarkTypeDB(typeId, type);
			typesByName.put(type, bmt);
			typesArray.put(typeId, bmt);
		}
		if (create && !bmt.hasBookmarks()) {
			bookmarkTypeAdapter.addType(bmt.getTypeId(), bmt.getTypeString());
			bmt.setHasBookmarks(true);
			bookmarkAdapter.addType(bmt.getTypeId());

			// fire event
			program.setObjChanged(ProgramEvent.BOOKMARK_TYPE_ADDED, bmt, null, null);

		}
		return bmt;
	}
Update stored bookmark and fire program change event for a bookmark which has
had its category or comment changed.  All other fields are immutable.
@param bm bookmark
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/bookmark/BookmarkDBManager.java