bineanzhou / google-guice

Automatically exported from code.google.com/p/google-guice
Apache License 2.0
0 stars 0 forks source link

Error message for non-static inner classes is not intuitive #154

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
say you 

bind(Foo.class).toProvider(FooProvider.class)

where FooProvider is an inner class of Bar. Say that, by mistake, the inner
class was not declared static. And say Foo has a non-zero-arg constructor.

Guice will report an error saying FooProvider should have a zero-arg
constructor or a constructor marked as @Inject. Though technically correct,
the message is not very helpful.

Original issue reported on code.google.com by zorze...@gmail.com on 13 Sep 2007 at 3:14

GoogleCodeExporter commented 9 years ago
"Missing binding to com.google.inject.ErrorMessagesTest$InnerClass: Injecting 
into inner classes is not 
supported.  Please use a 'static' class (top-level or nested) instead."

Original comment by limpbizkit on 13 May 2008 at 10:46