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(ConstantB
indingBuilderImpl.java:161)
at
com.google.inject.ConstantBindingBuilderImpl.createBinding(ConstantBindingBuilde
rImpl.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.
Original issue reported on code.google.com by juha.myn...@gmail.com on 6 Oct 2008 at 8:31
Original issue reported on code.google.com by
juha.myn...@gmail.com
on 6 Oct 2008 at 8:31