Resolve an appropriate implicit this instance for t's container.
JLS 8.8.5.1 and 15.9.2
490400
Type resolveImplicitThis(DiagnosticPosition pos, Env<AttrContext> env, Type t) {
        return resolveImplicitThis(pos, env, t, false);
    }
1069771
public void eInit(SarlScript script, String name, IJvmTypeProvider context) {
		setTypeResolutionContext(context);
		if (this.sarlClass == null) {
			this.container = script;
			this.sarlClass = SarlFactory.eINSTANCE.createSarlClass();
			script.getXtendTypes().add(this.sarlClass);
			this.sarlClass.setAnnotationInfo(XtendFactory.eINSTANCE.createXtendTypeDeclaration());
			if (!Strings.isEmpty(name)) {
				this.sarlClass.setName(name);
			}
		}
	}
33228
@FFDCIgnore({ NamingException.class })
    @Sensitive
    Object resolveObject(Object o, WSName subname) throws NamingException {
        ServiceReference<?> ref = null;
        try {
            if (o instanceof ContextNode)
                return new WSContext(userContext, (ContextNode) o, env);

            if (tc.isDebugEnabled())
                Tr.debug(tc, "Resolving object", o);

            if (o instanceof ServiceReference) {
                ref = (ServiceReference<?>) o;
                if (tc.isDebugEnabled())
                    Tr.debug(tc, "External service registry entry.");
            } else if (o instanceof AutoBindNode) {
                if (tc.isDebugEnabled())
                    Tr.debug(tc, "AutoBindNode entry.");
                AutoBindNode abNode = (AutoBindNode) o;
                ref = (ServiceReference<?>) abNode.getLastEntry();
                // null means the node was removed in another thread.
                if (ref == null) {
                    // Use the same semantics as ContextNode.lookup.
                    throw new NameNotFoundException(subname.toString());
                }
            } else if (o instanceof ServiceRegistration) {
                ref = ((ServiceRegistration<?>) o).getReference();
                if (tc.isDebugEnabled())
                    Tr.debug(tc, "Programmatic JNDI entry.");
            }

            boolean getObjectInstance;
            if (ref == null) {
                getObjectInstance = true;
            } else {
                o = getReference(userContext, ref);
                if (o == null) {
                    throw new NamingException(Tr.formatMessage(tc, "jndi.servicereference.failed", subname.toString()));
                }

                Object origin = ref.getProperty(JNDIServiceBinder.OSGI_JNDI_SERVICE_ORIGIN);
                if (tc.isDebugEnabled())
                    Tr.debug(tc, "Retrieved service from registry", o,
                             JNDIServiceBinder.OSGI_JNDI_SERVICE_ORIGIN + "=" + origin,
                             Constants.OBJECTCLASS + "=" + Arrays.toString((String[]) ref.getProperty(Constants.OBJECTCLASS)));
                getObjectInstance = JNDIServiceBinder.OSGI_JNDI_SERVICE_ORIGIN_VALUE.equals(origin) ||
                                    contains((String[]) ref.getProperty(Constants.OBJECTCLASS), Reference.class.getName());
            }

            if (getObjectInstance) {
                // give JNDI a chance to resolve any references
                try {
                    Object oldO = o;
                    o = NamingManager.getObjectInstance(o, subname, this, env);
                    if (o != oldO)
                        if (tc.isDebugEnabled())
                            Tr.debug(tc, "Resolved object through NamingManager"); // remove logging object o since it might contain the sensitive information.
                } catch (NamingException e) {
                    throw e;
                } catch (Exception e) {
                    // FFDC and proceed
                }
            }
            return o;
        } catch (NamingException e) {
            throw e;
        } catch (Exception e) {
            NamingException ne = new NamingException();
            ne.setRootCause(e);
            throw ne;
        }
    }
808274
@SuppressWarnings("unchecked")
	private static <E> TypeSerializerSchemaCompatibility<E> resolveCompatibility(
			TypeSerializer<?> serializer,
			TypeSerializerSnapshot<?> snapshot) {

		TypeSerializer<E> typedSerializer = (TypeSerializer<E>) serializer;
		TypeSerializerSnapshot<E> typedSnapshot = (TypeSerializerSnapshot<E>) snapshot;

		return typedSnapshot.resolveSchemaCompatibility(typedSerializer);
	}
690064
def resolve(accessor: hexdi.core.clstype) -> __gentype__.T:
    
    return hexdi.core.get_root_container().resolve(accessor=accessor)
547743
private static <CT, I> Function<CT, I> resolveAndExtend(
		Class<CT> contextType,
		List<MethodResolver<CT>> resolvers,
		Class<I> typeToExtend)
	{
		// Resolve generics
		ResolvedTypeWithMembers withMembers = Types.resolveMembers(typeToExtend);

		Map<Method, MethodInvocationHandler<CT>> handlers = new HashMap<>();
		try
		{
			// Go through methods and create invokers for each of them
			for(ResolvedMethod method : withMembers.getMemberMethods())
			{
				// Only try to implement abstract methods
				if(! method.isAbstract()) continue;

				// Create an encounter and let the first method resolver that matches handle the method
				boolean foundInvoker = false;
				MethodEncounter encounter = new MethodEncounterImpl(method);
				for(MethodResolver<CT> resolver : resolvers)
				{
					Optional<MethodInvocationHandler<CT>> opt = resolver.create(encounter);
					if(opt.isPresent())
					{
						// This resolver created an invoker to use
						foundInvoker = true;
						handlers.put(method.getRawMember(), opt.get());
						break;
					}
				}

				if(! foundInvoker)
				{
					// No invoker was found, can not handle the method
					throw new ProxyException("The method " + method.getName() + " could not be handled");
				}
			}
		}
		catch(ProxyException e)
		{
			throw new ProxyException(typeToExtend.getName() + ":\n" + e.getMessage());
		}
		catch(Exception e)
		{
			throw new ProxyException(typeToExtend.getName() + ":\n" + e.getMessage(), e);
		}

		return createFunction(contextType, typeToExtend, Collections.unmodifiableMap(handlers));
	}
317113
@Override
    ResolveResult<? extends AbstractConfigValue> resolveSubstitutions(ResolveContext context, ResolveSource source) {
        ResolveContext newContext = context.addCycleMarker(this);
        AbstractConfigValue v;
        try {
            ResolveSource.ResultWithPath resultWithPath = source.lookupSubst(newContext, expr, prefixLength);
            newContext = resultWithPath.result.context;

            if (resultWithPath.result.value != null) {
                if (ConfigImpl.traceSubstitutionsEnabled())
                    ConfigImpl.trace(newContext.depth(), "recursively resolving " + resultWithPath
                            + " which was the resolution of " + expr + " against " + source);

                ResolveSource recursiveResolveSource = (new ResolveSource(
                        (AbstractConfigObject) resultWithPath.pathFromRoot.last(), resultWithPath.pathFromRoot));

                if (ConfigImpl.traceSubstitutionsEnabled())
                    ConfigImpl.trace(newContext.depth(), "will recursively resolve against " + recursiveResolveSource);

                ResolveResult<? extends AbstractConfigValue> result = newContext.resolve(resultWithPath.result.value,
                        recursiveResolveSource);
                v = result.value;
                newContext = result.context;
            } else {
                ConfigValue fallback = context.options().getResolver().lookup(expr.path().render());
                v = (AbstractConfigValue) fallback;
            }
        } catch (NotPossibleToResolve e) {
            if (ConfigImpl.traceSubstitutionsEnabled())
                ConfigImpl.trace(newContext.depth(),
                        "not possible to resolve " + expr + ", cycle involved: " + e.traceString());
            if (expr.optional())
                v = null;
            else
                throw new ConfigException.UnresolvedSubstitution(origin(), expr
                        + " was part of a cycle of substitutions involving " + e.traceString(), e);
        }

        if (v == null && !expr.optional()) {
            if (newContext.options().getAllowUnresolved())
                return ResolveResult.make(newContext.removeCycleMarker(this), this);
            else
                throw new ConfigException.UnresolvedSubstitution(origin(), expr.toString());
        } else {
            return ResolveResult.make(newContext.removeCycleMarker(this), v);
        }
    }
1267734
def _resolve_default(data_type, listify=False):
    """"""
    if isinstance(data_type, _ATOMIC):
        # A Python's object type needs to be left as is instead of being
        # wrapped into a NumPy type.
        out = (data_type.default if isinstance(data_type, Object)
               else _get_atomic_dtype(data_type)(data_type.default))
    elif isinstance(data_type, Array):
        element_default = _resolve_default(data_type.element_type,
                                           listify=listify)
        Sequence = list if listify else tuple
        shape = ((data_type.shape,) if isinstance(data_type.shape, int)
                 else data_type.shape)
        out = element_default
        for dimension in shape:
            out = Sequence(copy.deepcopy(out) for _ in _range(dimension))
    elif isinstance(data_type, Structure):
        if listify:
            out = [_resolve_default(field.type, listify=listify)
                   for field in data_type.fields]
        else:
            field_defaults = collections.OrderedDict(
                (field.name, _resolve_default(field.type, listify=listify))
                for field in data_type.fields)
            name = ('StructureDefault_%s' % (data_type.name,)
                    if data_type.name else 'StructureDefault')
            struct = collections.namedtuple(name, field_defaults.keys())
            out = struct(**field_defaults)

    return out
81883
static boolean isSubtypeHelper(JSType thisType, JSType thatType,
      ImplCache implicitImplCache, SubtypingMode subtypingMode) {
    checkNotNull(thisType);
    // unknown
    if (thatType.isUnknownType()) {
      return true;
    }
    // all type
    if (thatType.isAllType()) {
      return true;
    }
    // equality
    if (thisType.isEquivalentTo(thatType, implicitImplCache.isStructuralTyping())) {
      return true;
    }
    // unions
    if (thatType.isUnionType()) {
      UnionType union = thatType.toMaybeUnionType();
      // use an indexed for-loop to avoid allocations
      ImmutableList<JSType> alternates = union.getAlternates();
      for (int i = 0; i < alternates.size(); i++) {
        JSType element = alternates.get(i);
        if (thisType.isSubtype(element, implicitImplCache, subtypingMode)) {
          return true;
        }
      }
      return false;
    }
    if (subtypingMode == SubtypingMode.IGNORE_NULL_UNDEFINED
        && (thisType.isNullType() || thisType.isVoidType())) {
      return true;
    }

    // TemplateTypeMaps. This check only returns false if the TemplateTypeMaps
    // are not equivalent.
    TemplateTypeMap thisTypeParams = thisType.getTemplateTypeMap();
    TemplateTypeMap thatTypeParams = thatType.getTemplateTypeMap();
    boolean templateMatch = true;
    if (isBivariantType(thatType)) {
      // Array and Object are exempt from template type invariance; their
      // template types maps are bivariant.  That is they are considered
      // a match if either ObjectElementKey values are subtypes of the
      // other.
      TemplateType key = thisType.registry.getObjectElementKey();
      JSType thisElement = thisTypeParams.getResolvedTemplateType(key);
      JSType thatElement = thatTypeParams.getResolvedTemplateType(key);

      templateMatch = thisElement.isSubtype(thatElement, implicitImplCache, subtypingMode)
          || thatElement.isSubtype(thisElement, implicitImplCache, subtypingMode);
    } else if (isIThenableSubtype(thatType)) {
      // NOTE: special case IThenable subclass (Promise, etc).  These classes are expected to be
      // covariant.
      // Also note that this ignores any additional template type arguments that might be defined
      // on subtypes.  If we expand this to other types, a more correct solution will be needed.
      TemplateType key = thisType.registry.getThenableValueKey();
      JSType thisElement = thisTypeParams.getResolvedTemplateType(key);
      JSType thatElement = thatTypeParams.getResolvedTemplateType(key);

      templateMatch = thisElement.isSubtype(thatElement, implicitImplCache, subtypingMode);
    } else {
      templateMatch = thisTypeParams.checkEquivalenceHelper(
          thatTypeParams, EquivalenceMethod.INVARIANT, subtypingMode);
    }
    if (!templateMatch) {
      return false;
    }

    // If the super type is a structural type, then we can't safely remove a templatized type
    // (since it might affect the types of the properties)
    if (implicitImplCache.shouldMatchStructurally(thisType, thatType)) {
      return thisType
          .toMaybeObjectType()
          .isStructuralSubtype(thatType.toMaybeObjectType(), implicitImplCache, subtypingMode);
    }

    // Templatized types. For nominal types, the above check guarantees TemplateTypeMap
    // equivalence; check if the base type is a subtype.
    if (thisType.isTemplatizedType()) {
      return thisType
          .toMaybeTemplatizedType()
          .getReferencedType()
          .isSubtype(thatType, implicitImplCache, subtypingMode);
    }

    // proxy types
    if (thatType instanceof ProxyObjectType) {
      return thisType.isSubtype(
          ((ProxyObjectType) thatType).getReferencedTypeInternal(),
          implicitImplCache,
          subtypingMode);
    }
    return false;
  }
366148
@SuppressWarnings("unchecked")
    public static <T> T getJlsDefaultValue(Class<T> type) {
        if(!type.isPrimitive()) {
           return null;
        }
        return (T) JLS_PRIMITIVE_DEFAULT_VALUES.get(type);
    }
1006795
function (proto) {
            // Using push instead of resetting the reference because items are not copied from proto but from the
            // parameter of tplScriptDefinition directly
            proto.ICONS.push({
                type : ariaUtilsData.TYPE_ERROR,
                icon : "std:error"
            }, {
                type : ariaUtilsData.TYPE_WARNING,
                icon : "std:warning"
            }, {
                type : ariaUtilsData.TYPE_INFO,
                icon : "std:info"
            }, {
                type : ariaUtilsData.TYPE_FATAL,
                icon : "std:error"
            }, {
                type : ariaUtilsData.TYPE_NOTYPE,
                icon : "std:info"
            }, {
                type : ariaUtilsData.TYPE_CRITICAL_WARNING,
                icon : "std:warning"
            }, {
                type : ariaUtilsData.TYPE_CONFIRMATION,
                icon : "std:confirm"
            });
        }
1057054
public void eInit(SarlScript script, String name, IJvmTypeProvider context) {
		setTypeResolutionContext(context);
		if (this.sarlEnumeration == null) {
			this.container = script;
			this.sarlEnumeration = SarlFactory.eINSTANCE.createSarlEnumeration();
			script.getXtendTypes().add(this.sarlEnumeration);
			this.sarlEnumeration.setAnnotationInfo(XtendFactory.eINSTANCE.createXtendTypeDeclaration());
			if (!Strings.isEmpty(name)) {
				this.sarlEnumeration.setName(name);
			}
		}
	}
1010327
public void eInit(XtendTypeDeclaration container, String name, String modifier, IJvmTypeProvider context) {
		this.builder.eInit(container, name, modifier, context);
	}
5835
public static void loadImplicitObjects(HttpServletRequest request,
                                           HttpServletResponse response,
                                           ServletContext servletContext,
                                           PageFlowController currentPageFlow) {
        // @todo: add an interceptor chain here for putting implicit objects into the request
        loadPageFlow(request, currentPageFlow);

        // @todo: need to move bundleMap creation to a BundleMapFactory
        BundleMap bundleMap = new BundleMap(request, servletContext);
        loadBundleMap(request, bundleMap);
    }
460106
public void eInit(XtendTypeDeclaration container, String name, IJvmTypeProvider context) {
		if (this.sarlEnumeration == null) {
			this.container = container;
			this.sarlEnumeration = SarlFactory.eINSTANCE.createSarlEnumeration();
			container.getMembers().add(this.sarlEnumeration);
			if (!Strings.isEmpty(name)) {
				this.sarlEnumeration.setName(name);
			}
		}
	}
1158702
function updateClassInstance(current, workInProgress, ctor, newProps, renderExpirationTime) {
  var instance = workInProgress.stateNode;

  var oldProps = workInProgress.memoizedProps;
  instance.props = workInProgress.type === workInProgress.elementType ? oldProps : resolveDefaultProps(workInProgress.type, oldProps);

  var oldContext = instance.context;
  var contextType = ctor.contextType;
  var nextContext = void 0;
  if (typeof contextType === 'object' && contextType !== null) {
    nextContext = readContext(contextType);
  } else {
    var nextUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true);
    nextContext = getMaskedContext(workInProgress, nextUnmaskedContext);
  }

  var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
  var hasNewLifecycles = typeof getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function';

  // Note: During these life-cycles, instance.props/instance.state are what
  // ever the previously attempted to render - not the "current". However,
  // during componentDidUpdate we pass the "current" props.

  // In order to support react-lifecycles-compat polyfilled components,
  // Unsafe lifecycles should not be invoked for components using the new APIs.
  if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function')) {
    if (oldProps !== newProps || oldContext !== nextContext) {
      callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext);
    }
  }

  resetHasForceUpdateBeforeProcessing();

  var oldState = workInProgress.memoizedState;
  var newState = instance.state = oldState;
  var updateQueue = workInProgress.updateQueue;
  if (updateQueue !== null) {
    processUpdateQueue(workInProgress, updateQueue, newProps, instance, renderExpirationTime);
    newState = workInProgress.memoizedState;
  }

  if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) {
    // If an update was already in progress, we should schedule an Update
    // effect even though we're bailing out, so that cWU/cDU are called.
    if (typeof instance.componentDidUpdate === 'function') {
      if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {
        workInProgress.effectTag |= Update;
      }
    }
    if (typeof instance.getSnapshotBeforeUpdate === 'function') {
      if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {
        workInProgress.effectTag |= Snapshot;
      }
    }
    return false;
  }

  if (typeof getDerivedStateFromProps === 'function') {
    applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps);
    newState = workInProgress.memoizedState;
  }

  var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext);

  if (shouldUpdate) {
    // In order to support react-lifecycles-compat polyfilled components,
    // Unsafe lifecycles should not be invoked for components using the new APIs.
    if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillUpdate === 'function' || typeof instance.componentWillUpdate === 'function')) {
      startPhaseTimer(workInProgress, 'componentWillUpdate');
      if (typeof instance.componentWillUpdate === 'function') {
        instance.componentWillUpdate(newProps, newState, nextContext);
      }
      if (typeof instance.UNSAFE_componentWillUpdate === 'function') {
        instance.UNSAFE_componentWillUpdate(newProps, newState, nextContext);
      }
      stopPhaseTimer();
    }
    if (typeof instance.componentDidUpdate === 'function') {
      workInProgress.effectTag |= Update;
    }
    if (typeof instance.getSnapshotBeforeUpdate === 'function') {
      workInProgress.effectTag |= Snapshot;
    }
  } else {
    // If an update was already in progress, we should schedule an Update
    // effect even though we're bailing out, so that cWU/cDU are called.
    if (typeof instance.componentDidUpdate === 'function') {
      if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {
        workInProgress.effectTag |= Update;
      }
    }
    if (typeof instance.getSnapshotBeforeUpdate === 'function') {
      if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {
        workInProgress.effectTag |= Snapshot;
      }
    }

    // If shouldComponentUpdate returned false, we should still update the
    // memoized props/state to indicate that this work can be reused.
    workInProgress.memoizedProps = newProps;
    workInProgress.memoizedState = newState;
  }

  // Update the existing instance's state, props, and context pointers even
  // if shouldComponentUpdate returns false.
  instance.props = newProps;
  instance.state = newState;
  instance.context = nextContext;

  return shouldUpdate;
}
1043283
public void eInit(XtendTypeDeclaration container, IJvmTypeProvider context) {
		setTypeResolutionContext(context);
		if (this.sarlConstructor == null) {
			this.container = container;
			this.sarlConstructor = SarlFactory.eINSTANCE.createSarlConstructor();
			this.sarlConstructor.setAnnotationInfo(XtendFactory.eINSTANCE.createXtendMember());
			container.getMembers().add(this.sarlConstructor);
		}
	}