@Override
	public ProgramModule createModule(String moduleName) throws DuplicateNameException {

		lock.acquire();
		try {
			checkDeleted();
			if (moduleAdapter.getModuleRecord(moduleName) != null ||
				fragmentAdapter.getFragmentRecord(moduleName) != null) {
				throw new DuplicateNameException(moduleName + " already exists");
			}

			DBRecord moduleRecord = moduleAdapter.createModuleRecord(key, moduleName);
			DBRecord pcRec = parentChildAdapter.addParentChildRecord(key, moduleRecord.getKey());

			ModuleDB moduleDB = moduleMgr.getModuleDB(moduleRecord);
			updateChildCount(1);
			updateOrderField(pcRec, childCount - 1);
			moduleMgr.moduleAdded(key, moduleDB);
			return moduleDB;
		}
		catch (IOException e) {
			moduleMgr.dbError(e);
		}
		finally {
			lock.release();
		}
		return null;
	}
Constructor
@param moduleMgr module manager
@param cache ModuleDB cache
@param record database record for this module
@throws IOException if database IO error occurs
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/module/ModuleDB.java