Status: New
Owner: ----
New issue 673 by [email protected]: AssistedInject issues misleading
error messages for generic methods that are fully-specified
http://code.google.com/p/google-guice/issues/detail?id=673
This is a follow-up to bug #329.
When I bind an AssistedInject factory as follows:
install(new
FactoryModuleBuilder().build(RequestScopedCompletionHandlerBuilder.class));
Guice complains:
RequestScopedCompletionHandlerBuilder cannot be used as a key; It
is not fully specified.
Here is the factory definition:
public interface RequestScopedCompletionHandlerBuilder
{
<V, A> RequestScopedCompletionHandler<V, A> build(
Class<? extends CompletionHandler<V, A>> handler);
}
Upon further investigation I discovered that this exception is thrown if
the return type of the factory method is generic but the factory class is
not. I believe this error message is incorrect, meant to cover the case
where the user tries to bind a generic factory using a non-generic Key (as
mentioned in bug #329). This isn't the case here. The factory is fully
specified, as is the Key. I believe Guice has all the necessary information
to construct the factory.
--
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.