private boolean tryToSetNames(Function toFunction, boolean doNotReplaceWithDefaultNames,
			VTMatchApplyChoices.SourcePriorityChoices parameterNamesChoice,
			VTMatchApplyChoices.HighestSourcePriorityChoices highestPriorityChoice,
			boolean replaceSamePriorityNames, int minParameterCount)
			throws VersionTrackingApplyException {

		boolean duplicateNameOccurred = false;
		int paramCnt = parameterInfos.size();
		for (int i = 0; i < paramCnt; i++) {
			// Check the name against the options to see when we should set the name.
			ParameterInfo parameterInfo = parameterInfos.get(i);
			String fromName = parameterInfo.name;
			SourceType fromSource = parameterInfo.source;
			boolean fromIsDefaultName = (fromSource == SourceType.DEFAULT) || (fromName == null);
			Parameter toParameter = toFunction.getParameter(i);
			SourceType toSource = toParameter.getSource();
			String toName = (toSource != SourceType.DEFAULT) ? toParameter.getName() : null;
			boolean toIsDefaultName = (toSource == SourceType.DEFAULT) || (toName == null);
			if (fromIsDefaultName && (doNotReplaceWithDefaultNames || toIsDefaultName)) {
				continue;
			}
			if (SystemUtilities.isEqual(fromName, toName)) {
				continue;
			}
			if (i < minParameterCount) {
				switch (parameterNamesChoice) {
					case PRIORITY_REPLACE:
						if (highestPriorityChoice == HighestSourcePriorityChoices.IMPORT_PRIORITY_HIGHEST) {
							// Import, User, Analysis, Default.
							if (!isFirstHigherPriorityWhenImportedPriority(fromSource, toSource,
								replaceSamePriorityNames)) {
								continue;
							}
						}
						else {
							// User, Import, Analysis, Default.
							if (!isFirstHigherPriorityWhenUserPriority(fromSource, toSource,
								replaceSamePriorityNames)) {
								continue;
							}
						}
						break;
					case REPLACE_DEFAULTS_ONLY:
						if (!toIsDefaultName || fromIsDefaultName) {
							continue;
						}
						break;
					case REPLACE:
						// Always replace since defaults get handled by "if" before this "switch".
						break;
					case EXCLUDE:
					default:
						continue;
				}
			}

			try {
				toParameter.setName(fromName, fromSource);
			}
			catch (DuplicateNameException e) {
				SymbolTable symbolTable = toFunction.getProgram().getSymbolTable();
				String uniqueParameterName =
					getUniqueParameterName(symbolTable, toFunction, fromName);
				try {
					toParameter.setName(uniqueParameterName, fromSource);
					duplicateNameOccurred = true;
				}
				catch (DuplicateNameException e1) {
					throw new VersionTrackingApplyException(e1.getMessage(), e1);
				}
				catch (InvalidInputException e1) {
					throw new VersionTrackingApplyException(e1.getMessage(), e1);
				}
			}
			catch (InvalidInputException e) {
				throw new VersionTrackingApplyException(e.getMessage(), e);
			}
		}
		return duplicateNameOccurred;
	}
@param toFunction the function whose parameter names we are setting.
@param markupOptions
@param doNotReplaceWithDefaultNames flag indicating whether or not a parameter name can be
replaced with a default name.
@param originalToParamCount original number of parameters in toFunction
@throws VersionTrackingApplyException
Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/api/stringable/FunctionSignatureStringable.java