@Override
	public GhidraClass convertNamespaceToClass(Namespace namespace) {

		if (namespace instanceof GhidraClass) {
			return (GhidraClass) namespace;
		}

		lock.acquire();
		try {

			checkValidNamespaceArgument(namespace);

			if (namespace.isGlobal() || namespace.isLibrary()) {
				throw new IllegalArgumentException(
					"May not convert namespace to class: " + namespace.getName(true));
			}

			Symbol namespaceSymbol = namespace.getSymbol();
			String name = namespaceSymbol.getName();
			SourceType originalSource = namespaceSymbol.getSource();

			// no duplicate check, since this class name will be set to that of the existing namespace
			String tempName = "_temp_" + System.nanoTime();
			ClassSymbol classSymbol = createClassSymbol(tempName, namespace.getParentNamespace(),
				originalSource, false /*check for duplicate */);
			GhidraClassDB classNamespace = new GhidraClassDB(classSymbol, namespaceMgr);

			// move everything from old namespace into new class namespace
			for (Symbol s : getSymbols(namespace)) {

				// no duplicate check, since these symbols all lived under the existing namespace
				((SymbolDB) s).doSetNameAndNamespace(s.getName(), classNamespace, s.getSource(),
					false /*check for duplicate */);
			}

			namespaceSymbol.delete();

			// fix name now that the old namespace is deleted
			classNamespace.setName(name, SourceType.ANALYSIS, false /*check for duplicate */);

			return classNamespace;
		}
		catch (DuplicateNameException | InvalidInputException | CircularDependencyException e) {
			throw new AssertException(
				"Unexpected exception creating class from namespace: " + e.getMessage(), e);
		}
		finally {
			lock.release();
		}
	}
Creates variable symbols.
<p>
Note this is not a method defined in the Symbol Table interface. It is intended to be used by
Ghidra program internals.

@param name the name of the variable
@param function the function that contains the variable.
@param type the type of the variable (can only be PARAMETER or LOCAL_VAR)
@param firstUseOffsetOrOrdinal the offset in the function where the variable is first used.
@param storage the VariableStorage (stack, registers, etc.)
@param source the symbol source type (user defined, analysis, etc.)
@return the new VariableSymbol that was created.
@throws DuplicateNameException if there is another variable in this function with that name.
@throws InvalidInputException if the name contains illegal characters (space for example)
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/symbol/SymbolManager.java