@Override
	public final boolean applyTo(Program program) {
		if (program != function.getProgram()) {
			throw new AssertionError("Program instance mismatch");
		}
		String name = null;
		try {
			Parameter param = getParameter(program);
			name = param.getName();
			if (function.insertParameter(ordinal, param, source) == null) {
				statusMessage = "Create parameter failed";
				return false;
			}
		}
		catch (DuplicateNameException e) {
			statusMessage = "Parameter named " + name + " already exists";
			return false;
		}
		catch (Exception exc) {
			Throwable cause = exc.getCause();
			if (cause != null) {
				statusMessage = cause.getMessage();
				if (statusMessage == null) {
					statusMessage = cause.getClass().getName();
				}
			}
			else {
				statusMessage = exc.getMessage();
				if (statusMessage == null) {
					statusMessage = exc.getClass().getName();
				}
			}
			return false;
		}

		return true;
	}
Get parameter to be added
@param program target program
@return parameter to be added
@throws InvalidInputException if unable to generate parameter due to invalid data
Ghidra/Features/Base/src/main/java/ghidra/app/cmd/function/AddParameterCommand.java