@SuppressWarnings("unchecked")
	private void processTree(Map<String, Object> result) throws CancelledException {
		treeName = (String) result.get("name");

		ProgramModule root = listing.getRootModule(treeName);
		try {
			try {
				if (root == null) {
					root = listing.createRootModule(treeName);
				}
				String name = root.getName();
				if (name.endsWith(".sarif")) {
					name = name.substring(0, name.indexOf(".sarif"));
				}
				if (name.endsWith(".json")) {
					name = name.substring(0, name.indexOf(".json"));
				}
				root.setName(name);
			} catch (DuplicateNameException dne) {
				// if name already existed, then attempt to create a
				// unique "one-up" name
				//
				int oneUp = 1;
				while (true) {
					try {
						root = listing.createRootModule(treeName + "(" + oneUp + ")");
						break; // we located a unique name...
					} catch (DuplicateNameException e) {
						++oneUp;
					}
				}
				treeName = root.getTreeName();
			}

			Set<AddressRange> ranges = new HashSet<>();
			List<Map<String, Object>> fragments =
				(List<Map<String, Object>>) result.get("fragments");
			for (Map<String, Object> f : fragments) {
				try {
					collectFragmentRanges(ranges, f);
				}
				catch (Exception e) {
					log.appendMsg(e.getMessage());
				}
			}
				
			ProgramFragment depot = root.createFragment("depot");
			for (AddressRange r : ranges) {
				depot.move(r.getMinAddress(), r.getMaxAddress());
			}
			removeEmptyFragments(root);

			List<Map<String, Object>> modules = (List<Map<String, Object>>) result.get("modules");
			for (Map<String, Object> m : modules) {
				monitor.checkCancelled();
				processModule(root, m);
			}
			for (Map<String, Object> f : fragments) {
				monitor.checkCancelled();
				processFragment(root, f);
			}
			root.removeChild("depot");
		}
		catch (NotFoundException | DuplicateNameException | NotEmptyException e) {
			log.appendException(e);
		}
	}
Constructor

@param program program
@param log     message log
Ghidra/Features/Sarif/src/main/java/sarif/managers/ProgramTreeSarifMgr.java