@Override
	public void setName(String name) throws DuplicateNameException {
		lock.acquire();
		try {
			checkDeleted();
			if (key == ModuleManager.ROOT_MODULE_ID) {
				moduleMgr.getProgram().setName(name);
				return;
			}
			DBRecord r = moduleAdapter.getModuleRecord(name);
			if (r != null) {
				if (key != r.getKey()) {
					throw new DuplicateNameException(name + " already exists");
				}
				return; // no changes
			}
			if (fragmentAdapter.getFragmentRecord(name) != null) {
				throw new DuplicateNameException(name + " already exists");
			}
			String oldName = record.getString(ModuleDBAdapter.MODULE_NAME_COL);
			record.setString(ModuleDBAdapter.MODULE_NAME_COL, name);
			moduleAdapter.updateModuleRecord(record);
			moduleMgr.nameChanged(oldName, this);
		}
		catch (IOException e) {
			moduleMgr.dbError(e);
		}
		finally {
			lock.release();
		}
	}
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