@Override @SuppressWarnings("unchecked") public T get(InternalContext context, Dependency<?> dependency, boolean linked) throws InternalProvisionException { ConstructorInjector<T> localInjector = constructorInjector; if (localInjector == null) { throw new IllegalStateException("Constructor not ready"); } if (!linked && failIfNotLinked) { throw InternalProvisionException.jitDisabled(key); } // This may not actually be safe because it could return a super type of T (if that's all the // client needs), but it should be OK in practice thanks to the wonders of erasure. return (T) localInjector.construct(context, dependency, provisionCallback); } }
@Override @SuppressWarnings("unchecked") public T get(InternalContext context, Dependency<?> dependency, boolean linked) throws InternalProvisionException { ConstructorInjector<T> localInjector = constructorInjector; if (localInjector == null) { throw new IllegalStateException("Constructor not ready"); } if (!linked && failIfNotLinked) { throw InternalProvisionException.jitDisabled(key); } // This may not actually be safe because it could return a super type of T (if that's all the // client needs), but it should be OK in practice thanks to the wonders of erasure. return (T) localInjector.construct(context, dependency, provisionCallback); } }
@Override @SuppressWarnings("unchecked") public T get(InternalContext context, Dependency<?> dependency, boolean linked) throws InternalProvisionException { ConstructorInjector<T> localInjector = constructorInjector; if (localInjector == null) { throw new IllegalStateException("Constructor not ready"); } if (!linked && failIfNotLinked) { throw InternalProvisionException.jitDisabled(key); } // This may not actually be safe because it could return a super type of T (if that's all the // client needs), but it should be OK in practice thanks to the wonders of erasure. return (T) localInjector.construct(context, dependency, provisionCallback); } }