@Override
	public void setName(Namespace namespace, String newName, SourceType sourceType)
			throws InvalidInputException {

		try {
			if (!namespace.isExternal()) {
				throw new IllegalArgumentException("external namespace required");
			}
			if (newName == null || newName.length() == 0) {
				sourceType = SourceType.DEFAULT;
				String originalName = getOriginalImportedName();
				if (originalName != null) {
					newName = originalName;
					namespace = NamespaceUtils.getLibrary(namespace);
					sourceType = SourceType.IMPORTED;
				}
				else if (getAddress() == null) {
					throw new InvalidInputException(
						"Either an external label or address is required");
				}
			}
			else if (namespace instanceof Library && newName.equals(getOriginalImportedName())) {
				// preserve imported source if new name matches original imported name
				sourceType = SourceType.IMPORTED;
			}
			symbol.setNameAndNamespace(newName, namespace, sourceType);
		}
		catch (DuplicateNameException | CircularDependencyException e) {
			// Duplicate names are permitted and external locations do not support namespace behavior
			throw new AssertException("Unexpected exception", e);
		}
	}
Set the label and optional namespace associated with an external location.
Any non-existing namespace will be created as a simple namespace within the associated
library.
@param label external location label.  The label may be qualified with a namespace
and best effort will be used to parse it (see {@link SymbolPath}).
If a namespace is not included within label, the current namespace will be preserved.
@param source the source of this external symbol:
Symbol.DEFAULT, Symbol.ANALYSIS, Symbol.IMPORTED, or Symbol.USER_DEFINED
@throws InvalidInputException if the name contains illegal characters (space for example)
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/external/ExternalLocationDB.java