** overrides from ResolverHookFactory ****
162335
@Override
    public ResolverHook begin(Collection<BundleRevision> triggers) {
        ResolverHook hook = null;
        // Only return hook if resolve is on behalf of the thread that started this handler;
        if (_resolvingThread == Thread.currentThread().getId()) {
            hook = this;
        }
        return hook;
    }
395845
public static void resolve(Map<String, String> env) {
		for (Map.Entry<String,String> entry: env.entrySet()) {
			entry.setValue(Util.replaceMacro(entry.getValue(), env));
		}
	}
261404
function resolveReferences() {

    var elementsById = context.elementsById;
    var references = context.references;

    var i, r;

    for (i = 0; (r = references[i]); i++) {
      var element = r.element;
      var reference = elementsById[r.id];
      var property = getModdleDescriptor(element).propertiesByName[r.property];

      if (!reference) {
        context.addWarning({
          message: 'unresolved reference <' + r.id + '>',
          element: r.element,
          property: r.property,
          value: r.id
        });
      }

      if (property.isMany) {
        var collection = element.get(property.name),
            idx = collection.indexOf(r);

        // we replace an existing place holder (idx != -1) or
        // append to the collection instead
        if (idx === -1) {
          idx = collection.length;
        }

        if (!reference) {
          // remove unresolvable reference
          collection.splice(idx, 1);
        } else {
          // add or update reference in collection
          collection[idx] = reference;
        }
      } else {
        element.set(property.name, reference);
      }
    }
  }
1284766
AbstractConfigValue resolveCheckingReplacement(ResolveContext context,
            AbstractConfigValue original) throws NotPossibleToResolve {
        AbstractConfigValue replacement;

        replacement = replacement(context, original);

        if (replacement != original) {
            // start over, checking if replacement was memoized
            return context.resolve(replacement);
        } else {
            AbstractConfigValue resolved;

            resolved = original.resolveSubstitutions(context);

            return resolved;
        }
    }
520355
private static void applyOverrides() {
        // Get the appropriate InputStream to read overrides from, if any.
        InputStream stream = getContentTypesPropertiesStream();
        if (stream == null) {
            return;
        }

        try {
            try {
                // Read the properties file...
                Properties overrides = new Properties();
                overrides.load(stream);
                // And translate its mapping to ours...
                for (Map.Entry<Object, Object> entry : overrides.entrySet()) {
                    String extension = (String) entry.getKey();
                    String mimeType = (String) entry.getValue();
                    add(mimeType, extension);
                }
            } finally {
                stream.close();
            }
        } catch (IOException ignored) {
        }
    }
1108509
private void fixResolverVisMapTable(String toplevelCorpus, String table)
  {
    log.info("checking resolver_vis_map for errors");

    // delete all entries that reference a different corpus than the imported one
    int invalidRows = getJdbcTemplate().update("DELETE FROM " + table
      + " WHERE corpus <> ?", toplevelCorpus);
    if (invalidRows > 0)
    {
      log.warn("there were " + invalidRows
        + " rows in the resolver_vis_map that referenced the wrong corpus");
    }

  }
891080
def resolve_any_xref(self, env, fromdocname, builder, target,
                         node, contnode):
        
        modname = node.get('chpl:module')
        clsname = node.get('chpl:class')
        results = []

        # Always search in "refspecific" mode with the :any: role.
        matches = self.find_obj(env, modname, clsname, target, None, 1)
        for name, obj in matches:
            if obj[1] == 'module':
                results.append(('chpl:mod',
                                self._make_module_refnode(builder, fromdocname,
                                                          name, contnode)))
            else:
                results.append(
                    ('chpl:' + self.role_for_objtype(obj[1]),
                     make_refnode(builder, fromdocname, obj[0], name,
                                  contnode, name)))

        return results
548682
@Override
    protected Class resolveClass(ObjectStreamClass classDesc) throws IOException, ClassNotFoundException {
        for (ClassLoader loader : classLoaderRegistration) {
            try {
                return resolveClass(classDesc, loader);
            } catch (ClassNotFoundException e) {
                // ignore
            }
        }
        return super.resolveClass(classDesc);
    }
439104
function Resolver(options)
	{
		if (!(this instanceof Resolver))
			return new Resolver(options);

		Logger.mixin(this, options);

		options = this.options = setProperties({}, this.options, options);

		this._cache = {};
		this._manifestCache = {};

		this._core = {};
		this._extensions = new PriorityList();
		this._manifests = new PriorityList();
		this._prefixes = new PriorityList(function(a, b)
		{
			return a.value === b.value;
		});

		this._group("Resolver Initialize", null, function()
		{
			this._initGet();
			this._initRoot();
			this._initCore();
			this._initExtension();
			this._initPrefix();
			this._initManifest();

			this._initAllowExtensionless(options.allowExtensionless);
		});
	}
1353243
@Override
    public void resolveForTable(Table table) {
        assert(table != null);
        // It MAY be that for the case in which this function is called (expression indexes), the column's
        // table name is not specified (and not missed?).
        // It is possible to "correct" that here by cribbing it from the supplied table (base table for the index)
        // -- not bothering for now.
        Column column = table.getColumns().getExact(m_columnName);
        assert(column != null);
        m_tableName = table.getTypeName();
        m_columnIndex = column.getIndex();
        setTypeSizeAndInBytes(column);
    }
1344159
function resolveContext (emitter, context, storageKey) {
  // TODO: clean up - try to use internal context resolve more on no
  // use the one from on (resolve)
  // figure out why we cant use resolveContextSet since thats what it is
  if (context) {
    // this is lame stuff! should be in observable in some way...
    let base = emitter.parent.parent
    let type = emitter.key
    let setObj = { on: {} }
    setObj.on[type] = {}
    // base = base.set(setObj) // .on[type]
    emitter = (base.set(setObj) || base)._on[type]
  }
  if (!emitter.hasOwnProperty(storageKey)) {
    emitter.setKey(storageKey, {}, false)
  }
  return emitter
}
1018753
public static void applyXXEProtection(DocumentBuilderFactory factory) {
		Map<String, Boolean> features = new HashMap<String, Boolean>();
		features.put("http://apache.org/xml/features/disallow-doctype-decl", true);
		features.put("http://xml.org/sax/features/external-general-entities", false);
		features.put("http://xml.org/sax/features/external-parameter-entities", false);
		features.put("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);

		for (Map.Entry<String, Boolean> entry : features.entrySet()) {
			String feature = entry.getKey();
			Boolean value = entry.getValue();
			try {
				factory.setFeature(feature, value);
			} catch (ParserConfigurationException e) {
				//feature is not supported by the local XML engine, skip it
			}
		}

		factory.setXIncludeAware(false);
		factory.setExpandEntityReferences(false);
	}
356347
@Override
    public InputSource resolveEntity(String publicId, String systemId) {
        logger.debug("CMLResolver: resolving ", publicId, ", ", systemId);
        systemId = systemId.toLowerCase();
        if ((systemId.indexOf("cml-1999-05-15.dtd") != -1) || (systemId.indexOf("cml.dtd") != -1)
                || (systemId.indexOf("cml1_0.dtd") != -1)) {
            logger.info("File has CML 1.0 DTD");
            return getCMLType("cml1_0.dtd");
        } else if ((systemId.indexOf("cml-2001-04-06.dtd") != -1) || (systemId.indexOf("cml1_0_1.dtd") != -1)
                || (systemId.indexOf("cml_1_0_1.dtd") != -1)) {
            logger.info("File has CML 1.0.1 DTD");
            return getCMLType("cml1_0_1.dtd");
        } else {
            logger.warn("Could not resolve systemID: ", systemId);
            return null;
        }
    }
1025177
public void setTypeResolver(RelationshipResolver resolver, Class<?> type) {
		if (resolver != null) {
			String typeName = ReflectionUtils.getTypeName(type);

			if (typeName != null) {
				typedResolvers.put(type, resolver);
			}
		}
	}
175656
def resolve_any_xref(self, env, fromdocname, builder, target,
                         node, contnode):
        
        prefix = node.get('dn:prefix')
        results = []

        match = self.find_obj(env, prefix, target, None, 1)
        if match is not None:
            (name, obj) = match
            results.append(('dn:' + self.role_for_objtype(obj[1]),
                            make_refnode(builder, fromdocname, obj[0], name, contnode,
                                         name)))
        return results
1339346
def resolving(self, ref):
        
        # print u"resol_scope: %s, ref: %s" % (self.resolution_scope, ref)
        full_uri = urljoin(self.resolution_scope, ref)
        uri, fragment = urldefrag(full_uri)
        if not uri:
            uri = self.base_uri

        if uri in self.store:
            document = self.store[uri]
        else:
            if (uri.startswith(u"file") or uri.startswith(u"File")):
                try:
                    document = self.resolve_local(full_uri, self.resolution_scope, ref)
                except Exception as exc:
                    raise RefResolutionError(exc)
            else:

                try:
                    document = self.resolve_remote(uri)
                except Exception as exc:
                    raise RefResolutionError(exc)

        old_base_uri, self.base_uri = self.base_uri, uri
        try:
            with self.in_scope(uri):
                yield self.resolve_fragment(document, fragment)
        finally:
            self.base_uri = old_base_uri
306520
function(overrides) { 
      var result = this.cache;
      if(!result) {
        result = construct(type, functionParameters(type).map(function(paramName) {
          return self.resolve(paramName, overrides);
        }));
      }
      if(doCache) {
        this.cache = result;
      }
      return result;
    }