Comment #1 on issue 633 by sberlin: Provide a better error message when you
try to inject a raw Provider.
http://code.google.com/p/google-guice/issues/detail?id=633
Can you add a testcase that reproduces this? With this code:
public void testRawProviderInjection() {
Guice.createInjector().getInstance(HasRawProvider.class);
}
private static class HasRawProvider {
@Inject HasRawProvider(Provider p) {}
}
I get:
com.google.inject.ConfigurationException: Guice configuration errors:
1) Cannot inject a Provider that has no type parameter
while locating com.google.inject.Provider
for parameter 0 at
com.google.inject.InjectorTest$HasRawProvider.<init>(InjectorTest.java:419)
while locating com.google.inject.InjectorTest$HasRawProvider
1 error
at
com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:1016)
at
com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:975)
at
com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1025)
at
com.google.inject.InjectorTest.testRawProviderInjection(InjectorTest.java:415)
--
You received this message because you are subscribed to the Google Groups
"google-guice-dev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-guice-dev?hl=en.