private void processExtLibraryReference(Map<String, Object> result, boolean overwrite) {
		try {
			Address addr = getLocation(result);
			if (addr == null) {
				throw new AddressFormatException("Incompatible External Reference Address");
			}
			int opIndex = CodeUnit.MNEMONIC;
			if (result.get("opIndex") != null) {
				opIndex = (int) (double) result.get("opIndex");
			}

			String namespacePath = (String) result.get("name");
			String label = (String) result.get("libLabel");
			String libAddress = (String) result.get("libAddr");
			Address libAddr = libAddress != null ? factory.getAddress(libAddress) : null;
			String libExtAddress = (String) result.get("libExtAddr");
			String origImport = (String) result.get("origImport");
			// boolean isClass = (boolean) result.get("isClass");
			boolean isFunction = (boolean) result.get("isFunction");

			if (label == null && libAddr == null) {
				log.appendMsg("External library reference for address " + addr
						+ " does not have a label or an external address specified. External reference will not be created");
				return;
			}
			CodeUnit cu = listing.getCodeUnitContaining(addr);
			if (cu == null) {
				log.appendMsg("No codeunit at " + addr);
				return;
			}
			Reference ref = cu.getExternalReference(opIndex);
			if (ref != null) {
				if (!overwrite) {
					return;
				}
				program.getReferenceManager().delete(ref);
			}

			RefType refType = null;
			String rt = (String) result.get("kind");
			if (rt != null) {
				int index = Integer.parseInt((String) result.get("index"));
				refType = getRefType(index);
			} else {
				refType = RefType.EXTERNAL_REF;
			}

			SourceType sourceType = getSourceType((String) result.get("sourceType"));
			ExternalLocation extLoc = externalMap.get(libExtAddress);
			if (extLoc == null) {
				extLoc = addExternal(label, namespacePath, libAddr, sourceType, origImport, isFunction);
				externalMap.put(libExtAddress, extLoc);
			}
			if (origImport != null && !origImport.equals(extLoc.getOriginalImportedName())) {
				log.appendMsg("Retrieving incorrect external location - known bug");
			}
			refManager.addExternalReference(addr, opIndex, extLoc, sourceType, refType);
		} catch (Exception e) {
			log.appendException(e);
		}
	}
@param result
@param language
@param overwrite
Ghidra/Features/Sarif/src/main/java/sarif/managers/MarkupSarifMgr.java