return createInternalProvider(this, binding.getKey(), false, false); case CLASS: return createInternalProvider(this, binding.getImplementationClass(), false, return createInternalProvider(this, binding.getProviderClass(), true,
/*VisibleForTesting*/ <T> InternalProviderImpl<T> toProvider(Binding<T> binding) { if (binding == null) { throw new IllegalStateException("null binding are not allowed. Should not happen unless getBindingSet is overridden."); } Configuration.instance.checkIllegalBinding(binding); switch (binding.getMode()) { case SIMPLE: return createInternalProvider(this, binding.getKey(), false, binding.isScoped()); case CLASS: return createInternalProvider(this, binding.getImplementationClass(), false, binding.isScoped()); case INSTANCE: return new InternalProviderImpl<>(binding.getInstance()); case PROVIDER_INSTANCE: // to ensure providers do not have to deal with concurrency, we wrap them in a thread safe provider // We do not need to pass the scope here because the provider won't use any scope to create the instance return new InternalProviderImpl<>(binding.getProviderInstance()); case PROVIDER_CLASS: return createInternalProvider(this, binding.getProviderClass(), true, binding.isScoped()); //JACOCO:OFF default: throw new IllegalStateException(format("mode is not handled: %s. This should not happen.", binding.getMode())); //JACOCO:ON } }
return createInternalProvider(this, binding.getKey(), false, false); case CLASS: return createInternalProvider(this, binding.getImplementationClass(), false, return createInternalProvider(this, binding.getProviderClass(), true,