Return the type resolver.
<p>
Looks up an instance in the scanner context. If none can be found the default
resolver is used.
</p>

@return The type resolver.
331701
private TypeResolver getTypeResolver() {
        TypeResolver typeResolver = scannerContext.peek(TypeResolver.class);
        if (typeResolver == null) {
            throw new IllegalStateException("Cannot find Java type resolver.");
        }
        return typeResolver;
    }
1073799
public final int resolveClassIndex(TypeElement type)
    {
        int size = 0;
        int index = 0;
        constantReadLock.lock();
        try
        {
            size = getConstantPoolSize();
            index = getClassIndex(type);
        }
        finally
        {
            constantReadLock.unlock();
        }
        if (index == -1)
        {
            String name = El.getInternalForm(type);
            int nameIndex = resolveNameIndex(name);
            index = addConstantInfo(new Clazz(nameIndex), size);
        }
        addIndexedElement(index, type);
        return index;
    }
1126324
public static IResolver defaultResolver() {
        return new IResolver() {
            @Override
            public Record[] resolve(Domain domain) throws IOException {
                String[] addresses = defaultServer();
                if (addresses == null) {
                    throw new IOException("no dns server");
                }
                IResolver resolver = new Resolver(InetAddress.getByName(addresses[0]));
                return resolver.resolve(domain);
            }
        };
    }
343782
protected @Nonnull <T> Collection<T> getBeansOfType(@Nullable BeanResolutionContext resolutionContext, @Nonnull Class<T> beanType) {
        return getBeansOfTypeInternal(resolutionContext, beanType, null);
    }
661306
public TypeName resolve(TypeName inputType) {
		if (!hasTypeVariables())
			return inputType;
		
		if (inputType.isPrimitive() || inputType.isBoxedPrimitive() || inputType.equals(TypeName.get(String.class))) {
			return inputType;
		}
		
		if (TypeName.VOID.equals(inputType)) return inputType;
		
		TypeName resolved=null;
		if (inputType instanceof ParameterizedTypeName)
		{
			ParameterizedTypeName inputParametrizedTypeName=(ParameterizedTypeName)inputType;
			
			TypeName[] typeArguments=new TypeName[inputParametrizedTypeName.typeArguments.size()];
			int i=0;
			for (TypeName item: inputParametrizedTypeName.typeArguments)
			{
				typeArguments[i]=resolve(item);
				i++;
			}
			
			resolved=ParameterizedTypeName.get((ClassName)resolve(inputParametrizedTypeName.rawType), typeArguments);
			
			return resolved;
		} else if (inputType instanceof ArrayTypeName)
		{
			ArrayTypeName inputTypeName=(ArrayTypeName)inputType;
			
			resolved=ArrayTypeName.of(resolve(inputTypeName.componentType));
			
			return resolved;
		} else {
			// it's not a type variable
			if (inputType.toString().contains(".")) {
				return inputType;
			}
			// ASSERT: simple typeName 
			if (typeVariableMap.containsKey(inputType.toString())) {
				TypeName type = typeVariableMap.get(inputType.toString());
				return type;
			} else if (declaredTypeArgumentList.size()==1){
				resolved = declaredTypeArgumentList.get(0);
				// if we found an unique type variable, we use it.
				//typeVariableMap = new HashMap<>();
				//typeVariableMap.put(inputTypeName.toString(), resolved);

				return resolved;
			}
			
			AssertKripton.assertTrue(false, "In type hierarchy of %s '%s' there is a unresolved type variable named '%s'. Define it with @BindTypeVariables", element.getKind()==ElementKind.CLASS ? "class" :"interface", element.getQualifiedName(),
					inputType.toString());
			
			return resolved;
		}
		
	}
107826
public static ClasspathScanner getInstance() {

    if (instance == null) {
      synchronized (AbstractClasspathScanner.class) {
        if (instance == null) {
          ClasspathScannerImpl impl = new ClasspathScannerImpl();
          impl.initialize();
        }
      }
    }
    return instance;
  }
563698
@Bean
  public ViewResolver viewResolver() {
    FreeMarkerViewResolver resolver = new FreeMarkerViewResolver();
    resolver.setCache(true);
    resolver.setSuffix(".ftl");
    resolver.setContentType("text/html;charset=UTF-8");
    return resolver;
  }
1122921
public static Class<?> resolveCaller()
    {
        Class<?> callerClass = null;

        StackTraceElement[] stackTraces = Thread.currentThread().getStackTrace();
        int stackSize = stackTraces.length;

        // StackTrace is below. So check from 3rd element.
        // 1st:java.lang.Thread
        // 2nd:ResourceResolver#resolveCaller(this method)
        for (int stackIndex = 2; stackIndex < stackSize; stackIndex++)
        {
            StackTraceElement stackTrace = stackTraces[stackIndex];
            String callerClassName = stackTrace.getClassName();
            if (StringUtils.equals(ResourceResolver.class.getName(), callerClassName) == false)
            {
                try
                {
                    callerClass = Class.forName(callerClassName);
                    break;
                }
                catch (ClassNotFoundException ex)
                {
                    return null;
                }
            }
        }

        return callerClass;
    }
1371102
public LightweightTypeReference resolve() {
		if (internalIsResolved())
			return resolvedTo;
		List<LightweightBoundTypeArgument> allHints = getAllHints();
		if (!allHints.isEmpty() && resolveWithHints(allHints)) {
			LightweightTypeReference result = internalGetResolvedTo();
			if (result != null) {
				return result;
			}
		}
		resolveAgainstConstraints();
		return resolvedTo;
	}
199962
public static NlsTemplateResolver getTemplateResolver() {

    if (templateResolver == null) {
      synchronized (NlsAccess.class) {
        if (templateResolver == null) {
          DefaultNlsTemplateResolver resolver = new DefaultNlsTemplateResolver();
          resolver.initialize();
        }
      }
    }
    return templateResolver;
  }
547959
public com.google.appengine.v1.ScriptHandlerOrBuilder getScriptOrBuilder() {
    if (handlerTypeCase_ == 3) {
       return (com.google.appengine.v1.ScriptHandler) handlerType_;
    }
    return com.google.appengine.v1.ScriptHandler.getDefaultInstance();
  }
514427
public ResolvableType getComponentType() {
        if (this == NONE) {
            return NONE;
        }
        if (this.componentType != null) {
            return this.componentType;
        }
        if (this.type instanceof Class) {
            Class<?> componentType = ((Class<?>) this.type).getComponentType();
            return forType(componentType, this.variableResolver);
        }
        if (this.type instanceof GenericArrayType) {
            return forType(((GenericArrayType) this.type).getGenericComponentType(), this.variableResolver);
        }
        return resolveType().getComponentType();
    }
1274006
public JType getGenericType()
  {
    try {
      Type type = _field.getGenericType();

      if (type instanceof Class)
  return getType();
      else
  return new JTypeWrapper(_loader, (ParameterizedType) type);
    } catch (NoSuchMethodError e) {
      return getType();
    }
  }
749774
public Throwable getResolvingCause() {
        Throwable t = this, c = this;
        while (c instanceof ResolvingException) {
            t = c; c = t.getCause();
        }
        return c == null ? t : c;
    }
449438
@Override
    public TYPE getType() {
        final IPortalUrlBuilder portalUrlBuilder = this.portletUrlBuilder.getPortalUrlBuilder();
        final UrlType urlType = portalUrlBuilder.getUrlType();
        return urlType.getPortletUrlType();
    }
273306
protected Resolver getResolver()
        throws MojoExecutionException
    {
        List<File> catalogFiles = new ArrayList<File>();
        List<URL> catalogUrls = new ArrayList<URL>();
        setCatalogs( catalogFiles, catalogUrls );

        return new Resolver( getBasedir(), catalogFiles, catalogUrls, getLocator(), catalogHandling,getLog().isDebugEnabled() );
    }
184385
private Class getMapType()
  {
    Class mapType = Map.class;
    IParsedElement parent = getParsedElement().getParent();
    if( parent instanceof NewExpression )
    {
      IType newType = ((NewExpression)parent).getType();
      IJavaClassInfo classInfo = IRTypeResolver.getJavaBackedClass(newType);
      Class javaBackedClass = classInfo != null ? classInfo.getBackingClass() : null;
      if( classInfo != null && javaBackedClass != null )
      {
        mapType = javaBackedClass;
      }
      else if( JavaTypes.getJreType(AbstractMap.class).isAssignableFrom( newType ) )
      {
        mapType = AbstractMap.class;
      }
    }
    return mapType;
  }