private void refreshTreeMap(boolean ignoreModificationNumber) throws IOException {
		Map<String, ModuleManager> oldTreeMap = treeMap;
		treeMap = new HashMap<>();

		RecordIterator iter = treeAdapter.getRecords();
		while (iter.hasNext()) {
			DBRecord rec = iter.next();
			long key = rec.getKey();
			String treeName = rec.getString(ProgramTreeDBAdapter.TREE_NAME_COL);
			long modNumber = rec.getLongValue(ProgramTreeDBAdapter.MODIFICATION_NUM_COL);
			ModuleManager mm = oldTreeMap.get(treeName);
			if (mm != null) {
				oldTreeMap.remove(treeName);
				if (mm.getTreeID() == key) {
					if (ignoreModificationNumber || mm.getModificationNumber() != modNumber) {
						mm.invalidateCache();
					}
				}
				else {
					mm.invalidateCache();
					mm = null;
				}
			}
			if (mm == null) {
				try {
					mm = new ModuleManager(this, rec, OpenMode.UPDATE, TaskMonitor.DUMMY);
				}
				catch (VersionException | CancelledException e) {
					throw new RuntimeException(e); // unexpected exception
				}
			}
			treeMap.put(treeName, mm);
		}
		Iterator<String> it = oldTreeMap.keySet().iterator();
		while (it.hasNext()) {
			ModuleManager mm = oldTreeMap.get(it.next());
			mm.invalidateCache();
		}
	}
Re-Populate the map with existing tree views following an invalidation (e.g., undo, redo, memory movement).
@param ignoreModificationNumber if true all existing module managers will be invalidated, otherwise 
only those module managers whose modification number does not match the corresponding tree modification
number will be invalidated.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/module/TreeManager.java