@ SuppressWarnings ( "unchecked" ) @ Nonnull private synchronized < T > Provider < T > getProvider ( final Key < T > key ) { // Previously-gotten providers (including those from subinjectors) will already be present. return ( Provider < T > ) providers . computeIfAbsent ( key , k -> { // @AutoFactory requests are always handled by the top-level injector. if ( key . isAutoFactory ( ) ) { return memoized ( new ScopeBuilderProvider <> ( key . getDependencyClass ( ) ) ) ; } // Find a provider locally. return findLocalProvider ( key ) ; } ) ; }
Finds a provider for the given key .