Skip to content

Commit

Permalink
Make @ProvidedBy take a javax.inject.Provider.
Browse files Browse the repository at this point in the history
  • Loading branch information
tavianator committed May 7, 2015
1 parent d6234ab commit f39b444
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion core/src/com/google/inject/ProvidedBy.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@
/**
* The implementation type.
*/
Class<? extends Provider<?>> value();
Class<? extends javax.inject.Provider<?>> value();
}
2 changes: 1 addition & 1 deletion core/src/com/google/inject/internal/Errors.java
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public Errors bindingToProvider() {
return addMessage("Binding to Provider is not allowed.");
}

public Errors subtypeNotProvided(Class<? extends Provider<?>> providerType,
public Errors subtypeNotProvided(Class<? extends javax.inject.Provider<?>> providerType,
Class<?> type) {
return addMessage("%s doesn't provide instances of %s.", providerType, type);
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/com/google/inject/internal/InjectorImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ private <T> BindingImpl<TypeLiteral<T>> createTypeLiteralBinding(
<T> BindingImpl<T> createProvidedByBinding(Key<T> key, Scoping scoping,
ProvidedBy providedBy, Errors errors) throws ErrorsException {
Class<?> rawType = key.getTypeLiteral().getRawType();
Class<? extends Provider<?>> providerType = providedBy.value();
Class<? extends javax.inject.Provider<?>> providerType = providedBy.value();

// Make sure it's not the same type. TODO: Can we check for deeper loops?
if (providerType == rawType) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@

import com.google.inject.Key;
import com.google.inject.ProvidedBy;
import com.google.inject.Provider;
import com.google.inject.internal.InjectorImpl.JitLimitation;
import com.google.inject.spi.Dependency;

import javax.inject.Provider;

/**
* An {@link InternalFactory} for {@literal @}{@link ProvidedBy} bindings.
*
Expand Down

0 comments on commit f39b444

Please sign in to comment.