| 57 | // This method is declared this way instead of "<T> Provider<T> provider(Provider<T> provider)" |
| 58 | // to work around an Eclipse type inference bug: https://github.com/google/dagger/issues/949. |
| 59 | public static <P extends Provider<T>, T> Provider<T> provider(P provider) { |
| 60 | // If a scoped @Binds delegates to a scoped binding, don't cache the value again. |
| 61 | if (provider instanceof SingleCheck || provider instanceof DoubleCheck) { |
| 62 | return provider; |
| 63 | } |
| 64 | return new SingleCheck<T>(checkNotNull(provider)); |
| 65 | } |
| 66 | } |