Issue 256: bindConstant().annotatedWith(clazz).to(null) causes ambigious
error message
http://code.google.com/p/google-guice/issues/detail?id=256
New issue report by juha.mynttinen:
This is not a bug, but an enhancement request.
If I have "bindConstants().annotatedWith(clazz).to(null)" in my code, the
exception thrown will be:
java.lang.NullPointerException: value
at com.google.inject.util.Objects.nonNull(Objects.java:35)
at com.google.inject.ConstantFactory.<init>(ConstantFactory.java:30)
at
com.google.inject.ConstantBindingBuilderImpl$BindingInfo.createBinding(ConstantBindingBuilderImpl.java:161)
at
com.google.inject.ConstantBindingBuilderImpl.createBinding(ConstantBindingBuilderImpl.java:141)
at
com.google.inject.BinderImpl.createConstantBinding(BinderImpl.java:355)
at
com.google.inject.BinderImpl.createConstantBindings(BinderImpl.java:349)
at com.google.inject.BinderImpl.createInjector(BinderImpl.java:249)
at com.google.inject.Guice.createInjector(Guice.java:79)
at com.google.inject.Guice.createInjector(Guice.java:53)
at com.google.inject.Guice.createInjector(Guice.java:43)
If the codebase is full of constant bindings, this message is ambigious,
because it doesn't tell _which_ binding was the problem. Normally the error
messages Guice provides are excellent and very nicely point to the real
reason behind any exception. It'd be good idea to provide a more accurate
error message also in this case.
Issue attributes:
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---