@Override
	public void reparent(String name, ProgramModule oldParent) throws NotFoundException {

		Group group = null;
		ProgramFragment f = null;

		lock.acquire();
		try {
			checkDeleted();
			long childID;
			ProgramModule m = moduleMgr.getModule(name);
			if (m == null) {
				f = moduleMgr.getFragment(name);
				if (f == null) {
					throw new NotFoundException(name + " was not found as child of " + getName());
				}
				childID = -((FragmentDB) f).getKey();
				group = f;
			}
			else {
				childID = ((ModuleDB) m).key;
				group = m;
			}
			ModuleDB oldModuleDB = (ModuleDB) oldParent;

			DBRecord oldPcRec = parentChildAdapter.getParentChildRecord(oldModuleDB.key, childID);
			parentChildAdapter.removeParentChildRecord(oldPcRec.getKey());
			oldModuleDB.updateChildCount(-1);

			DBRecord newPcRec = parentChildAdapter.addParentChildRecord(key, childID);
			updateChildCount(1);
			updateOrderField(newPcRec, childCount - 1);

			oldModuleDB.resetChildOrder();

			moduleMgr.childReparented(group, oldParent.getName(), getName());
		}
		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