@Override
	public Variable[] getVariables(VariableFilter filter) {
		manager.lock.acquire();
		try {
			checkIsValid();
			if (thunkedFunction != null) {
				Variable[] variables =
					thunkedFunction.getVariables(new ThunkVariableFilter(filter));
				return adjustThunkThisParameter(variables);
			}
			loadVariables();
			ArrayList<Variable> list = new ArrayList<>();
			if (autoParams != null) {
				for (AutoParameterImpl p : autoParams) {
					if (filter == null || filter.matches(p)) {
						list.add(p);
					}
				}
			}
			for (ParameterDB p : params) {
				if (filter == null || filter.matches(p)) {
					list.add(p);
				}
			}
			for (VariableDB var : locals) {
				if (filter == null || filter.matches(var)) {
					list.add(var);
				}
			}
			Variable[] vars = new Variable[list.size()];
			return list.toArray(vars);
		}
		finally {
			manager.lock.release();
		}
	}
Adjust the specified parameter for a thunk function if required.
This method will return a newly minted this auto-param if required
to reflect the overriden name and class within which this thunk
resides.
@param parameter thunk parameter
@return an adjusted auto-parameter or the original parameter
if no adjustment was required
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/function/FunctionDB.java