Returns a new context in whatever state is appropriate given the current {@code elType}.
177452
@CheckReturnValue
  Context transitionToAfterTag() {
    Context.Builder builder = toBuilder();
    builder.withoutAttrContext();
    switch (elType) {
      case SCRIPT:
        builder
            .withState(HtmlContext.JS)
            .withSlashType(Context.JsFollowingSlash.REGEX)
            .withElType(Context.ElementType.NONE);
        break;
      case STYLE:
        builder.withState(HtmlContext.CSS).withElType(Context.ElementType.NONE);
        break;
      case TEXTAREA:
      case TITLE:
      case XMP:
        builder.withState(HtmlContext.HTML_RCDATA);
        break;
        // All normal or void tags fit here.
      case NORMAL:
      case BASE:
      case LINK_EXECUTABLE:
      case META_REFRESH:
      case IFRAME:
      case MEDIA:
        builder.withState(HtmlContext.HTML_PCDATA).withElType(Context.ElementType.NONE);
        break;
      case NONE:
        throw new IllegalStateException();
    }
    return builder.build();
  }
25100
@Pure
	public static Object getContext() throws AndroidException {
		final Object ctx;
		synchronized (Android.class) {
			if (context == null) {
				throw new AndroidException();
			}
			ctx = context.get();
		}
		if (ctx == null) {
			throw new AndroidException();
		}
		return ctx;
	}
947716
public Class getType(FacesContext context) throws MethodNotFoundException
    {
        try
        {
            return m.getMethodInfo(context.getELContext()).getReturnType();
        }
        catch (javax.el.MethodNotFoundException e)
        {
            throw new MethodNotFoundException(e.getMessage(), e.getCause());
        }
        catch (ELException e)
        {
            throw new EvaluationException(e.getMessage(), e.getCause());
        }
    }
626948
@Benchmark
  @BenchmarkMode(Mode.SampleTime)
  @OutputTimeUnit(TimeUnit.NANOSECONDS)
  public StatsTraceContext newClientContext() {
    return StatsTraceContext.newClientContext(CallOptions.DEFAULT, Attributes.EMPTY, emptyMetadata);
  }
185463
@Override
	public LightweightTypeReference newReferenceTo(Class<?> type) {
		JvmType rawType = getServices().getTypeReferences().findDeclaredType(type, getContextResourceSet());
		if (rawType == null) {
			return newUnknownTypeReference(type.getName());
		}
		return toPlainTypeReference(rawType);
	}
666371
private static <E extends Enum<E>> E[] getUniverse(Class<E> elementType) {
        // Android-changed: Use JavaLangAccess directly instead of going via
        // SharedSecrets.
        return java.lang.JavaLangAccess.getEnumConstantsShared(elementType);
    }
181216
static final Context context(Element match, int matchIndex, int matchSize, Element element, int elementIndex, int elementSize) {
        return new DefaultContext(match, matchIndex, matchSize, element, elementIndex, elementSize);
    }
751296
public static <T> T getContext(ELContext context, Class<T> key, T defaultValue) {
        @SuppressWarnings("unchecked")
        final T result = (T) context.getContext(key);
        return result == null ? defaultValue : result;
    }
1217520
protected Context getContext() {
        if (context == null) {
            context = getTomcat().addContext(getConfig().getContextPath(),
                    getConfig().getContextRootDirectory().getAbsolutePath());
        }
        return context;
    }
903997
public static Types instance(Context context) {
        Types instance = context.get(typesKey);
        if (instance == null)
            instance = new Types(context);
        return instance;
    }
367386
@SuppressWarnings("static-method")
	protected ExtraLanguageTypeConverter createTypeConverterInstance(
			IExtraLanguageConversionInitializer initializer,
			IExtraLanguageGeneratorContext context) {
		return new ExtraLanguageTypeConverter(initializer, context);
	}
1061108
protected Context getContext() {
        if (act != null) {
            return act;
        }
        if (root != null) {
            return root.getContext();
        }
        return context;
    }
1048420
private RelType convertContext(String type)
	{
		if (type.equals("I")) return RelType.INPUT;
		if (type.equals("O")) return RelType.OUTPUT;
		if (type.equals("B")) return null;
		throw new IllegalArgumentException("Unknown context: " + type);
	}
121786
public ServletContext getCurrentServletContext() {
        final ClassLoader cl = getContextClassLoader();
        if (cl == null) {
            return null;
        }
        return servletContexts.get(cl);
    }
408431
protected IExtraLanguageGeneratorContext createGeneratorContext(IFileSystemAccess2 fsa, IGeneratorContext context,
			Resource resource) {
		if (context instanceof IExtraLanguageGeneratorContext) {
			return (IExtraLanguageGeneratorContext) context;
		}
		return new ExtraLanguageGeneratorContext(context, fsa, this, resource, getPreferenceID());
	}
451412
public Type elemtype(Type t) {
        switch (t.getTag()) {
        case WILDCARD:
            return elemtype(wildUpperBound(t));
        case ARRAY:
            t = t.unannotatedType();
            return ((ArrayType)t).elemtype;
        case FORALL:
            return elemtype(((ForAll)t).qtype);
        case ERROR:
            return t;
        default:
            return null;
        }
    }
560370
protected InvocationContextImpl getInvocationContext() {
        // does not seem useful to cache one of these per bean instance; create a new one
        InvocationContextImpl invocationContext = createInvocationContext();
        invocationContext.initialize(ivEjbInstance, ivEjbManagedObjectContext, ivInterceptors);
        return invocationContext;
    }