@Override
	public boolean applyTo(Program program) {

		SymbolTable symTable = program.getSymbolTable();
		Listing listing = program.getListing();
		boolean offCutExists = false;

		for (CodeUnitInfo info : infoList) {
			Address a = startAddr.add(info.getIndex());
			CodeUnit cu = listing.getCodeUnitAt(a);
			if (cu == null) {
				offCutExists = true;
				continue;
			}
			if (pasteLabels) {
				setFunction(listing, a, info);
				setLabel(listing, symTable, a, info);
			}
			if (pasteComments) {
				setComments(cu, a, info);
			}
		}

		if (offCutExists) {
			messages.append(
				"Could not paste some comments/labels - address not start of code unit");
			return false;
		}

		if (messages.length() != 0) {
			return false;
		}

		return true;
	}
The name of the edit action.
Ghidra/Features/Base/src/main/java/ghidra/app/cmd/comments/CodeUnitInfoPasteCmd.java